{"id": "freecad-docs:wiki/Add_Workbench_to_Addon_Manager.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Add_Workbench_to_Addon_Manager.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Add_Workbench_to_Addon_Manager.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "da17537433e6351ff907e31b8c78f8b7104ae2c7f25dd097d89f98cef1d14a1d", "bytes": 3436, "tokens": 1084, "text": "# Add Workbench to Addon Manager\n## Introduction\n\nThese are step-by-step instructions on how to add a Python workbench to the [Addon Manager](Std_AddonMgr.md).\n\nRequirements:\n\n- A local git repository.\n- A remote git repository. Supported git hosts are [GitHub](https://github.com), [GitLab](https://about.gitlab.com/), [Framagit](https://framagit.org/public/projects) and [Debian Salsa](https://salsa.debian.org/public).\n- Git must be installed.\n\n## Enable developer mode \n\n1. Open the [Preferences Editor](Preferences_Editor.md): select the **Edit → Preferences...** option from the menu.\n2. Select the ** Addon Manager** option in the left bar.\n3. On the **Addon manager options** tab check the **Addon developer mode** checkbox. This will enable the **Developer tools...** button in the Addon Manager.\n4. Press the **OK** button to close the Preferences Editor.\n\n## Create the package.xml file \n\n1. Open the [Addon Manager](Std_AddonMgr.md): select the **Tools → Addon manager** option from the menu.\n2. Press the **Developer tools...** button.\n3. The **Addon Developer Tools** dialog opens.\n \"\"\n4. Enter the following:\n - \n **Path to Addon**\n \n : The path to the local git repository.\n\n - \n **Addon Name**\n \n : This will appear in the listings of the Addon Manager.\n\n - \n **Description**\n \n : Idem.\n\n - \n **Version**\n \n : Idem.\n\n - \n **Repository URL**\n \n\n - \n **Primary branch**\n \n\n - \n **README URL**\n \n : Recommended.\n\n - \n **Icon**\n \n : The icon must be part of the repository.\n5. Press the **** button at the bottom of the dialog.\n6. The **Content Item** dialog opens.\n \"\"\n7. The **Content type** should be set to {{Value|Workbench}}.\n8. Check the **This is the only item in the Addon** checkbox.\n9. Enter the **Workbench class name**. This is the class name specified in the **InitGui.py** file.\n10. For the **Subdirectory** enter {{Value|./}}.\n11. Press the **OK** button to close the dialog.\n12. Press the **Save** button to close the **Addon Developer Tools** dialog and save the **package.xml** file.\n13. Press the ** Close** button to close the Addon Manager.\n14. Push the created file to your remote repository.\n\n## Add the workbench to the .gitmodules file \n\n1. Fork .\n2. Create a new branch.\n3. Edit the **.gitmodules** file to include your new Addon, in alphabetical order.\n4. Push the new branch to GitHub.\n5. Submit a Pull Request to the FreeCAD-Addons repository with the new **.gitmodules** file.\n\n## See also \n\n- [Workbench creation](Workbench_creation.md)\n- [Package Metadata](Package_Metadata.md): Detailed information about the **package.xml** file.\n\n\n---\n⏵ [documentation index](../README.md) > [Addons](Category_Addons.md) > [Developer Documentation](Category_Developer%20Documentation.md) > Add Workbench to Addon Manager\n"} {"id": "freecad-docs:wiki/Arch_MultiMaterial.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Arch_MultiMaterial.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Arch_MultiMaterial.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b82884d5c41d282d3362858f21e6a2aacb530ef42ba4f3756066c3343f21b420", "bytes": 3720, "tokens": 1118, "text": "---\n GuiCommand:\n Name: Arch MultiMaterial\n MenuLocation: Arch , Material tools , Multi-Material\n Workbenches: Arch_Workbench, BIM_Workbench\n Version: 0.17\n SeeAlso: Arch_SetMaterial\n---\n\n# Arch MultiMaterial\n\n## Description\n\nThe Multi-Material tool defines a list of [materials](Material.md) with, for each material, a name and a thickness value. This multi-materials list can then be added to an [Arch](Arch_Workbench.md) object instead of a single [Arch Material](Arch_SetMaterial.md) .\n\n![](images/Arch_multimaterial_example.png )\n\nNot all Arch objects can currently make use of multi-materials, and the use they do of it differs. Currently:\n\n- \"\" [Walls](Arch_Wall.md) with a MultiMaterial will use the material definitions and thicknesses to create a multi-layer wall\n- \"\" [Windows](Arch_Window.md) with a MultiMaterial will attribute materials with a given name defined inside the MultiMaterial to window components with a same name or type (see below). Material thickness is not considered.\n- \"\" [Panels](Arch_Panel.md) with a MultiMaterial will use the material definitions and thicknesses to create a multi-layer panel\n\n## Usage\n\n1. Create first a series of ** [Arch Materials](Arch_SetMaterial.md)** that you will need in your Multi-Material.\n2. Optionally, select an Arch object you wish to attribute the new Multi-Material to.\n3. Press the ** [Multi-Material](Arch_MultiMaterial.md)** button.\n4. Set the desired material layers.\n\n## Options\n\n![](images/Arch_multimaterial_panel.png )\n\nUpon creating or editing a multi-material by double-clicking it in the tree, the following options are available:\n\n- **Duplicate** another existing Multi-Material from the same document. This only copies the values over, and doesn\\'t link the two multi-materials in any way.\n- The **Name** field will also set the material object\\'s Label\n- The **Composition** list is the list of the different material layers that compose this multi-material. Each layer has a name, a material and a thickness value.\n- Click **Add** to add a new layer, **Up** to move a selected layer up, **Down** to move a selected layer down, or **Del** to delete a selected layer.\n- Double-click the **name** of a layer to edit it, the material will offer you a drop-down list of available [Arch Materials](Arch_SetMaterial.md) in the same document, and thickness can be set to any value in any unit\n- Name and Material fields are mandatory. Thickness can be left blank (it will then adopt a value of 0).\n- When a multi-material contains layers with a thickness of zero, that thickness is considered variable. Arch objects that use the multi-material, such as Walls and Panels, will treat that accordingly, and give that layer the remaining space available given their own width or thickness.\n- If you name the different components of a multi-material \\\"Frame\\\", \\\"Solid panel\\\", \\\"Glass panel\\\" or \\\"Louvre\\\", and apply that material to a window, the given materials will be applied to the corresponding window components.\n\n## Relation to IFC \n\nThis roughly corresponds to a combination of [IfcMaterialLayerSet](https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/link/ifcmateriallayerset.htm) and [IfcMaterialLayer](https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/link/ifcmateriallayer.htm).\n\n## Limitations\n\n## Scripting\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](Category_BIM.md) > Arch MultiMaterial\n"} {"id": "freecad-docs:wiki/Arch_Preferences.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Arch_Preferences.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Arch_Preferences.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "723f57ea4ab9d7ee9ed33a477191930d8144d012a39676ef25447685e3e78157", "bytes": 136, "tokens": 51, "text": "# Arch Preferences\n1. REDIRECT [BIM_Preferences](BIM_Preferences.md)\n\n\n---\n⏵ [documentation index](../README.md) > Arch Preferences\n"} {"id": "freecad-docs:wiki/Arch_Remove.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Arch_Remove.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Arch_Remove.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "247106c12f8d52ab3c20b029bc95508ee2d15055ad0e82c3a39ab1e0107fd7f2", "bytes": 2597, "tokens": 910, "text": "---\n GuiCommand:\n Name: Arch Remove\n MenuLocation: Modify , Remove component\n Workbenches: BIM_Workbench\n SeeAlso: Arch_CutPlane, Arch_Add\n---\n\n# Arch Remove\n\n## Description\n\nThe **Arch Remove** tools allows you to do 2 kinds of operations:\n\n- Remove a subcomponent from an Arch object, for example remove a box that has been added to a wall, like in the ** [Arch Add](Arch_Add.md)** example.\n- Subtract a [shape](Part_Workbench.md)-based object from an Arch component such as a ** [Arch Wall](Arch_Wall.md)\n** or ** [Arch Structure](Arch_Structure.md)**\n\nThe counterpart of this tool is the ** [Arch Add](Arch_Add.md)** tool.\n\n \"\" \n*A box subtracted from a wall, leaving a hole in it.*\n\n## Usage\n\n1. Select a subcomponent inside an Arch object.\n2. Press the ** [Remove component](Arch_Remove.md)** button, or **Modify → Remove component** from the top menu.\n\nOr\n\n1. Select objects to be subtracted, the last object selected must the Arch object from which the other objects will be subtracted.\n2. Press the ** [Remove component](Arch_Remove.md)** button, or **Modify → Remove component** from the top menu.\n\n## Scripting\n\n\n**See also:**\n\n[Arch API](Arch_API.md) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe Remove tool can be used in [macros](Macros.md) and from the [Python](Python.md) console by using the following function:\n\n \n```python\nremoveComponents(objectsList, host=None)\n```\n\n- Removes the given objects in `objectsList` from their parents.\n- If a `host` object is specified, this function will try adding the objects in `objectsList` as holes to the `host`.\n\nExample:\n\n \n```python\nimport FreeCAD, Draft, Arch\n\nLine = Draft.makeWire([FreeCAD.Vector(0, 0, 0),FreeCAD.Vector(2000, 2000, 0)])\nWall = Arch.makeWall(Line, width=150, height=3000)\n\nBox = FreeCAD.ActiveDocument.addObject(\"Part::Box\", \"Box\")\nBox.Length = 900\nBox.Width = 450\nBox.Height = 2000\nFreeCAD.ActiveDocument.recompute()\n\nDraft.rotate(Box, 45)\nDraft.move(Box, FreeCAD.Vector(1000, 700, 0))\n\nArch.removeComponents(Box, Wall)\nFreeCAD.ActiveDocument.recompute()\n```\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](Category_BIM.md) > Arch Remove\n"} {"id": "freecad-docs:wiki/Arch_SelectNonSolidMeshes.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Arch_SelectNonSolidMeshes.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Arch_SelectNonSolidMeshes.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e68ddc5e7b708e26171e836b3f6831963c2ec3b97cb5fc8ce10192e48a1962c7", "bytes": 788, "tokens": 282, "text": "---\n GuiCommand:\n Name: Arch SelectNonSolidMeshes\n MenuLocation: Utils , Select non-manifold meshes\n Workbenches: BIM_Workbench\n SeeAlso: Arch_SplitMesh, Arch_MeshToShape\n---\n\n# Arch SelectNonSolidMeshes\n\n## Description\n\nThe **Arch SelectNonSolidMeshes** tool identifies and selects the non-solid (non-[manifold](http://en.wikipedia.org/wiki/Manifold)) meshes in a selected group of selected \"Mesh [Mesh](Mesh_Workbench.md) objects.\n\n## Usage\n\n1. Select a mesh object.\n2. Select the **Utils → Select non-manifold meshes** option from the menu.\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](Category_BIM.md) > Arch SelectNonSolidMeshes\n"} {"id": "freecad-docs:wiki/Arch_ToggleSubs.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Arch_ToggleSubs.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Arch_ToggleSubs.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "15fb6ace02a98bab1e8d12f3f7b812f78ac5c4bacc6578cf82660ae97d689fae", "bytes": 1419, "tokens": 426, "text": "---\n GuiCommand:\n Name: Arch ToggleSubs\n MenuLocation: Utils , Toggle subcomponents\n Workbenches: BIM_Workbench\n Shortcut: Ctrl + Space\n SeeAlso: Arch_Component\n---\n\n# Arch ToggleSubs\n\n## Description\n\nThe **Arch ToggleSubs** tools toggles the visibility of all the subtractions of an [BIM](BIM_Workbench.md) object between visible and hidden.\n\nNormally, if an Arch object, like an [Arch Wall](Arch_Wall.md), is selected and you press **Space** only the external wall will be hidden or made visible, but not the internal objects.\n\nWith this tool, the internal subtracted objects will all become visible or hidden.\n\n## Usage\n\n1. Select an Arch object that has subtractions.\n2. Select the **Utils → Toggle subcomponents** option from the menu.\n\n## Options\n\nThe color of a subtraction element can follow the style of [Draft construction](Draft_ToggleConstructionMode.md) elements, by activating the appropriate option in the [Arch Preferences](Arch_Preferences.md), in the menu **Edit → Preferences → Arch → General settings → Apply Draft construction style to subcomponents**.\n\nThe [Draft construction](Draft_ToggleConstructionMode.md) style can be set in the [Draft Preferences](Draft_Preferences.md), in the menu **Preferences → Draft → General Draft**.\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](Category_BIM.md) > Arch ToggleSubs\n"} {"id": "freecad-docs:wiki/Artwork_Mesh.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Artwork_Mesh.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Artwork_Mesh.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f33de5beb87941c36b3134f0913f93e7e82af48a409432a8ee1d8a4d41a7f127", "bytes": 3255, "tokens": 1374, "text": "# Artwork Mesh\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## src/Mod/Mesh/\n\n### src/Mod/Mesh/Gui/Resources/Icons/\n\n \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \n\n### src/Mod/Mesh/Gui/Resources/Icons/RegularSolids/\n\n \"\" \"\" \"\" \"\" \"\" \"\"\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > [Mesh](Category_Mesh.md) > Artwork Mesh\n"} {"id": "freecad-docs:wiki/Artwork_Part.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Artwork_Part.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Artwork_Part.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ea6efb27204f2f02903dc17f217b554df629e1e91900162291487dc5bd268a77", "bytes": 5401, "tokens": 2196, "text": "# Artwork Part\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## src/Mod/Part/\n\n### src/Mod/Part/Gui/Resources/icons/\n\n \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \n\n### src/Mod/Part/Gui/Resources/icons/booleans\n\n \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \n\n### src/Mod/Part/Gui/Resources/icons/create\n\n \"\" \"\" \n\n### src/Mod/Part/Gui/Resources/icons/parametric\n\n \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \n\n### src/Mod/Part/Gui/Resources/icons/tools\n\n \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > [Part](Category_Part.md) > Artwork Part\n"} {"id": "freecad-docs:wiki/Artwork_Reinforcement.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Artwork_Reinforcement.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Artwork_Reinforcement.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0d336ec1420b640c33cad79719ae933c10a6e55fcaac12e09ccba24f48d40a39", "bytes": 522, "tokens": 205, "text": "# Artwork Reinforcement\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## Mod/Reinforcement/\n\n### Mod/Reinforcement/icons/dropdown_list/\n\n ![](images/Arch_Rebar_Straight.svg ) ![](images/Arch_Rebar_UShape.svg ) ![](images/Arch_Rebar_LShape.svg ) ![](images/Arch_Rebar_BentShape.svg ) ![](images/Arch_Rebar_Stirrup.svg ) ![](images/Arch_Rebar_Helical.svg )\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > Artwork Reinforcement\n"} {"id": "freecad-docs:wiki/Artwork_ReverseEngineering.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Artwork_ReverseEngineering.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Artwork_ReverseEngineering.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "11039a2537c79a3d4d90ad40c08843ce289834acfd1746ac04c21fed049ba7b3", "bytes": 531, "tokens": 192, "text": "# Artwork ReverseEngineering\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## src/Mod/ReverseEngineering/\n\n### src/Mod/ReverseEngineering/Gui/Resources/icons/\n\n ![](images/Workbench_Reverse_Engineering.svg ) \n\n### src/Mod/ReverseEngineering/Gui/Resources/icons/actions/\n\n ![](images/FitSurface.svg )\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > [Reverse Engineering](Category_Reverse%20Engineering.md) > Artwork ReverseEngineering\n"} {"id": "freecad-docs:wiki/Artwork_SheetMetal.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Artwork_SheetMetal.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Artwork_SheetMetal.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6b8b6243ccacd9e03bb62630edaabe8afe0913f029c2672216f2fb3976a340f6", "bytes": 1464, "tokens": 593, "text": "# Artwork SheetMetal\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## Mod/SheetMetal/\n\n### Mod/SheetMetal/resources/icons/\n\n \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > [SheetMetal](Category_SheetMetal.md) > Artwork SheetMetal\n"} {"id": "freecad-docs:wiki/Assembly3_ConstraintSameOrientation.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Assembly3_ConstraintSameOrientation.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Assembly3_ConstraintSameOrientation.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "1e5ae6c6d28c562f9d79fce1e96a8e74d82a1aa864b916ea84fd70e1aed8e3b4", "bytes": 1440, "tokens": 419, "text": "---\n GuiCommand:\n Name: Assembly3 ConstraintSameOrientation\n Icon: Assembly_ConstraintSameOrientation.svg\n Workbenches: Assembly3_Workbench\n---\n\n# Assembly3 ConstraintSameOrientation\n\n## Description\n\nThis tool builds a link between two or more objects of an assembly and matches their orientation. The selected elements of each object or more precisely their implicit coordinate systems (ICS) are used to position one object to another.\n\nAssuming the first object is already locked in place by the \"\" [Lock constraint](Assembly3_ConstraintLock.md) then the following objects are moved to positions where all ICSs have the same orientation i.e. all z-axes are parallel and all x-axes are parallel (making the y-axes parallel as well).\n\nThe offset of their origins in x-, y- and z-direction are not defined. Related to the first object the following objects can still move along the x-, y- and z-axis. This is leaving 3 degrees of freedom (DOFs) for each link unconstrained.\n\nThe constraint accepts planar faces.\n\n## Usage\n\n1. Place two or more objects into an assembly\n2. Select one planar face element of each object\n3. Press the ** [Same orientation](Assembly3_ConstraintSameOrientation.md)** button.\n\n\n---\n⏵ [documentation index](../README.md) > Assembly3 ConstraintSameOrientation\n"} {"id": "freecad-docs:wiki/Assembly3_CreateElement.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Assembly3_CreateElement.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Assembly3_CreateElement.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c6d095733b7ed7ea156bdf07424e7b3460d72a64165461453c82c004dfa88aba", "bytes": 1410, "tokens": 403, "text": "---\n GuiCommand:\n Name: Assembly3 CreateElement\n Icon: Assembly_New_Element.svg\n MenuLocation: Assembly3 , Create element\n Workbenches: Assembly3_Workbench\n Shortcut: **A** **E**\n---\n\n# Assembly3 CreateElement\n\n## Description\n\nThe \"\" [Create element](Assembly3_CreateElement.md) command creates new elements from selected objects.\n\nIt can be used to prepare **elements** before the use of constraints. This could come in handy to select e.g. hidden geometry. Once an object is represented by an element, it can easily be accessed by its assembly tree object.\n\n(Usually elements are created from selected objects when a constraint command is applied on them)\n\n## Usage\n\n1. Select one or more objects of the boundary representation such as planar **faces**, straight **edges**, or **points**\n2. There are several ways to invoke the command:\n - Press the ** [Create element](Assembly3_CreateElement.md)** button.\n - Select the **Assembly3 → Create element** option from the menu.\n - Use the keyboard shortcut **A** then **E**\n3. (optional but recommended) Rename the elements by editing their **Label** properties.\n\n\n---\n⏵ [documentation index](../README.md) > Assembly3 CreateElement\n"} {"id": "freecad-docs:wiki/Assembly3_ImportFromSTEP.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Assembly3_ImportFromSTEP.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Assembly3_ImportFromSTEP.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "15dcee103e7a708dbe401a895fcd42c1cf9fea98fe48b3515efa7f25353f3c23", "bytes": 1633, "tokens": 541, "text": "---\n GuiCommand:\n Name: Assembly3 ImportFromSTEP\n Icon: Assembly_Import.svg\n MenuLocation: Assembly3 , Import from STEP , Import from STEP\n Workbenches: Assembly3_Workbench\n---\n\n# Assembly3 ImportFromSTEP\n\n## Description\n\nThe \"\" [Import from STEP](Assembly3_ImportFromSTEP.md) command opens a file browser window to search and select STEP files.\n\n(STEP assemblies are imported into a single document.)\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Depending on the button condition do one of the following:\n - Press the icon of the ** [Import from STEP](Assembly3_ImportFromSTEP.md)** button.\n - Press the down arrow of the ** '''Import as multi-document'''** button and select the ** Import from STEP** option from the dropdown.\n - Select the **Assembly3 → Import from STEP → Import from STEP** option from the menu.\n - Select the **Assembly → Import from STEP → Import from STEP** option from the [Tree view](Tree_view.md) context menu or the [3D view](3D_view.md) context menu.\n2. A file browser opens.\n3. Select the STEP file to import\n\n\n---\n⏵ [documentation index](../README.md) > Assembly3 ImportFromSTEP\n"} {"id": "freecad-docs:wiki/Assembly3_QuickSolve.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Assembly3_QuickSolve.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Assembly3_QuickSolve.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7ad3a8135d7a398cf2a539a72d2cbe1b2678a96e5ba173e62ffc9dc072b348ba", "bytes": 1332, "tokens": 462, "text": "---\n GuiCommand:\n Name: Assembly3 QuickSolve\n Icon: Assembly_QuickSolve.svg\n MenuLocation: Assembly3 , Quick solve\n Workbenches: Assembly3_Workbench\n Shortcut: **A** then **F**\n---\n\n# Assembly3 QuickSolve\n\n## Description\n\nThe \"\" [Quick solve](Assembly3_QuickSolve.md) command starts the solver algorithm that relocates all objects of an assembly according to the constraints in the \"\" [Constraints container](Assembly3_CreateAssembly#Description.md).\n\n\n: (Here\\'s the space to put the differences to the \"\" [Resolve constraints](Assembly3_ResolveConstraints.md) command\\...)\n\n\n## Usage\n\n1. Activate the \"\" **Quick solve** command using one of the following:\n - The ** [Quick solve](Assembly3_QuickSolve.md)** button.\n - The **Assembly3 → Quick solve** menu option.\n - The keyboard shortcut: **A** then **F**.\n\n\n---\n⏵ [documentation index](../README.md) > Assembly3 QuickSolve\n"} {"id": "freecad-docs:wiki/Assembly_CreateJointParallel.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Assembly_CreateJointParallel.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Assembly_CreateJointParallel.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "939cb98ef135b89f6f6dd4fa4c6b18438c731b73ebdf0b65cfd0d8fe4df16221", "bytes": 1339, "tokens": 430, "text": "---\n GuiCommand:\n Name: Assembly CreateJointParallel\n MenuLocation: Assembly , Create Parallel Joint\n Workbenches: Assembly_Workbench\n Shortcut: **N**\n Version: 1.0\n SeeAlso: \n---\n\n# Assembly CreateJointParallel\n\n## Description\n\nThe \"\" [Assembly CreateJointParallel](Assembly_CreateJointParallel.md) tool creates a Parallel joint between two selected parts, setting the Z axes of selected coordinate systems parallel.\n\n## Usage\n\n1. There are several ways to invoke the tool:\n - Press the ** [Create Parallel Joint](Assembly_CreateJointParallel.md)** button.\n - Select the **Assembly → Create Parallel Joint** option from the menu.\n - Use the keyboard shortcut: **N**.\n2. \\...\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA **Parallel** object is derived from an [App FeaturePython](App_FeaturePython.md) object and inherits all its properties. See [Assembly CreateJointFixed](Assembly_CreateJointFixed#Properties.md) for additional properties.\n\n\n {{Assembly_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Assembly](Assembly_Workbench.md) > Assembly CreateJointParallel\n"} {"id": "freecad-docs:wiki/BIM_Beam.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/BIM_Beam.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/BIM_Beam.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "fa177cd9dfbd293a66294d48373cb146cf92ed9eea5bab684c2c0dfe7dff6540", "bytes": 669, "tokens": 255, "text": "---\n GuiCommand:\n Name: BIM Beam\n MenuLocation: 3D/BIM , Beam\n Workbenches: BIM_Workbench\n Shortcut: **B** **M**\n SeeAlso: \n---\n\n# BIM Beam\n\n## Description\n\nThe **BIM Beam** tool creates a **Beam** object, a horizontal structure element, between two points.\n\n## Usage\n\n1. There are several ways to invoke the tool:\n - Press the ** [Beam](BIM_Beam.md)** button.\n - Select the **3D/BIM → Beam** option from the menu.\n - Use the keyboard shortcut: **B** then **M**.\n2. \\...\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](BIM_Workbench.md) > BIM Beam\n"} {"id": "freecad-docs:wiki/BIM_Clone.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/BIM_Clone.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/BIM_Clone.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "23e5b62e8b85e731112a801acbd0f992c254122b3c7ccf3bdfac5d689573d3fd", "bytes": 495, "tokens": 174, "text": "---\n GuiCommand:\n Name: BIM Clone\n MenuLocation: Modify , Clone\n Workbenches: BIM_Workbench\n SeeAlso: Draft_Clone\n---\n\n# BIM Clone\n\n## Description\n\nThe **BIM Clone** tool is a shortcut to the standard [Draft Clone](Draft_Clone.md) tool, but launches a [Draft Move](Draft_Move.md) command just after cloning, thus allowing you to clone and place the cloned object somewhere else in the model in one go.\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](BIM_Workbench.md) > BIM Clone\n"} {"id": "freecad-docs:wiki/BIM_Common.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/BIM_Common.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/BIM_Common.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2e1d5711eb97926dd0e968826b3ca0c34897836f9fdda027094a20c8bea2c8d2", "bytes": 142, "tokens": 61, "text": "# BIM Common\n1. REDIRECT [Part_Common](Part_Common.md)\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](BIM_Workbench.md) > BIM Common\n"} {"id": "freecad-docs:wiki/BIM_Diff.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/BIM_Diff.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/BIM_Diff.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7b99c565308f4fa6e1d20bbf6230d161256fe7d6362b118682f4d85a58b71ff6", "bytes": 1674, "tokens": 480, "text": "---\n GuiCommand:\n Name: BIM Diff\n MenuLocation: Utils , IFC Diff\n Workbenches: BIM_Workbench\n---\n\n# BIM Diff\n\n## Description\n\nThe **BIM Diff** tool takes two open FreeCAD documents, and produces a visual diff between them.\n\n\\\"diff\\\" in programming refers to a utility application that takes two text documents and highlights the lines that are different between them. It usually marks in red the lines that have been removed and in green the lines that have been added. Its main purpose is to quickly grasp what has changed in two different versions of the same document.\n\nThis tool does the same thing, but graphically. It opens a new document, shows the contents of file B, but highlights:\n\n \"\" \n\nThis tool is primarily suited for IFC files, as it uses the IFC Global ID to make sure one object in one file is still the same in the other file. However, it will also work with two non-IFC FreeCAD files.\n\n## Usage\n\n1. Open a document in FreeCAD.\n2. Open a second document in FreeCAD, that you wish to compare with the first one.\n3. Select the **Utils → IFC Diff** option from the menu.\n\n## Options\n\n- in **red** all elements of file A that are not present anymore in B\n- in **green** all elements that are in B but weren\\'t present in A\n- in **yellow** all elements that were in A and are still in B, but their geometry has changed\n- in **orange** all elements that were in A and are still in B, their geometry is still the same, but other properties has changed\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](BIM_Workbench.md) > BIM Diff\n"} {"id": "freecad-docs:wiki/Basic_Part_Design_Tutorial.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Basic_Part_Design_Tutorial.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Basic_Part_Design_Tutorial.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6188f882a1e04a810f990a051d9ac5a1574aaf7250acd3f41500df31469fc7e2", "bytes": 18203, "tokens": 5099, "text": "---\n TutorialInfo:\n Topic: Modeling\n Level: Beginner\n Author: Mark Stephen and HarryGeier \n Time: Less than an hour\n FCVersion: 0.17 or higher Files: https://github.com/FreeCAD/Examples/blob/master/Basic_Part_Design_Tutorial_Example_017_Files/Basic_Part_Design_Tutorial_017.fcstd Basic Part Design for v0.17\n SeeAlso: Basic_Part_Design_Tutorial_019\n---\n\n# Basic Part Design Tutorial\n\n \n\n\nThis tutorial introduces the new user to some of the tools and techniques used in the [PartDesign Workbench](PartDesign_Workbench.md). This tutorial is not a complete and comprehensive guide to the Part Design Workbench and many of the tools and capabilities are not covered. This tutorial will take user through the steps needed to model the part shown in the image below using sketches.\n\n ![](images/Tut17_final_refined.png ) \n\nA video of the whole construction is here: \n\n(each section has its own split Video below)\n\n## Before You Begin \n\n## The Task \n\nIn this tutorial, you will be using the Part Design Workbench to create a 3D solid model of the part shown in the [Drawing](TechDraw_Workbench.md) below. All of the necessary dimensions to complete this task are given. You will start by creating a core shape from a base Sketch and then build on that shape, adding what is known as Features. These features will either add material to, or remove material from the solid by use of additional sketches and accompanying feature operations. This Tutorial will not use every feature and tool available within the Part Design Workbench, but should use enough to give the user of this tutorial a basic foundation upon which to build their knowledge and skills.\n\n## The Part \n\n ![](images/Tutorial_Drawing_Sheet.png ) \n\n## Constructing The Part \n\n### Startup\n\nFirst begin by making sure you are in the Part Design Workbench. Once there, you will want to create a new document if you have not done so already. It is a good habit to save your work often, so before anything else save the new document, giving it any name you might like.\n\nAll work in Part Design begins with a [Body](Glossary#Body.md). Then we will build the solid inside the body by starting with a [sketch](Glossary#Sketch.md).\n\n1. Click on \"\" [Create new body](PartDesign_Body.md) to create and activate a new Body Container. \n*Note: this step can be omitted. When creating a sketch, if no existing Body is found, a new one will be automatically created and activated.*\n2. Click on \"\" [Create new sketch](PartDesign_NewSketch.md). This will create the sketch within the just created body.\n3. We need to define where the sketch will be attached. We will attach it to a plane from the Body´s [Origin](Glossary#Origin.md).\n4. In the [Tasks tab](Task_panel.md) from the [Combo view](Combo_view.md), select **YZ_Plane** in the list and press **OK**:\n\n \"\" \n\n*Note: it\\'s possible that the **OK** button may not be visible if the side panel is not wide enough. You can make it wider by dragging its right border. Place your mouse pointer over the border; when the pointer changes to a two-way arrow, press and hold the left mouse button and drag.*\n\nOnce you click OK, FreeCAD automatically switches to the [Sketcher workbench](Sketcher_Workbench.md) and opens the sketch in edit mode:\n\n ![](images/Tut17_sketcherempty.png ) \n\n### Create the sketch \n\nNext you will want to use the \"\" [Polyline](Sketcher_CreatePolyline.md) tool and make a shape roughly like that in the next image. It does not need to be perfect as the final shape is done with constraints. Once you have the basic shape, we will start applying the constraints. If you had Auto constraints on, some of these constraints will have been applied automatically, if not, do the following. But first make sure that you have exited the Polyline tool by right-clicking or pressing **ESC** twice; the mouse cursor should turn back from a cross-hair to the standard arrow cursor. Don\\'t press **ESC** a third time or you will exit edit mode; if this happens, click on the Model tab, then double-click the Sketch element in the tree, or right-click and select **Edit sketch** in the context menu. To avoid leaving edit mode when pressing **Esc** too often, change the **Esc can leave sketch edit mode** preference ((v0.19) ), see [Sketcher Preferences](Sketcher_Preferences#General.md).\n\n*NOTE: Since this tutorial was written there have been improvements to the sketcher solver, if it detects a redundant constraint it will turn the sketch orange in colour, and before further constraints are added, the redundant constraint should be removed. (The redundant constraint is shown in the Task view, click on the blue reference and press delete.)*\n\n1. Select the two horizontal lines with your mouse by clicking on them, and once selected, click on the \"\" [horizontal constraint](Sketcher_ConstrainHorizontal.md).\n2. Select the vertical line on the right and then click on the \"\" [vertical constraint](Sketcher_ConstrainVertical.md).\n3. Select the start and end points of your polyline and click on the \"\" [coincident constraint](Sketcher_ConstrainCoincident.md) to close the polyline.\n4. Select the bottom horizontal line and the right vertical line and apply and \"\" [equal constraint](Sketcher_ConstrainEqual.md).\n5. Select either the horizontal or vertical line and apply either a corresponding \"\" [horizontal distance constraint](Sketcher_ConstrainDistanceX.md) or \"\" [vertical distance constraint](Sketcher_ConstrainDistanceX.md) and give it a value of 26 mm.\n6. Select the top horizontal line and apply the horizontal distance constraint and give it a value of 5 mm\n7. Select the lower right point (vertex) of the horizontal line Origin and then the center point of the grid and apply the \"\" [coincident constraint](Sketcher_ConstrainCoincident.md) to fix your shape.\n\nAt this point you should have a fully constrained sketch as indicated by it changing color and the message shown in the Combo View. It should now look just like the image below.\n\n ![](images/Tut17B_profile.png ) \n\nNow in the [Tasks tab](Task_panel.md), click on the **Close** button to leave the sketch edit mode and select \"\" [Pad](PartDesign_Pad.md) from the toolbar or from the Part Design menu. This will give you a Pad dialog in the Task View. Using that dialog, first using the Type pulldown menu, select Two dimensions. Drawing presented at the beginning of this tutorial says the part is 53 mm long. We do it by Padding our sketch both ways from the center plane to make up that distance i.e. make the pad symmetric in relation of sketch-plane. The reason for is seen later when creating features. For now, given we want it to be 53 mm long in total we will input 26.5 for Length, and 26.5 again for the Second length. Alternatively, you can provide a single length of 53 mm and click the Symmetric to plane check box. Once that is done we now have our base solid upon which we will add additional features to construct our part.\n\nA video of the steps used in this portion of the tutorial is here: \n\n### Features with pocket and external geometry \n\nUsing the mouse or the view icons turn the model around so you can see its back. Once the back of the part is visible, select the back face by clicking on it as seen in the next image.\n\n ![](images/PD_WB_Tutorial003.png ) \n\nAfter the face is selected, click on the New sketch icon in the toolbar or from the Part Design menu and that will map our next sketch to the back face of the part. Now select \"\" [Rectangle](Sketcher_CreateRectangle.md) tool and place a rectangle on the rear face of the part in a similar fashion as shown below. Now following the steps listed, constrain the sketch.\n\n1. Select one of the horizontal lines apply a horizontal distance constraint and a value of 5 mm.\n2. Select one of the vertical lines and give it a vertical distance constraint and a value of 11 mm.\n3. Select \"\" [External geometry](Sketcher_External.md) tool\n4. Select the upper right vertex of the face and click it so you are provided a point from the external geometry to link our sketch to.\n\n ![](images/tut17_slot_unconstrained.png ) \n\n1. Right click to end the External geometry mode\n2. Select that point you just made available with the External geometry tool and then select the upper right vertex of the rectangle and click on the \"\" [Constrain coincident](Sketcher_ConstrainCoincident.md). At this point the sketch should be fully constrained and look like the next image.\n\n ![](images/tut17_slote_constrained.png ) \n\nOnce that is done, click the Close button at the top of the Tasks tab in the Combo View window, then select \"\" [Pocket](PartDesign_Pocket.md) tool from the toolbar or Part Design menu. Using this tool is the opposite of the Pad tool. As the Pad tool adds material to the part, the Pocket tool removes material from the part. Both operations are called features. In this Pocket operation we want to select Through all from the type pulldown-menu and then click the OK button.\n\nFor the next operation, make sure that \"Pocket\" is selected in the Model tree view and once done, click on the \"\" [Mirror](PartDesign_Mirrored.md) feature on the toolbar or from the Part Design menu. In the Mirror dialog in the Combo View, select Horizontal sketch axis from the Plane pulldown menu. Then click OK. The Mirror feature works in this way because the base feature of our model was Padded both ways from the horizontal plane in the first operation with the base sketch. If all has gone well, you should now have a part that looks like the image below after you orbit it around to the front.\n\n ![](images/tut17_profilewithslots.png ) \n\nA video of the steps used in this portion of the tutorial is here: \n\n### Features with pad and external geometry \n\nAfter taking a look, orbit back around and once again select the back face of the part and select that face to map the next sketch to.\n\n ![](images/tut17_profilewithslotsrearplane.png ) \n\nSelect New sketch and make a new rectangle in the manner similar to what is shown below in the next image. Then proceed to add dimensional constraints to the rectangle.\n\n1. Select a horizontal line and apply a horizontal distance constraint with a value of 16.7.\n2. Select a vertical line and apply a vertical distance constraint of 7 mm\n3. Using the External geometry tool, select the upper left vertex of the part face.\n\n ![](images/tut17_sidblockunconstrained.png ) \n\nNow selecting the upper left vertex of the rectangle and the external geometry point, click on the coincident constraint to fully constrain the sketch.\n\n ![](images/tut17_sideblockconstraind.png ) \n\nClose the Sketcher.\n\nNext we will click on the Pad feature and in the Pad dialog in the Combo View we want a length of 26 mm leaving the type as Dimension and then placing a check on the Reversed checkbox. Using the Reversed checkbox will cause the Pad to go into the part instead of away from the part. This operation provides with the following result.\n\n ![](images/tut17_sideblock.png ) \n\nOnce again use the Mirror feature to get the second pad. First ensure that created Pad is selected in the tree view, then click on Mirror in the toolbar or select it from the Part Design menu. We will repeat the operation we did for Pocket above and select Horizontal sketch axis from the Plane pulldown menu.\n\n ![](images/tut17_profilewithsideblocks.png ) \n\nA video of the steps used in this portion of the tutorial is here: \n\n### Feature with pocket and external geometry \n\nAt this point orbiting the part around to the front, we can see that our part is now starting to look like the part in the dimensioned drawing at the beginning of this tutorial. Once you have the view of the front, click on the sloped face with your mouse to select the face we will use for the next sketch.\n\n ![](images/tut17_innerplane.png ) \n\nHere we will use the Rectangle tool and place a rectangle in our sketch and once having done so, apply the following constraints.\n\n1. Select a horizontal line and a vertical line, and after both are selected, click on the Equals constraint.\n2. Select either a horizontal or vertical line and apply a corresponding horizontal or vertical distance constraint with a value of 17 mm\n3. Using the External geometry tool, select the top right vertex as shown in the image below.\n\n ![](images/tut17_rechtangleholeunconstrained.png ) \n\nNow using the dimensions from the drawing, apply the following constraints.\n\n1. Select the external geometry point and the upper right vertex of the now square sketch and apply a horizontal distance constraint of 7 mm\n2. Select the external geometry point and the upper right vertex of the now square sketch and apply a vertical distance constraint of 11 mm\n\nThe result should be as follows.\n\n ![](images/tut17_rectangleholeconstrained.png ) \n\nAt this point if we were to simply Pocket this sketch, the resulting hole would be perpendicular to the sloped face that it is mapped to, and this is not what we want.\n\n![](images/tut17_wrongplaneforpocket.png )\n\nWe want the hole to be perpendicular to the back face, but it\\'s projected dimensions are not the 17 mm x 17 mm dimensions that are given in the drawing. Now we could do the math and calculate the dimensions needed, or we can use the tools provided in FreeCAD to make that projection for us.\n\nA video of the steps used in this portion of the tutorial is here: \n\nTo create pocket which has the sloped rectangle as it´s outlet, we draw a new rectangle on the rear side, using the projection of the sloped rectangle as an external reference. Orbit the Solid around to see the rear face of the part once again and select the back face to map the final sketch to.\n\n ![](images/tut17_profilewithsideblocksrearplane.png ) \n\nSelect \"\" [New Sketch](PartDesign_NewSketch.md) from the toolbar or Part Design menu. Now in sketch edit mode, we do not see the sketched rectangle on the slope. To make it selectable , we switch the combo view to model tab and select the last sketch made (Sketch003) on the sloped plane. Then using the spacebar, make it visible. Next, select the mirror feature above (mirrored001) and again using the spacebar, hide it. Then you should see the sloped rectangle inside the 3D View. You may continue to work with the model tab visible, or switch back to tasks tab. Using the \"\" [External geometry](Sketcher_External.md) tool, select the upper and lower horizontal edges of the sloped rectangle. Then, add a new rectangle to the sketch using the \"\" [Rectangle](Sketcher_CreateRectangle.md) tool.\n\n ![](images/tut17_rectangleunconstrained.png ) \n\n1. Select the upper left vertex of the new rectangle and the upper left point of the external geometry and click on the coincident constraint.\n2. Click on the lower right vertex of the new rectangle and the lower right point of the external geometry and click on the coincident constraint.\n\nAnd we should end up with this.\n\n ![](images/tut17_rectangleconstrained.png ) \n\nFor the final step in this tutorial, close the sketcher window using close or finish editing from the context menu of sketch004 and then select the \"\" [Pocket](PartDesign_Pocket.md) feature from the toolbar or from the Part Design menu. From the Type pulldown select **Through all** and click the OK button.\n\n ![](images/Tut17_final.png ) \n\nAt this point, you will see some lines which come from intersecting features. In this case the *side block* intersects with the *base profile* letting it appear as a triangular block above the profile (i.e., there is an extra line visible in the above picture on the right face of the model). To remove these lines, you can either switch on \\\"refine shape\\\" in your Part Design Settings or, to save some processing speed and still have these lines while constructing, individually switch it on at each feature. The Setting on feature level can be done in the \\\"data\\\" tab of the feature. Set the [***refine* property**](Property_editor#Data.md) to TRUE for the pocket feature Pocket001 to invoke refining.\n\n ![](images/Tut17_refine.png ) ![](images/Tut17_final_refined.png ) \n\nA video of these steps of the tutorial is here: \n\nThis tutorial and your model are complete.\n\n## Additional Resources \n\n- FreeCAD file for comparison (made with 0.17) [Download](https://github.com/FreeCAD/Examples/blob/master/Basic_Part_Design_Tutorial_Example_017_Files/Basic_Part_Design_Tutorial_017.fcstd)\n\n\n{{PartDesign Tools navi\n\n}} {{Sketcher Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](Category_PartDesign.md) > [Sketcher](Category_Sketcher.md) > Basic Part Design Tutorial\n"} {"id": "freecad-docs:wiki/CAM_Copy.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/CAM_Copy.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/CAM_Copy.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "58bd544d4afacbff1142a0f83820003a7b3d40cacc9dcd09c0512aca35a61770", "bytes": 1018, "tokens": 362, "text": "---\n GuiCommand:\n Name: CAM Copy\n MenuLocation: CAM , Path Modification , Copy the operation in the job\n Workbenches: CAM_Workbench\n---\n\n# CAM Copy\n\n## Description\n\nThe tool \"\" [Copy](CAM_Copy.md) creates a copy of a selected path.\n\n## Usage\n\n1. Select a \"\" [CAM](CAM_Workbench.md) object\n2. There are several ways to invoke the command:\n - Press the ** [Copy the operation in the job](CAM_Copy.md)** button in the CAM toolbar\n - Use the **P** then **Y** keyboard shortcut\n - Use the **CAM → Path Modification → Copy the operation in the job** entry in the CAM menu\n\n## Properties\n\n- **Base**: The base path to be copied\n\n## Options\n\nThe copy stays linked with the original path. If the original changes, so does the copy.\n\n\n {{CAM_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [CAM](CAM_Workbench.md) > CAM Copy\n"} {"id": "freecad-docs:wiki/CAM_Slot.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/CAM_Slot.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/CAM_Slot.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "296bc9033f6040f9e10effd9bbbfd4d7d9cfeee5923ef225d737b2eced63dedb", "bytes": 9564, "tokens": 2611, "text": "---\n GuiCommand:\n Name: CAM Slot\n MenuLocation: CAM , Slot\n Workbenches: CAM_Workbench\n Version: 0.19\n---\n\n# CAM Slot\n\n## Description\n\nThe \"\" [Slot](CAM_Slot.md) tool creates a simple slotting operation using various methods of input.\n\nInputs include:\n\n- selecting one or more faces or edges.\n- selecting two vertices.\n- entering two custom points.\n\nThe CAM Slot object is made to be part of a \"\" [CAM Job](CAM_Job.md).\n\n## Usage\n\n1. Select the reference geometry on the model:\n - one or more faces or edges.\n - two vertices.\n - ***nothing*** to use two custom points entered in the Property View of the Data tab: Custom Point1 and Custom Point2.\n2. Invoke the Slot command using several methods:\n - Pressing the ** [Slot](CAM_Slot.md)** button in the toolbar.\n\n#\\* Using the ** CAM** → ** [Slot](CAM_Slot.md)** entry from the top menu.\n\n1. Adjust the desired properties. Descriptions of available properties are found below.\n\n#### Usage Notes \n\n- All slots:\n - Both the beginning and end of a slot path can be extended or shortened. Use the \\Extend Path Start\\ and \\Extend Path End\\ properties.\n - Use the \\Layer Mode\\ property to cut the slot in \\Single-pass\\ mode at final depth, or in \\Multi-pass\\ mode using the available \\Step Down\\ property.\n - Toggle the \\Reverse Direction\\ property to reverse the direction of the cut path.\n\n- Linear slots:\n - Currently there is no capability to offset linear slots laterally (parallel to path of travel). ***Example:*** Say you have a tool diameter smaller than the width of the slot area you are clearing. Current behavior of this operation is to create a set of paths on a plane down the center-line of the designated slot, which will result in the slot volume not being fully cleared. Some users would want the operation to create multiple paths that are offset laterally to clear the entire slot area; this not directly possible, though can be achieved through using \\\"Custom Points\\\", see \\\"Vertical face milling\\\" below. Alternatively use the Pocket operation for such clearing.\n - Create a custom linear slot using the \\Custom Point1\\ and \\Custom Point2\\ properties with no geometry selection. ***Example:*** Initiate a Slot operation in the GUI and click \\OK\\ to save. Now locate and edit the \\Custom Point1\\ and \\Custom Point2\\ properties in the Data tab of the newly created Slot operation. Recompute the operation to update the path.\n\n- Vertical face milling:\n - Most of the CAM tools cannot make a path on a single vertical plane since the projection onto horizontal plane has zero area (an internal limitation). The Slot operation makes this possible by selecting \\\"Custom points\\\" which define a line parallel to the vertical plane and suitable Depth parameters.\n\n- Arc/Circular slots:\n - Creating arc/circular slots\n 1. You will need to select one bottom arc of the slot. This will produce a path directly on the arc edge you selected.\n 2. You will then need to edit the \\Extend Radius\\ property in the Data tab of the operation. Using the expression editor, set it to either \\OpToolDiameter / 2.0\\ or the negative version \\OpToolDiameter / -2.0\\ as needed, depending on whether you selected the inside or outside arc of the slot.\n 3. Recompute the operation.\n 4. Keep in mind that if the toolbit diameter is not equal to the slot width, the path will ***not*** be in the correct location. In this case, adjust the value in the \\Extend Radius\\ property mentioned above.\n - Currently users are unable to create a custom arc/circular path. A third \\Custom Center\\ property will need to be added, along with additional modifications to the code base.\n\n## Properties\n\n***Note***: Not all of these Properties are available in the Task Window Editor. Some are only accessible in the Data tab of the Properties View panel for this Operation.\n\n\n{{TitleProperty|Base}}\n\nNote: It is suggested that you do not edit the Placement property of path operations. Rather, move or rotate the CAM Job model as needed.\n\n- **Placement**: Overall placement\\[position and rotation\\] of the object - with respect to the origin (or origin of parent object container)\n\n - \n **Angle**\n \n : Angle in degrees applied to rotation of the object around Axis property value\n\n - \n **Axis**\n \n : Axis (one or multiple) around which to rotate the object, set in sub-properties: X, Y, Z\n\n - \n **X**\n \n : X axis value\n\n - \n **Y**\n \n : Y axis value\n\n - \n **Z**\n \n : Z axis value\n\n - \n **Position**\n \n : Position of the object, set in sub-properties: X, Y, Z - with respect to the origin (or origin of parent object container)\n\n - \n **X**\n \n : X distance value\n\n - \n **Y**\n \n : Y distance value\n\n - \n **Z**\n \n : Z distance value\n\n- **Label**: User-provided name of the object (UTF-8)\n\n\n{{TitleProperty|Depth}}\n\n- **Clearance Height**: The height needed to clear clamps and obstructions\n\n- **Final Depth**: Final Depth of Tool- lowest value in Z\n\n- **Finish Depth**: Maximum material removed on final pass. The height (thickness) of the last cutting level - *set for a better finish*.\n\n- **Safe Height**: The height above which Rapid motions are allowed. (Rapid safety height between locations)\n\n- **Start Depth**: Starting depth of Tool - *first cut depth in Z*\n\n- **Step Down**: Incremental step down of Tool during operation\n\n \"\" \n*Visual reference for Depth properties (settings)*\n\n\n{{TitleProperty|Path}}\n\n- **Active**: Make False, to prevent operation from generating code\n\n- **Base**: The base geometry for this operation\n\n- **Comment**: An optional comment for this Operation\n\n- **Coolant Mode**: The coolant mode for this operation.\n\n- **Cycle Time**: The cycle time estimation for this operation.\n\n- **Tool Controller**: Defines the Tool controller used in the Operation\n\n- **User Label**: User assigned label\n\n\n{{TitleProperty|Slot}}\n\n- **Custom Point1**: Enter custom start point for slot path.\n\n- **Custom Point2**: Enter custom end point for slot path.\n\n- **Cut Pattern**: Set the geometric clearing pattern to use for the operation.\n\n- **Extend Path End**: Positive extends the end of the path, negative shortens.\n\n- **Extend Path Start**: Positive extends the beginning of the path, negative shortens.\n\n- **Extend Radius**: For arcs/circlular edges, offset the radius for the path.\n\n- **Layer Mode**: Complete the operation in a single pass at depth, or mulitiple passes to final depth.\n\n- **Path Orientation**: Choose the path orientation with regard to the feature(s) selected.\n\n- **Reference1**: Choose what point to use on the first selected feature.\n\n- **Reference2**: Choose what point to use on the second selected feature.\n\n- **Reverse Direction**: Enable to reverse the cut direction of the slot path.\n\n\n{{TitleProperty|Start Point}}\n\n- **Start Point**: The custom start point for the path of this operation.\n\n - \n **X**\n \n : X distance value\n\n - \n **Y**\n \n : Y distance value\n\n - \n **Z**\n \n : Z distance value\n\n- **Use Start Point**: Make True, if manually specifying a Start Point. Set the start point in the property data Start Point field.\n\n## Tasks Window Editor Layout \n\n*Descriptions for the settings are provided in the Properties list above.*\n\nThis section is simply a layout map of the settings in the window editor for the Operation.\n\n### Base Geometry \n\n- **Add**: Adds selected element(s) which should be the base(s) for the path(s)\n- **Delete**: Delete the selected item(s) in the Base Geometry list\n- **Clear**: Clear all items in the Base Geometry list\n\n### Depths\n\n- **Start Depth**\n \n\n- **Final Depth**\n \n\n- **Step Down**\n \n\n### Heights\n\n- **Safe Height**\n \n\n- **Clearance Height**\n \n\n### Operation\n\n- **Tool Controller**: The tool and its settings to be used for this operation.\n\n- **Coolant Mode**: Coolant mode for this operation.\n\n- **Start Reference ****: Choose what point to use on the first selected feature.\n\n- **End Reference ****: Choose what point to use on the second selected feature.\n\n- **Extend Path End**: Positive extends the end of the path, negative shortens.\n\n- **Extend Path Start**: Positive extends the beginning of the path, negative shortens.\n\n- **Layer Mode**: Complete the operation in a single pass at depth, or mulitiple passes to final depth.\n\n- **Path Orientation ****: Choose the path orientation with regard to the feature(s) selected.\n\n- **Reverse Direction**: Enable to reverse the cut direction of the slot path.\n\n**\\*\\*** Visibility changes depending on Base Geometry selected.\n\n## Scripting\n\n\n**See also:**\n\n[FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nExample:\n\n \n```python\n#Place code example here.\n```\n\n\n {{CAM_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [CAM](CAM_Workbench.md) > CAM Slot\n"} {"id": "freecad-docs:wiki/CAM_Tools.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/CAM_Tools.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/CAM_Tools.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ce5d3a894252c4f2f0dba41dc3b1f10cb075edf53bafcdb646fa809ce78e0e39", "bytes": 9506, "tokens": 2673, "text": "# CAM Tools\n## Description\n\nThis page describes the ToolBit architecture used in the [CAM Workbench](CAM_Workbench.md) which became the default for FreeCAD V0.19. Tools in the CAM workbench are handled differently than in other [CAM](https://en.wikipedia.org/wiki/Computer-aided_manufacturing) packages.\n\nThere are several concepts that the user needs to understand:\n\n- [CAM ToolShapes](CAM_ToolShape.md): are templates for creating toolbits. Toolshapes are FreeCAD documents that model the tool using named constraints. The toolshape is an *abstract* tool template from which tool instances (called toolbits) are created. For example, all endmills will share the same toolshape file.\n\n- [CAM ToolBits](CAM_ToolBit.md): are instances of a toolshape. A toolbit will have *specific* values for each of the named constraints in the toolshape. A toolbit is used in a CAM Job through a Tool Controller (TC). The same toolbit can exist in multiple libraries.\n\n- [CAM ToolBit Library](CAM_ToolBit_Library.md): contains an arbitrary collection of toolbits. The specific tools in a library is entirely up to the user. Possible use cases for libraries:\n - A hobbyist user may have only one library for all of the tools they own.\n - A library may contain all the tools used for a specific material like aluminum or wood.\n - A library may have toolbits for working on specific material.\n - A library may hold toolbits from a specific supplier.\n - A library may correspond to an automatic tool changer layout.\n\nA [Tool Controller](CAM_ToolController.md) controls how a tool is used in a CAM Job. A controller combines the toolbit with properties for spindle speed, direction and Horizontal/Vertical feed rates.\n\n## Dialogs\n\nThe user will interact via CAM menu with the tool management system in two different workflows. Each workflow has dedicated GUI elements.\n\n- ** [Toolbit Dock](CAM_ToolBitDock.md)**view indicated at the box top as *Tool selector*, for using tools in a CAM Job by creating Tool Controllers.\n\n- ** [Toolbit Library Manager](CAM_ToolBitLibraryOpen.md)**for managing the user\\'s Toolbit collection with *Create Toolbit*, *Add Existing* and *Remove* buttons.\n\n## Organization\n\nWhen FreeCAD is installed an example hierarchy of tool libraries and toolbits is created in the installation directory at:\n\n- On Linux it is usually **/usr/lib64/FreeCAD/Mod/CAM/Tools**\n- On Windows it is usually **C:\\Program Files\\FreeCAD\\Mod\\CAM\\Tools**\n- On macOS it is usually **/Applications/FreeCAD.app/Contents/Resources/Mod/CAM/Tools**\n\n\n Tools\n + Bit\n + Library\n + Shape\n\nIt is always recommended to store the new created toolbits and libraries in a safe location to avoid them being overwritten on a program upgrade. Even custom toolshapes can be stored in arbitrary locations where they can be backed up. The user is encouraged, however, to use a comparable logical structure as shown above to keep toolbits and libraries well organized.\n\nWhen the Tool library Manager is opened, CAM checks the location of the working directory. If the location is not writeable or is the same as the example/default location, CAM will prompt the user to select or create a new working directory, which usually defaults to the your user macro directory.\n\nCopies of the default toolbits and library are copied to this directory. You can now manage your tools, for example copy, edit and create toolshapes, toolbits and libraries and your changes will be preserved. Note that toolshapes are not copied, as having duplicates may cause issues. See issue [CAM: Tool shapes not copied by \\\"Setup ToolBit working directory\\\" #15275](https://github.com/FreeCAD/FreeCAD/issues/15275).\n\n## Options\n\nReferences to Tool Bits and their shapes can either be stored with an absolute path or with a relative path to the search path. Generally it is recommended to use relative paths due to their flexibility and robustness to layout changes. Should multiple tools or tool shapes with the same name exist in different directories it can be required to use absolute paths.\n\nSee [CAM Preferences](CAM_Preferences.md) to choose whether absolute or relative paths are used.\n\n## Migrating from Legacy Tools \n\nIf you have been using FreeCAD CAM workbench for a while, you may need to adjust your preferences before you can use the Toolbit system. If pressing the Tool Library button on the toolbar shows the legacy dialog, go to the page below in [CAM Preferences](CAM_Preferences.md) and disable legacy tools.\nYou have to restart FreeCAD to make the change valid.\n\n![Disable Legacy Tools](images/Preferences.png )\n\n## Getting Started with Tools in FC 0.19 \n\nRead the [Migrating from Legacy Tools](#Migrating_from_Legacy_Tools.md) section above. The steps below will walk you through the process of getting a ToolBit into your particular ** [CAM Job](CAM_Job.md)**.\n\nIn short, the process begins with a Tool Shape (profile) file that contains only a FreeCAD sketch of half the tool\\'s physical shape (profile). This tool shape file is then used as the basis to create a ToolBit file containing the 3D representation of the ToolBit or cutter. One or more ToolBits are assigned to any number of Tool Libraries as needed by the user. This structure and workflow allows for sharing of Tool Shapes, ToolBits, and entire Tool Libraries - a giant leap forward from the Legacy tool management system in place prior to version 0.19.\n\n### Verify or create a Tool Shape \n\nGetting a cutter or tool into a CAM Job for use in operations starts with a [Tool Shape](CAM_ToolShape.md). This step of verification or creation of a Tool Shape is not necessary if you already have an existing ToolBit available.\n\n#### Verify your desired Tool Shape exists \n\n- FreeCAD includes a set of common tool shapes with each distribution. Visit the [ToolShapes](CAM_ToolShape.md) page to see the list of included, common tool shapes.\n- You might have additional tool shape files available in your personal files.\n- Be mindful of the greater ToolBit system [organization](CAM_Tools#Organization.md) as mentioned above.\n\n#### Create a new Tool Shape \n\n: Follow the instructions outlined in the [Usage](CAM_ToolShape#Usage.md) section of the [Tool Shape](CAM_ToolShape.md) page to create a custom tool shape.\n\n### Load or create a ToolBit \n\nOnce the desired tool shape(profile) exists, you need to create a [tool bit](CAM_ToolBit.md) using the tool shape (profile).\n\n1. In the \"\" [CAM Workbench](CAM_Workbench.md) menu bar, navigate to **CAM → Create Tool**.\n2. In the [Tool Bit](CAM_ToolBit.md) creation task panel that appears, give the new tool bit a name and select the corresponding tool shape file as the basis for this new tool bit.\n3. A thumbnail of the selected tool shape should appear along with a list of parameters.\n4. Set the Bit Parameters as desired.\n5. Click **OK** to save the new tool bit.\n6. The new Tool Bit will appear in the FreeCAD object tree.\n\n### Save the new ToolBit \n\n1. Locate and select the new tool bit in the object tree in the main FreeCAD window.\n2. In the \"\" [CAM Workbench](CAM_Workbench.md) menu bar, navigate to, and select, **CAM → Save Tool as...**.\n3. A pop-up window will appear.\n4. Navigate to the folder where you wish to save the new tool bit file.\n5. Enter a file name for the tool bit.\n6. Click the **Save** button.\n\n### Register the ToolBit in a Tool Library \n\n1. In the \"\" [CAM Workbench](CAM_Workbench.md) menu bar, navigate to **CAM → Open ToolBit Library editor**.\n2. The [ToolBit Library Manager](CAM_ToolBitLibraryOpen.md) window will open.\n3. At the top of this window, verify or set the path to the folder containing your existing tool libraries, or the location you want to store your tool libraries.\n4. Under the path entry, on the left is the Tool Libraries list area. Click on an existing tool library you wish to use as the destination for your new tool bit, or click the green plus icon to create new Tool Library in the folder identified above.\n5. On the right side of the Tool Library editor window is the Tool Bit list and action buttons for the currently selected tool library. Click the **Add ToolBit** icon.\n6. In the file navigation window that opens, navigate to your new tool bit, select it, and click the **Open** button. The new tool bit will be added to the active tool library.\n7. Be sure to click the **Save Table** button at the bottom of the Tool Library window in order to save the changes.\n8. Leave this ToolBit Library window open for the next step.\n9. Once your ToolBits are created and saved in a ToolBit Library, you may reuse them.\n\n### Add a ToolBit Tool Controller to a Job \n\n1. In the open Tool Library window, locate and activate the desired tool library.\n2. Select the desired tool bit(s) to be added to the Job. Select multiple by holding down the CTRL key when selecting.\n3. Click the **Add Tool Controller to Job** button.\n4. Close the ToolBit Library\n\n## Related\n\n- [CAM ToolBit](CAM_ToolBit.md)\n- [CAM ToolBitLibraryOpen](CAM_ToolBitLibraryOpen.md)\n\n\n {{CAM_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [CAM](CAM_Workbench.md) > CAM Tools\n"} {"id": "freecad-docs:wiki/Category_EM.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Category_EM.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Category_EM.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e8a17a7d8412b117572c7db54070828b1e806b69ea9bfabb9ca23a63d0df89fb", "bytes": 719, "tokens": 323, "text": "# Category:EM\nThis category list pages related to the [EM Workbench](EM_Workbench.md) which is one of the [external workbenches](external_workbenches.md).\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [EM FHEquiv](EM_FHEquiv.md) | [EM FHInputFile](EM_FHInputFile.md) | [EM FHNode](EM_FHNode.md) |\n| [EM FHPath](EM_FHPath.md) | [EM FHPlane](EM_FHPlane.md) | [EM FHPlaneAddRemoveNodeHole](EM_FHPlaneAddRemoveNodeHole.md) |\n| [EM FHPlaneHole](EM_FHPlaneHole.md) | [EM FHPort](EM_FHPort.md) | [EM FHSegment](EM_FHSegment.md) |\n| [EM FHSolver](EM_FHSolver.md) | [Template:EM Tools navi](Template_EM_Tools_navi.md) | [EM Workbench](EM_Workbench.md) |\n|\n\n\n---\n⏵ [documentation index](../README.md) > Category:EM\n"} {"id": "freecad-docs:wiki/Category_External_Command_Reference.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Category_External_Command_Reference.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Category_External_Command_Reference.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "709f592a76ce112395b45939d0887bcfa60c705936c61e132d71272e64c2c469", "bytes": 6518, "tokens": 2810, "text": "# Category:External Command Reference\nThis categorizes all **external** workbench commands separate from the internal [:Category:Command_Reference](:Category_Command_Reference.md)\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [CurvedShapes CurvedArray](CurvedShapes_CurvedArray.md) | [Curves CompressionSpring](Curves_CompressionSpring.md) | [Curves Discretize](Curves_Discretize.md) |\n| [Curves EditableSpline](Curves_EditableSpline.md) | [Curves ExtendCurve](Curves_ExtendCurve.md) | [Curves GordonSurface](Curves_GordonSurface.md) |\n| [Curves Interpolate](Curves_Interpolate.md) | [Curves IsoCurve](Curves_IsoCurve.md) | [Curves JoinCurve](Curves_JoinCurve.md) |\n| [Curves Line](Curves_Line.md) | [Curves MultiLoft](Curves_MultiLoft.md) | [Curves ParametricComb](Curves_ParametricComb.md) |\n| [Curves ParametricSolid](Curves_ParametricSolid.md) | [Curves PasteSVG](Curves_PasteSVG.md) | [Curves Pipeshell](Curves_Pipeshell.md) |\n| [Curves PipeshellProfile](Curves_PipeshellProfile.md) | [Curves ProfileSupport](Curves_ProfileSupport.md) | [Curves ReflectLines](Curves_ReflectLines.md) |\n| [Curves SegmentSurface](Curves_SegmentSurface.md) | [Curves SketchOnSurface](Curves_SketchOnSurface.md) | [Curves SplitCurve](Curves_SplitCurve.md) |\n| [Curves ToConsole](Curves_ToConsole.md) | [Template:Curves Tools navi](Template_Curves_Tools_navi.md) | [Curves Workbench](Curves_Workbench.md) |\n| [Curves ZebraTool](Curves_ZebraTool.md) | [Design456 2DExtend](Design456_2DExtend.md) | [Design456 2DTrim](Design456_2DTrim.md) |\n| [Design456 3Point](Design456_3Point.md) | [Design456 Extract](Design456_Extract.md) | [Design456 Extrude](Design456_Extrude.md) |\n| [Design456 ExtrudeFace](Design456_ExtrudeFace.md) | [Design456 LoftOnDirection](Design456_LoftOnDirection.md) | [Design456 MultiPointsToWireClose](Design456_MultiPointsToWireClose.md) |\n| [Design456 MultiPointsToWireOpen](Design456_MultiPointsToWireOpen.md) | [Design456 PartMerge](Design456_PartMerge.md) | [Design456 PartSubtract](Design456_PartSubtract.md) |\n| [Design456 SplitObject](Design456_SplitObject.md) | [EM FHEquiv](EM_FHEquiv.md) | [EM FHInputFile](EM_FHInputFile.md) |\n| [EM FHNode](EM_FHNode.md) | [EM FHPath](EM_FHPath.md) | [EM FHPlane](EM_FHPlane.md) |\n| [EM FHPlaneAddRemoveNodeHole](EM_FHPlaneAddRemoveNodeHole.md) | [EM FHPlaneHole](EM_FHPlaneHole.md) | [EM FHPort](EM_FHPort.md) |\n| [EM FHSegment](EM_FHSegment.md) | [EM FHSolver](EM_FHSolver.md) | [EM Workbench](EM_Workbench.md) |\n| [Example Combined Footing](Example_Combined_Footing.md) | [Example Slab Having LShape Rebars Reinforcement Mesh](Example_Slab_Having_LShape_Rebars_Reinforcement_Mesh.md) | [Example Slab Having Mesh Of Straight Rebars](Example_Slab_Having_Mesh_Of_Straight_Rebars.md) |\n| [Example Slab Having UShape Rebars Reinforcement Mesh](Example_Slab_Having_UShape_Rebars_Reinforcement_Mesh.md) | [Example Slab Spanning in One Direction](Example_Slab_Spanning_in_One_Direction.md) | [Example Slab Spanning in Two Directions](Example_Slab_Spanning_in_Two_Directions.md) |\n| [Fasteners BOM](Fasteners_BOM.md) | [Fasteners ChamferHole](Fasteners_ChamferHole.md) | [Fasteners ChangeParameters](Fasteners_ChangeParameters.md) |\n| [Fasteners Flip](Fasteners_Flip.md) | [Fasteners MatchTypeInner](Fasteners_MatchTypeInner.md) | [Fasteners MatchTypeOuter](Fasteners_MatchTypeOuter.md) |\n| [Fasteners Move](Fasteners_Move.md) | [Fasteners ScrewCalculator](Fasteners_ScrewCalculator.md) | [Fasteners Simplify](Fasteners_Simplify.md) |\n| [FCGear BevelGear](FCGear_BevelGear.md) | [FCGear CrownGear](FCGear_CrownGear.md) | [FCGear CycloidGear](FCGear_CycloidGear.md) |\n| [FCGear CycloidRack](FCGear_CycloidRack.md) | [FCGear GearConnector](FCGear_GearConnector.md) | [FCGear HypoCycloidGear](FCGear_HypoCycloidGear.md) |\n| [FCGear InternalInvoluteGear](FCGear_InternalInvoluteGear.md) | [FCGear InvoluteGear](FCGear_InvoluteGear.md) | [FCGear InvoluteRack](FCGear_InvoluteRack.md) |\n| [FCGear LanternGear](FCGear_LanternGear.md) | [FCGear TimingGear](FCGear_TimingGear.md) | [FCGear WormGear](FCGear_WormGear.md) |\n| [FreeGrid BitCartridgeHolder](FreeGrid_BitCartridgeHolder.md) | [FreeGrid Sketch](FreeGrid_Sketch.md) | [FreeGrid StorageBox](FreeGrid_StorageBox.md) |\n| [FreeGrid StorageGrid](FreeGrid_StorageGrid.md) | [Lattice2 AttachablePlacement](Lattice2_AttachablePlacement.md) | [Movie MovieCamera](Movie_MovieCamera.md) |\n| [Movie Workbench](Movie_Workbench.md) | [Reinforcement BarBendingSchedule](Reinforcement_BarBendingSchedule.md) | [Reinforcement BarShapeCutList](Reinforcement_BarShapeCutList.md) |\n| [Reinforcement BeamRebars](Reinforcement_BeamRebars.md) | [Reinforcement BentShapeRebar](Reinforcement_BentShapeRebar.md) | [Reinforcement BillOfMaterial](Reinforcement_BillOfMaterial.md) |\n| [Reinforcement ColumnRebars](Reinforcement_ColumnRebars.md) | [Reinforcement ColumnRebars Circular](Reinforcement_ColumnRebars_Circular.md) | [Reinforcement ColumnRebars TwoTiesSixRebars](Reinforcement_ColumnRebars_TwoTiesSixRebars.md) |\n| [Reinforcement DrawingDimensioning](Reinforcement_DrawingDimensioning.md) | [Reinforcement FootingRebars](Reinforcement_FootingRebars.md) | [Reinforcement HelicalRebar](Reinforcement_HelicalRebar.md) |\n| [Reinforcement LShapeRebar](Reinforcement_LShapeRebar.md) | [Reinforcement SlabRebars](Reinforcement_SlabRebars.md) | [Reinforcement StirrupRebar](Reinforcement_StirrupRebar.md) |\n| [Reinforcement StraightRebar](Reinforcement_StraightRebar.md) | [Reinforcement UShapeRebar](Reinforcement_UShapeRebar.md) | [Render Workbench](Render_Workbench.md) |\n| [SheetMetal AddBase](SheetMetal_AddBase.md) | [SheetMetal AddBend](SheetMetal_AddBend.md) | [SheetMetal AddCornerRelief](SheetMetal_AddCornerRelief.md) |\n| [SheetMetal AddCutout](SheetMetal_AddCutout.md) | [SheetMetal AddFoldWall](SheetMetal_AddFoldWall.md) | [SheetMetal AddJunction](SheetMetal_AddJunction.md) |\n| [SheetMetal AddRelief](SheetMetal_AddRelief.md) | [SheetMetal AddWall](SheetMetal_AddWall.md) | [SheetMetal BaseShape](SheetMetal_BaseShape.md) |\n| [SheetMetal Examples](SheetMetal_Examples.md) | [SheetMetal Extrude](SheetMetal_Extrude.md) | [SheetMetal Forming](SheetMetal_Forming.md) |\n| [SheetMetal SketchOnSheet](SheetMetal_SketchOnSheet.md) | [SheetMetal UnattendedUnfold](SheetMetal_UnattendedUnfold.md) | [SheetMetal Unfold](SheetMetal_Unfold.md) |\n| [SheetMetal UnfoldUpdate](SheetMetal_UnfoldUpdate.md) | [SheetMetal Workbench](SheetMetal_Workbench.md) |\n\n\n---\n⏵ [documentation index](../README.md) > Category:External Command Reference\n"} {"id": "freecad-docs:wiki/Category_Packaging.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Category_Packaging.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Category_Packaging.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e3b3ee23d41ba53361718205c5445742a9564c0e1db013bfc6ed3f5c1ee67525", "bytes": 840, "tokens": 307, "text": "# Category:Packaging\nThis category collects pages related to packing FreeCAD for different platforms, including Linux, Windows, and MacOS.\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [AppImage](AppImage.md) | [Debian development](Debian_development.md) | [Debian Unstable](Debian_Unstable.md) |\n| [Flatpak](Flatpak.md) | [Git buildpackage](Git_buildpackage.md) | [Linux packaging](Linux_packaging.md) |\n| [MacOS packaging](MacOS_packaging.md) | [Packaging](Packaging.md) | [Ubuntu Snap](Ubuntu_Snap.md) |\n| [Windows packaging](Windows_packaging.md) | [Windows packaging/en](Windows_packaging/en.md) | [Windows packaging/pl](Windows_packaging/pl.md) |\n| [Windows packaging/pt-br](Windows_packaging/pt-br.md) | [Windows packaging/ru](Windows_packaging/ru.md) |\n\n\n---\n⏵ [documentation index](../README.md) > Category:Packaging\n"} {"id": "freecad-docs:wiki/Category_Testing.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Category_Testing.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Category_Testing.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f0309d55b3f247ccb859cd69d959650318d9187dc4dda863886b4e90e9a03f75", "bytes": 537, "tokens": 195, "text": "# Category:Testing\nPages related to testing in regards to unit testing, continuous integration, quality assurance, regression testing etc\\...\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [AppImage](AppImage.md) | [Artwork Test](Artwork_Test.md) | [Continuous Integration](Continuous_Integration.md) |\n| [Flatpak](Flatpak.md) | [LGTM](LGTM.md) | [Testing](Testing.md) |\n| [Ubuntu Snap](Ubuntu_Snap.md) | [Category:Test Framework](Category_Test_Framework.md) |\n\n\n---\n⏵ [documentation index](../README.md) > Category:Testing\n"} {"id": "freecad-docs:wiki/Continuous_Integration.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Continuous_Integration.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Continuous_Integration.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e0147da34f18f661c736ee14bc9a5ce8d03b30560a8174d37c31b41a2557f438", "bytes": 696, "tokens": 225, "text": "# Continuous Integration\n## Continuous Integration \n\nCurrently the FreeCAD repository on GitHub will trigger a build on several CI systems. Between these systems pretty much all the main OSs are coveredː Linux, macOS, and Windows. CIs can also be used to run [unit tests](Testing.md).\n\n## Tips\n\n- If you add {{Incode|[skip ci]}} or {{Incode|[ci skip]}} to a git commit it will cancel a CI build.\n\n## Relevant links \n\n- Forum post announcing new CIs: [New CI is yours :)](https://forum.freecad.org/viewtopic.php?p=657956)\n\n\n---\n⏵ [documentation index](../README.md) > [Developer_Documentation](Category_Developer_Documentation.md) > [Testing](Category_Testing.md) > Continuous Integration\n"} {"id": "freecad-docs:wiki/Creating_a_simple_part_with_Part_WB.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Creating_a_simple_part_with_Part_WB.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Creating_a_simple_part_with_Part_WB.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f544216ddf12b992d50a5dc89559228e81839f586d008f38ce55febf4edd4214", "bytes": 29606, "tokens": 8269, "text": "---\n TutorialInfo:\n Topic: Modeling\n Level: Beginner\n Author: heda\n Time: 2 hours\n FCVersion: 0.19 or above\n Files: \n SeeAlso: Creating_a_simple_part_with_PartDesign, Creating_a_simple_part_with_Draft_and_Part_WB\n---\n\n# Creating a simple part with Part WB\n\n \n\n\n## Introduction\n\nThis tutorial aims to be used as a first introduction to 3D modeling using the [Part Workbench](Part_Workbench.md) ![](images/Switch_PartWorkbench.JPG ) of FreeCAD. After having finished this tutorial you should be able to make simple 3D models by using primitives like cubes, cylinders, etc with a technique called [Constructive Solid Geometry](https://en.wikipedia.org/wiki/Constructive_solid_geometry), short **CSG** modeling. Another way to create 3D models is by using a 2D shape by for example extruding or revolving the 2D shape in 3D space. For an introduction of that technique please follow the sister-tutorial *[Creating a simple part with PartDesign](Creating_a_simple_part_with_PartDesign.md)*. The two tutorials intentionally have exactly the same model generated, this presents the beginner with a hands on experience of the two different techniques and how they are implemented in FreeCAD. The definition of the two techniques can be viewed as strictly divided from a semantic point of view, however there is nothing directly hindering a mix of the techniques when creating models. There are some caveats to watch out for when mixing modeling techniques, those are mainly related to aspects of how FreeCAD is programmed. There is a [third tutorial](Creating_a_simple_part_with_Draft_and_Part_WB.md) intended as a first introduction to a mixed modeling example. That tutorial uses the **Draft Workbench** to create a 2D profile utilized to extrude a solid in the **Part Workbench** to make the same model as in this tutorial.\n\nBefore you start please have a look at how to **[navigate](Mouse_navigation.md)** in 3D space. When hoovering over the mouse model selector in the lower right corner of the FreeCAD window, a cheat-sheet of the current mouse model appears as in the picture below.\n\n ![](images/T101pwb00-01_navi.png ) \n\nMany newcomers to CAD programs get stuck while learning the software, if that happens to you, please go ahead and search the wiki or forum for further information -- chances are that others also have been stuck on the same specific thing in the past so there is already an answer to your specific question. Or make a post on the forum with your questions or findings. The forum has several threads where users are helped to complete all sorts of different tasks, those threads are often similar to tutorials, and often have specific illustrations included.\n\n### The tutorial covers \n\n- The model to make\n- Using the Part Workbench to create and manipulate the primitive building blocks\n- Changing the color and transparency\n- A different way to locate the hole\n- Making the hole a countersunk hole\n- Making a hollow piece\n- A different way to position the chamfer\n- Editing dimensions\n- Organizing the tree a bit differently\n- Wrapping up\n\n## The model to make \n\n \"\"\n\n![](images/T101pwb01-02_dims.png ) \n\n## Using the Part Workbench to create and manipulate the primitive building blocks \n\nCreate a new document and save it directly under a new name, it is good practice to make sure that you save the document at regular intervals, or just before larger operations. Then switch to the **[Part Workbench](Part_Workbench.md)** using either the [workbench selector](Getting_started#Exploring_the_interface.md) (labeled 10 in the linked image) or by going to the **View → Workbench** menu. FreeCAD will start with toolbars at the top, the combo view to the left and the 3D view at the right.\n\n### Create the main solid block \n\nPress \"\" [Box](Part_Box.md) to make a default solid cube. The cube appears in the [3D view](3D_view.md) and also as a new object in the [Tree view](Tree_view.md) in the sidebar.\n\nPress \"\" [Isometric](Std_ViewIsometric.md) to see the cube in 3D.\n\n ![](images/T101pwb01-03_cube1.png ) \n\nSelect the cube in the [Tree view](Tree_view.md), it becomes green in the 3D view. Below the tree view you will now see that the cube by default is created with the dimensions **Length x Width x Height** as *10 x 10 x 10 mm*. Change those dimensions to **100 x 30 x 50** as per the initial drawing of the model.\n\n ![](images/T101pwb01-04_cubedims.png ) \n\nWhen changing a property, like *Length* through the spinbox, one can either enter the values, or use the scroll-wheel to tick values up or down. The arrows for ticking values up or down can of course also be used. In the right most picture above, the *Height* property is in edit mode, rolling the scroll wheel when the mouse is over that cell will change the value by one up or down.\n\nClick \"\" **[Fit all](Std_ViewFitAll.md)** to see the whole cube.\n\n ![](images/T101pwb01-05_cube2.png ) \n\n### Create the fillet \n\nTo make the filleted corner, in the toolbar press \"\" **[Fillet](Part_Fillet.md)** which opens the *task panel* for fillets in the [combo view](Combo_view.md) to the side. Change the *radius* spinbox to 20 mm, then in the 3D view, select the width edge to the upper right and click **OK**.\n\n ![](images/T101pwb01-06_filletrad.png ) \n\nThe *task panel* closes and you are back to the Tree view which now has a fillet object instead of the earlier cube.\n\n### Visibility of children \n\nClick the plus sign/caret to expand the children of the fillet, which in this case is the *cube* we created earlier, but it is grayed out. Select the cube and press the space bar -- this toggles visibility so the cube is now visible again and the icon is no longer grayed out. To deselect the cube click in a blank area in the Tree view or the 3D view.\n\n ![](images/T101pwb01-07_fillet.png ) \n\n### Create the chamfer \n\nNext is to create the 30 degree *chamfer*, start by toggling the visibility of the child cube of the fillet. There is a chamfer tool in [Part Workbench](Part_Workbench.md), but instead of using it we will make the chamfer with another block and a boolean cut.\n\nCreate a new \"\" **[Box](Part_Box.md)** with dimensions 60 x 30 x 30. Change the **placement angle** to -30 degrees.\n\n ![](images/T101pwb01-08_chamfer1.png ) \n\nThe placement angle is using the **placement vector** (Axis) as axis of rotation. The default is the z-axis, which is not matching our target direction, changing the placement vector to the **y-axis** produces the desired orientation of the cutting tool for the chamfer.\n\n ![](images/T101pwb01-09_chamfer2.png ) \n\nThe same placement can be attained with other values as well, the simplest alternative example of a placement that is the same is an angle of +30 degrees and a y-axis of -1.\n\n#### Python console \n\nFurthermore the position needs to be adjusted, looking at the drawing of the finished part, there is no direct dimension to use for the intended translation upwards. Since the upward dimension is the one needed, we have to calculate it. Let's make use of the built in **[Python console](Python_console.md)** for those calculations, it is basic trigonometry. If the FreeCAD Python console is not visible for you, just right-click in an empty space in the toolbar area and check the *Python console* and it should appear in the workspace, when there you should as well add the **[report view](Report_view.md)** if not already visible. The *report view* most of the times provides useful information or even hints of what to do next for different commands.\n\n ![](images/T101pwb01-10_pyconsole.png ) \n\nAfter importing the **[math](https://docs.python.org/3/library/math.html#module-math)** module from the standard libraries in python we can use the formula *(50 - math.tan(math.radians(30)) \\* 50)* to find the distance in z-direction that the block should be moved. Copy the result of the formula from the Python console and paste it into the z position for **Cube001**. The *tool* to use for the chamfer *cut* is now properly oriented and positioned.\n\n ![](images/T101pwb01-11_chamfer3.png ) \n\n#### Expressions\n\nOne does not have to use the Python console to do the calculation, In most cases when dealing with numeric parametric values, FreeCAD has a short-cut to a built-in calculator. It is called **[Expressions](Expressions.md)** in FreeCAD, you can enter the *expression mode* by first clicking in the spinbox for the z-position, a small blueish circular icon will appear at the right side.\n\n ![](images/T101pwb01-12_expression1.png ) \n\nClicking that icon opens new window *Formula editor* where formulas and expressions can be entered as shown below. Using expressions is a powerful tool, since one can access parameters from the model, effectively making all parameters in the model available as variables to be used when creating an expression. In short, in our formula, instead of entering the number 50 when in the formula editor, we could enter a *named parameter* holding the value 50 from the cube, with the benefit that if we change the cube *height*, the position of the chamfer will automatically follow. The value of 50 in the current model is referred to as *Cube.Length*, i.e. the *Length* property of the *Cube* feature. Further information on this can be found on the wiki.\n\n ![](images/T101pwb01-13_expression2.png ) \n\nTo make the cut, with the **Ctrl** key pressed down first select the **Fillet** in the Tree view and then the latest created cube (named **Cube001**) and finally in the toolbar press the \"\" **[Cut](Part_Cut.md)** button. Your Tree view should now again be a single object in the root called **Cut**.\n\n ![](images/T101pwb01-14_model1.png ) \n\n#### The toolbars \n\nA sidenote on the toolbars, since they are the typical avenue to invoke commands. Although there is a basic setting for the layout of the toolbars, the actual layout on your computer could turn out to be less than ideal. In such cases it is easy to adjust. Consider the upper section of the below image. There are two rows of toolbars and only a limited number of the [Part Workbench](Part_Workbench.md) toolbar buttons are visible. The simplest way to see more toolbar buttons is to maximize the FreeCAD window, unless it already is maximized of course.\n\nMore common is to adjust the layout of the toolbars to suit your needs and your specific computer. The repositioning is done with the handle on the left of each toolbar. You can just click and drag the handle to a new location. In the lower section of the below image the toolbar positions have been adjusted, revealing their full content. Changes to toolbar positions are persistent through sessions.\n\n ![](images/T101pwb01-141_toolbars.png ) \n\n#### The measurement tool \n\nThe **[measurement tool](Part_Workbench#Measure.md)** in the **Part Workbench** can be used to check that our calculation and placement of the chamfer is correct. Press the \"\" **[Measure Linear](Part_Measure_Linear.md)** button and a *task panel* opens up, then select the 2 endpoints of one side of the chamfer.\n\n ![](images/T101pwb01-15_model1measure1.png ) \n\nIt checks out with an x dimension of 50 mm, clear the measurement and close the dialogue.\n\n### Create the hole \n\nTo make the hole, press the \"\" **[Cylinder](Part_Cylinder.md)** button, set the *radius* to 5 mm and *height* to 50 mm.\n\n ![](images/T101pwb01-16_cyl1.png ) \n\nNext we need to position the hole according to the dimensions in the drawing. Change the view to \"\" **[Top](Std_ViewTop.md)** view, then right-click the **Cylinder** in the Tree view and select **Transform** from the pop-up menu.\n\n ![](images/T101pwb01-17_cyl1translate.png ) \n\nChange the *Translation increment* to 5 and use the red and green arrow to position the cylinder in the right position, moving it 15 mm in y and 65 in x by dragging the arrow ends with the mouse. Click **OK** to close the *Transform* dialogue. To make the hole press the **Ctrl** key and select the **Cut** and **Cylinder** in the Tree view, then press the \"\" **[Cut](Part_Cut.md)** button in the toolbar. Your Tree view should once again have a single object in the root called **Cut001**.\n\nCongratulations, the model is now ready.\n\n ![](images/T101pwb01-18_model1complete.png ) \n\nWith the basic model ready, let us explore different ways to alter this model, some examples are related to the appearance, additional features, or simply a different way to do the same.\n\n## Changing the color and transparency \n\nThere are several different ways one can change the appearance of objects, for this case, let\\'s use the view tab in the property part of the combo view. First select the object in the Tree view and then edit any property like line color, shape color or transparency via the **view tab** (found at the bottom of the *combo view*).\n\n ![](images/T101pwb02-01_appearance1.png ) \n\nUnfortunately when the object is selected it is a bit hard to see how it will look when tuning the new appearance. To see the final result one has to deselect the object. Here is the new look of the model, where one now can see the through hole also in the iso-view. Another way to edit the appearance is via the **View → ![](images/\u0001)_Appearance...** menu.\n\n ![](images/T101pwb02-02_appearance2.png ) \n\n## A different way to locate the hole \n\nDo a *save-as* under a new name. Then delete the cut that added the hole and move the cylinder back to zero position. Your model should look like the below picture, which is the starting point for using a different technique to locate the hole at the center of the upper face. Note that the color is back to the default gray, the change in appearance we did was on the cut object which now is deleted.\n\n ![](images/T101pwb03-01_cyl.png ) \n\nThis time the \"\" **[Draft Workbench](Draft_Workbench.md)** will be used to locate the hole. The hole is as before to be located at the center of the upper face, which is the same as the midpoint of the diagonal of the upper face.\n\nStart by switching the workbench to **Draft**, it might be that a *grid* appears in the 3D view, the grid visibility can be toggled with \"\" [Toggle Grid](Draft_ToggleGrid.md) in the toolbar. When making use of the **[snap](Draft_Snap.md)** functionality in the **Draft Workbench** it helps to only have the *snap types* of interest enabled. This time it is sufficient to leave *endpoint, midpoint and circle center enabled*, so the settings for snapping should look something like below.\n\n ![](images/T101pwb03-02_snap.png ) \n\nFinding the point to place the center of the cylinder could be done by making a diagonal as helpline and use the center of the cylinder and midpoint of the diagonal to identify the points to move between, however it turns out that we do not even need to make any helplines, we can snap on already existing solid geometry.\n\nSelect the **Cylinder** in the Tree view (it turns green in the 3D view) and press the \"\" **[Move](Draft_Move.md)** button in the toolbar. A *task panel* opens for moving objects, make sure that *Copy* is unchecked.\n\n ![](images/T101pwb03-03_move.png ) \n\nThen move the mouse to the upper face of the cylinder so that you see a *white dot* in the center of the circle as per the left picture below, this together with the center symbol next to the mouse pointer means that a left button mouse click will snap to the white point.\n\n ![](images/T101pwb03-04_snapselect.png ) \n\nWhen you have the white dot on the upper face, click the left mouse button, and repeat for the upper square face of the main solid, like the right picture above, and confirm the choice with a left mouse button click. The snap function makes use of *mass-center* for any type of face, and in this case the mass center is the same as the geometrical center that is sought after. You will by now have noticed that the move of the cylinder is animated, so you always see what is about to happen.\n\nRepeating the step of the **boolean cut** from earlier once again will make the through hole that completes the model. Using the **linear measurement tool** in the Part Workbench, a check that the hole is correctly placed is done. The measurement can only be done between *points*, so the measurement is done from main body zero to the seam point of the cylinder, meaning that the correct distance is 70 mm instead of the 65 that is on the drawing to account for the extra radius that is included in the distance.\n\n ![](images/T101pwb03-05_modelmeasure.png ) \n\n## Making the hole a countersunk hole \n\nSwitch back to the [Part Workbench](Part_Workbench.md) and create a *cone* by pressing the \"\" **[Cone](Part_Cone.md)** button in the toolbar. Change *radius1* to 0 mm and *radius2* to 7 mm -- this will give a 2 mm *countersink* on the radius. Making the *height* of the cone 7 mm results in a 90 degree top angle of the cone, or 45 degree countersink angle. Worth to note is that again one could as well use the \"\" [Chamfer](Part_Chamfer.md) operation.\n\nWhen working with FreeCAD you will continuously be faced with several different ways to achieve seemingly the same result. There is hardly any absolute truth in what is the right way to achieve a particular end result -- however when looking in a specific context one specific workflow can be more flexible, allow for later features to actually be used etc. How you build 3D models will evolve over time as you along the way learn more and more about the features and capabilities of FreeCAD.\n\n ![](images/T101pwb04-01_cone.png ) \n\nTranslate the cone so that it is *concentric* with the hole and *coplanar* with the main solid upper surface. Use any method described earlier in this tutorial to accomplish that.\n\nIn the picture below the move is made with *Transform* and an *increment* setting of 1 mm, since the cone has a characteristic dimension of 7 mm, meaning that the earlier increment setting of 5 mm will not allow for correct positioning. The \"\" **[Wireframe](Std_DrawStyle#Wireframe.md)** rendering is used to easier see that the cone is in the right position.\n\n ![](images/T101pwb04-02_conetranslate.png ) \n\nTo complete the model, let\\'s make use of the \"\" **[Boolean](Part_Boolean.md)** command instead of first selecting objects and apply a specific boolean operation. Press the toolbar button and a *task panel* opens as per the below picture to the left.\n\n ![](images/T101pwb04-03_boolean.png ) \n\nThree items needs to be specified, the *operation type*, the *first shape* and the *second shape*. The cone is supposed to be cut, this is called *Difference* in this command, instead of *Cut*. The first shape is our **Cut001**, it is listed under *compounds*, since it is build from several solids. The second shape is the **Cone**. Once the correct settings are made for the command, click the **Apply** button to execute the operation. This has all been done in the picture to the right, and there one can also see that a *compound* **Cut002** is now listed, this is our final model shape. After having changed the appearance the final model looks like this.\n\n ![](images/T101pwb04-04_modelcomplete.png ) \n\n## Making a hollow piece \n\nDo a *save-as* under a new name. FreeCAD has all of the typical operations of a 3D modeller, one of them is \"\" **[Thickness](Part_Thickness.md)**, which is used to *hollow out* parts.\n\nRotate the view so that the bottom face of the model is visible.\n\n ![](images/T101pwb05-01_frombottom.png ) \n\nSelect the *bottom face* of the model, then in the [Part Workbench](Part_Workbench.md) select \"\" **[Thickness](Part_Thickness.md)** and the screen should look like below.\n\n ![](images/T101pwb05-02_thickness_cmd.png ) \n\nClick **OK**, as you can see there is now a *radius* on the hollowed out part.\n\n ![](images/T101pwb05-03_thickness_dimension.png ) \n\nMoreover, when taking a measurement of the width of the part, it is now 32 mm, so the *thickness* has been applied *outwards*. Let's edit that, double-click the model in the Tree view and modify the *join-type* settings to *intersection* and the *thickness* setting to -1.\n\n ![](images/T101pwb05-04_thickness_modify.png ) \n\nNow the outer width of the part is 30 mm, same as before and the corners are all sharp corners.\n\n ![](images/T101pwb05-05_thickness_modified.png ) \n\n## A different way to position the chamfer \n\nDo a *save-as* under a new name. Then delete features so that the model looks like below.\n\n ![](images/T101pwb06-01_startingpoint.png ) \n\nMake a **Cube** with dimensions **30x30x60**, ending up like below.\n\n ![](images/T101pwb06-02_with_cube.png ) \n\nChange the **placement** by first rotating -120 degrees around the Y-axis.\n\n ![](images/T101pwb06-03_rotated_cube.png ) \n\nFinally, change the position to **X=50** and **Z=50** and make the *cut* to produce the same result as earlier.\n\n ![](images/T101pwb06-04_cube_cut.png ) \n\nThis once again highlights that there are always several ways to produce the same outcome, which is a recurring theme when it comes to 3D modeling. When it comes to basic geometries or solids, one can use different workbenches in FreeCAD as well as different commands and still have the same outer shape of a solid. You simply need to find your own way to a set of preferred tools and workflow that you are comfortable in using. Modeling in parametric 3D is a process of constant learning, and takes practice to master.\n\n## Editing dimensions, face colors and TNP \n\nFreeCAD is a parametric 3D modeler, this allows you to change any *placement* or *dimension* and the model will update accordingly. In general this works, but it is possible to break a model when edited -- for example when a fillet is based on an edge that no longer exists due to editing. When a model breaks during editing, it is referred to as **TNP, [Topological Naming Problem](Topological_naming_problem.md)**.\n\nGo ahead and experiment with changing dimensions and placements to see if you can break the model, do not forget to recalculate the model after changes if required. This can be done with the \"\" [Refresh](Std_Refresh.md) button in the toolbar, if the icon is grayed out it is not needed to refresh the object.\n\n### Reposition the cylinder \n\nHere is an example of the cylinder moved from the center to one side of the main body by using *Transform* on the cylinder. As can be seen in the picture, the cone is still in the original position, not affected by the move of the cylinder.\n\n ![](images/T101pwb07-01_cylindermoved.png ) \n\nWhen you move the cylinder and break through the outer surface, in version 0.19 you are loosing part of the color settings on your model. FreeCAD reverts to the user default settings for shape colors and transparency in the 3D view, however the **Cut002** shape still shows the colors and transparency that it had before as seen in below picture.\n\n### Fixing the colors \n\n ![](images/T101pwb07-02_wrongcolor.png ) \n\nHere is one way to get it back. First change *transparency* one tick up or down and then back, that brings back the transparency. You can do the same trick on *shape color*. Another way to get the color back is to *right-click* **Cut002** in the Tree view and select **Set Colors** in the context menu. In the *task panel* that displays, click **Set to Default**, that brings back the color to the one set in the view-properties.\n\n ![](images/T101pwb07-03_set_colors.png ) \n\nThe **Set Colors** command allows you to select individual faces of a shape and set a unique color on the selected faces.\n\n### Multiple solids \n\nAnother example where the cube that is making the chamfer has been translated and rotated.\n\n ![](images/T101pwb07-04_3solids.png ) \n\nAs can be seen when repositioning the chamfer in this way, the end result is *3 disjoint solids*. [Part Workbench](Part_Workbench.md) allows this, [PartDesign Workbench](PartDesign_Workbench.md) does not, either you will get an *multiple solids error* or it will simply not render all solids.\n\n### TNP\n\nGoing back to the original completed model, let's explore how the faces are named.\n\nHere the **[selection view](Selection_view.md)** has been made active, just to show clearly what is selected and not, also coloring is adjusted so that the selection is easier to see.\n\n ![](images/T101pwb07-05_face2and9.png ) \n\nSelecting one side face and the cylinder inner face gives that they are internally called face *2* and *9*, where face *2* is the side face. Face numbering can be different for you.\n\nMoving the cylinder so that the cavity ends up on the side face, and doing the selection of faces now gives a different number for the cylindrical face.\n\n ![](images/T101pwb07-06_newfacenumbers.png ) \n\nFace 2 is the right side of the original face 2, the left side of former face 2 is now face 8. The cylindrical part was face 9, but is now face 7. FreeCAD reassigns the numbering and the order is not necessarily preserved. The total face count in the first model is 10, in the version with the cylindrical face piercing the side face, the total face count is 11. So obviously face numbering has to change when the so called *topology* changes. This probably feels like a minute detail, but turns out to be quite important in parametric 3D CAD. Imagine that you have used the cylindrical face as reference for another feature, it used to be called face 9, but is now called face 8. The reference to the intended cylindrical surface is lost. Since FreeCAD, at least in currently released versions does not keep track of the *intended face*, it only keeps track of the *numbered face*, a model breaks when a reference is made to a face that later is renumbered. This is called **TNP, [Topological Naming Problem](Topological_naming_problem.md)**.\n\nYou are encouraged to learn how to avoid broken models due to TNP, further reading can be done [elsewhere on the wiki](Topological_naming_problem.md), which largely focuses on a *sketch driven* workflow, the underlying mechanism is the same though. The renumbering described here for faces goes for all geometrical entities, faces, edges and vertexes.\n\n## Organizing the tree a bit differently \n\nDo a *save-as* under a new name. Then delete all the cuts ending up with a model looking like below.\n\n ![](images/T101pwb08-01_primitives.png ) \n\nWhen using the **Part Workbench** and modelling feature rich solids, the tree structure of a solid can become hard to decipher. So far we have created one primitive / feature and applied a boolean operation. In the Part Workbench one can bundle primitives into one boolean operation. In our case we have the cylinder, cone and cube that are all a cut boolean operation.\n\nInstead of making a cut for each primitive, we can first apply a boolean union, \"\" **[Fuse](Part_Fuse.md)** the primitives intended for the boolean cut, and then make the *cut* between the **Fillet** and the **Fusion**.\n\nUsing this approach, the Tree view ends up looking like below, which is just a different way of building the same model. Compare this with the original Tree view, none is better than the other, however when making more complex models, one approach over the other can have benefits in ease of modifying/reorganizing the model if needed.\n\n ![](images/T101pwb08-02_fused.png ) \n\n## Wrapping up \n\nHaving gone through the tutorial you are now briefly acquainted with the user interface of FreeCAD and you have learned the basics in using the **Part Workbench**. You should now be able to build simple models after your own liking. The **Part Workbench** is one of the workbenches that can be used to create solids, the **PartDesign Workbench** is another. The different workbenches have different capabilities and workflows. Learning FreeCAD in full, especially considering all add-ons and macros takes years, so keep on exploring new and different ways of making models -- take different tutorials on the wiki, the learning never stops when working with FreeCAD. It is suggested that you learn *sketches* and the **PartDesign Workbench** next if your focus is on creating solids. If your focus is modelling buildings your next learning should be the **Draft** and **Arch** workbenches.\n\nAt last, FreeCAD is made by volunteers in their spare time. If you want to further advance FreeCAD's capabilities, consider [contributing](Help_FreeCAD.md) to FreeCAD, for example by improving the documentation.\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Category_Part.md) > Creating a simple part with Part WB\n"} {"id": "freecad-docs:wiki/Dodo_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Dodo_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Dodo_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "48518e44fecdb3912503aecb33847e040459ba2ffdae6fb06b8c9d01d12fb7f6", "bytes": 214, "tokens": 85, "text": "# Dodo Workbench\n1. REDIRECT [Flamingo Workbench](Flamingo_Workbench.md)Dodo is a Py3/Qt5 update of Flamingo with some other revisions a refactoring\n\n\n---\n⏵ [documentation index](../README.md) > Dodo Workbench\n"} {"id": "freecad-docs:wiki/Draft_Pattern.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Draft_Pattern.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Draft_Pattern.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f997e20217e2e7e6e79d854d596491c99d4564387e763263e1b90bd419e3ee45", "bytes": 2594, "tokens": 911, "text": "# Draft Pattern\n## Description\n\n[Draft](Draft_Workbench.md) objects with a **Make Face** property can display an SVG pattern instead of a solid face color.\n\n ![](images/DraftPatternSample.png ) \n*An ellipse and a polygon with an SVG pattern*\n\n## Usage\n\n1. Make sure the objects are closed and planar, and do not self-intersect.\n2. To close a [Draft Wire](Draft_Wire.md), a [Draft BSpline](Draft_BSpline.md), a [Draft CubicBezCurve](Draft_CubicBezCurve.md) or a [Draft BezCurve](Draft_BezCurve.md) set its **Closed** property to `True`.\n3. To close a [Draft Circle](Draft_Circle.md) or a [Draft Ellipse](Draft_Ellipse.md) set its **First Angle** and **Last Angle** properties to the same value.\n4. Select the objects.\n5. Switch to the **View** tab of the [Property editor](Property_editor.md).\n6. The **Display Mode** must be set to {{Value|Flat Lines}}.\n7. Select a **Pattern**.\n8. Optionally change the **Pattern Size**. Note that a higher value results in a denser pattern.\n9. The pattern is not displayed when the objects are selected. Deselect them to check the result.\n10. Optionally reselect the objects to change the pattern properties.\n\n## Available patterns \n\n\nImage:Aluminium.svg\\|aluminium Image:Brick01.svg\\|brick01 Image:Concrete.svg\\|concrete Image:Cross.svg\\|cross Image:Cuprous.svg\\|cuprous Image:Diagonal1.svg\\|diagonal1 Image:Diagonal2.svg\\|diagonal2 Image:Earth.svg\\|earth Image:General_steel.svg\\|general_steel Image:Glass.svg\\|glass Image:Hatch45L.svg\\|hatch45L Image:Hatch45R.svg\\|hatch45R Image:Hbone.svg\\|hbone Image:Line.svg\\|line Image:Plastic.svg\\|plastic Image:Plus.svg\\|plus Image:Simple.svg\\|simple Image:Solid.svg\\|solid Image:Square.svg\\|square Image:Steel.svg\\|steel Image:Titanium.svg\\|titanium Image:Wood.svg\\|wood Image:Woodgrain.svg\\|woodgrain Image:Zinc.svg\\|zinc\n\n\n## Notes\n\n- SVG patterns are stored in **.SVG** files. It is possible to use your own custom patterns. See [Preferences](#Preferences.md).\n- The patterns themselves are not saved in the FreeCAD document. Objects whose **Pattern** cannot be found are displayed with a solid face color instead.\n\n## Preferences\n\nSee also: [Preferences Editor](Preferences_Editor.md) and [Draft Preferences](Draft_Preferences.md).\n\n- To change the **Pattern Size** used for new objects: **Edit → Preferences... → Draft → Visual → SVG pattern size**.\n- To specify a directory with addition SVG patterns: **Edit → Preferences... → Draft → Visual → Additional SVG pattern location**.\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft Pattern\n"} {"id": "freecad-docs:wiki/Draft_Slope.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Draft_Slope.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Draft_Slope.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "1aa0f1fc70976fbfb46ebbd93eacb26a7c14b5827a4ebb505f7cf5d3748362a5", "bytes": 1994, "tokens": 675, "text": "---\n GuiCommand:\n Name: Draft Slope\n MenuLocation: Modification , Set slope
Utils , Set slope\n Workbenches: Draft_Workbench, BIM_Workbench\n Version: 0.17\n---\n\n# Draft Slope\n\n## Description\n\nThe \"\" **Draft Slope** command slopes selected [Draft Lines](Draft_Line.md) or [Draft Wires](Draft_Wire.md) by increasing, or decreasing, the Z coordinate of all points after the first one. It can also be used to flatten [Draft Wires](Draft_Wire.md). Note that the slope is relative to the XY plane defined by the **Placement** of the objects.\n\n \"\" \n*On the left a horizontal Draft Line. On the right the same line with a slope value of 1 (angle is 45°)*\n\n## Usage\n\n1. Select one or more [Draft Lines](Draft_Line.md) and/or [Draft Wires](Draft_Wire.md).\n2. There are several ways to invoke the command:\n - [Draft](Draft_Workbench.md): Press the ** [Set slope](Draft_Slope.md)** button.\n - Draft: Select the **Modification → Set slope** option from the menu.\n - [BIM](BIM_Workbench.md): Select the **Utils → Set slope** option from the menu.\n3. Enter a **Slope** value. {{Value|0}} means each segment is horizontal, {{Value|0.5}} means the delta height for each segment is {{Value|0.5}} times its length, etc. The value can also be negative.\n4. Press **Enter** or the **OK** button to finish the command.\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThere is no Python method to slope objects. To emulate the results of the Draft Slope command the `Points` property of wire objects has to be modified.\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft Slope\n"} {"id": "freecad-docs:wiki/Draft_Tray.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Draft_Tray.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Draft_Tray.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0240cee7e17d2c2a500256573a05ec04abd7def147505710077ff1b5deaf8d00", "bytes": 1286, "tokens": 448, "text": "# Draft Tray\n## Description\n\nThe **Draft Tray** allows selecting the working plane, defining style settings, toggling construction mode, and specifying the active layer or group. The four buttons show the current settings. The Draft Tray is available in the \"\" [Draft Workbench](Draft_Workbench.md) and the \"\" [BIM Workbench](BIM_Workbench.md) and cannot be disabled.\n\n ![](images/Draft_tray_default.png ) \n*The Draft Tray*\n\n## Available tools \n\n- ![](images/Draft_tray_button_plane.png ) [Select Plane](Draft_SelectPlane.md): selects the current Draft working plane.\n\n- ![](images/Draft_tray_button_style.png ) [Set style](Draft_SetStyle.md): sets the default style for new objects.\n\n- ![](images/Draft_tray_button_construction.png ) [Toggle construction mode](Draft_ToggleConstructionMode.md): switches Draft construction mode on or off.\n\n- ![](images/Draft_tray_button_layer.png ) [AutoGroup](Draft_AutoGroup.md): changes the active [Draft Layer](Draft_Layer.md) or, optionally, the active [Std Group](Std_Group.md) or group-like [BIM](BIM_Workbench.md) object.\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft Tray\n"} {"id": "freecad-docs:wiki/Draft_Trimex.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Draft_Trimex.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Draft_Trimex.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ebbde7a41db222a36ba0778104cbbe262673ac78b11f9dec64d5f8d3305bf0bc", "bytes": 5938, "tokens": 1897, "text": "---\n GuiCommand:\n Name: Draft Trimex\n MenuLocation: Modification , Trimex
Modify , Trimex\n Workbenches: Draft_Workbench, BIM_Workbench\n Shortcut: **T** **R**\n SeeAlso: Part_Extrude\n---\n\n# Draft Trimex\n\n## Description\n\nThe \"\" **Draft Trimex** command [trims or extends](#Trim_or_extend.md) a selected object. Intersections with the edge of another object can be used to determine new endpoints. The command can also be used to [extrude](#Extrude.md) a face, in which case it creates a [Part Extrude](Part_Extrude.md) object.\n\n \"\" \n*Top: a Draft Wire extended and then trimmed.
\nBottom: a face extruded into a solid body.*\n\n## Trim or extend \n\n### Usage\n\n1. Optionally select one object. The object must be a [Draft Line](Draft_Line.md), a [Draft Wire](Draft_Wire.md), a [Draft Arc](Draft_Arc.md) or a [Draft Circle](Draft_Circle.md) (which can only be trimmed). If the selected object is closed it must have its **Make Face** property set to `False`.\n2. There are several ways to invoke the command:\n - Press the ** [Trimex](Draft_Trimex.md)** button.\n - [Draft](Draft_Workbench.md): Select the **Modification → Trimex** option from the menu.\n - [BIM](BIM_Workbench.md): Select the **Modify → Trimex** option from the menu.\n - Use the keyboard shortcut: **T** then **R**.\n3. If you have not yet selected an object: select an object in the [3D view](3D_view.md).\n4. The **Trimex** task panel opens. See [Options](#Options.md) for more information.\n5. Move the pointer in the [3D view](3D_view.md) so that the preview matches the desired result. If required use the modifier keys as explained in the [Options](#Options.md).\n6. Do one of the following:\n - Pick a point in the [3D view](3D_view.md).\n - Enter a **Distance** or an **Angle**. The distance is a delta distance. This option does not work if modifier keys are used.\n - Move the pointer over an edge belonging to another object, and click when this edge is highlighted, to trim or extend the selected object using an intersection with the highlighted edge as the new endpoint. When trimming, the projection of the point where the cutting edge is selected onto the object to be trimmed, determines the default result. Note that [Draft Snaps](Draft_Snap.md) can have an undesirable impact here. In some cases it can be useful to turn them off temporarily.\n\n### Options\n\nThe single character keyboard shortcuts available in the task panel can be changed. See [Draft Preferences](Draft_Preferences.md). The shortcuts mentioned here are the default shortcuts.\n\n- Hold down **Alt** to invert the default result of the command.\n- Hold down **Shift** to restrict the operation to the current segment of a [Draft Wire](Draft_Wire.md).\n- Press **S** to switch [Draft snapping](Draft_Snap.md) on or off.\n\nHere is an example to explain the modifier keys. The left edge or the bottom edge of the U-shaped wire was extended. All [Draft Snaps](Draft_Snap.md) were turned off.\n\n ![](images/Draft_Trimex_example2.png ) \n\n1. The arc was clicked near the bottom left corner of the wire. This is the default result.\n\n2. \n **Alt**was held down while the arc was clicked near the bottom left corner of the wire.\n\n3. \n **Y**was pressed, and while hovering over the left edge **Shift** was held down and then the arc was clicked. Pressing **Y** is only required for edges that are more or less parallel to the Y axis.\n\n## Extrude\n\n### Usage \n\nSee also: [Draft Snap](Draft_Snap.md) and [Draft Constrain](Draft_Constrain.md).\n\n1. It can be helpful to first change the [Draft working plane](Draft_SelectPlane.md) so that it is not coplanar with the face you want to extrude.\n2. Optionally select a single face or an object with a single face.\n3. There are several ways to invoke the command:\n - Press the ** [Draft Trimex](Draft_Trimex.md)** button.\n - Select the **Modification → Trimex** option from the menu.\n - Use the keyboard shortcut: **T** then **R**.\n4. If you have not yet selected an object or a face: select an object with a single face in the [3D view](3D_view.md).\n5. The **Trimex** task panel opens. See [Options](#Options_2.md) for more information.\n6. To define the extrusion direction and distance do one of the following:\n - Pick a point in the [3D view](3D_view.md) that does no lie on the same plane as the face.\n - Make sure the pointer is on the correct side of the face in the [3D view](3D_view.md) and enter a **Distance**.\n\n### Options \n\nThe modifier key mentioned here can be changed. See [Draft Preferences](Draft_Preferences.md).\n\n- Hold **Shift** to extrude in a direction that is not parallel to the normal of the face.\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThere is no Python method to trim objects. To extrude objects use the `extrude` method of the Draft module.\n\n \n```python\nextrusion = extrude(obj, vector, solid=False)\n```\n\n- `obj`is the object to be extruded.\n\n- `vector`is the extrusion direction and distance.\n\n- If `solid` is `True` a solid is created instead of a shell.\n\n- `extrusion`is returned with the created object.\n\nExample:\n\n \n```python\nimport FreeCAD as App\nimport Draft\n\ndoc = App.newDocument()\n\nrectangle = Draft.make_rectangle(1500, 500)\ndoc.recompute()\n\nvector = App.Vector(0, 0, 300)\nsolid = Draft.extrude(rectangle, vector, solid=True)\ndoc.recompute()\n```\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft Trimex\n"} {"id": "freecad-docs:wiki/Draft_WorkingPlane.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Draft_WorkingPlane.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Draft_WorkingPlane.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ba8aed59af9591a44b98801b0c00ec12310e54193686214ae858d0bce2c39c97", "bytes": 186, "tokens": 79, "text": "# Draft WorkingPlane\n1. REDIRECT [Draft_Snap_WorkingPlane](Draft_Snap_WorkingPlane.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft WorkingPlane\n"} {"id": "freecad-docs:wiki/DynamicData_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/DynamicData_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/DynamicData_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "497a71def8070c60ed26b2608f30227a9b4e1f5d623adf94fa89291f39c72e21", "bytes": 2360, "tokens": 661, "text": "# \"DynamicData DynamicData Workbench\n\n \n\n## Overview\n\nDynamicData is an [external workbench](External_workbenches.md) with which one can create a container object for holding custom properties.\n\nWith this workbench it\\'s possible to create a new custom [property](property.md) of just about any type that FreeCAD supports. For example a Length property or a [Placement](Placement.md) property. These custom properties can then be used in [Expressions](Expressions.md) just like any other property. For example, you could create a Length property called \\\"Width\\\" and refer to it when constraining a sketch element. Then when the \\\"Width\\\" property is changed, the sketch constraint will automatically update. This is similar to the way one can use a spreadsheet, but is more interactive in that the properties can be changed while still being able to see the [3D view](3D_view.md) and also allows for a wider variety of property types.\n\nSome features include:\n\n- ability to import named constraints from a sketch\n- ability to copy properties or set property values from one object to another\n- container objects remain compatible with FreeCAD installations that do not have the workbench installed\n\n## Installation\n\nThis workbench can be installed from the [Addon Manager](Std_AddonMgr.md). For manual installation see [Installing more workbenches](Installing_more_workbenches.md).\n\n## Links\n\n- Source code hosted on GitHub: [github.com](https://github.com/mwganson/DynamicData)\n- Official complete [documentation](https://github.com/mwganson/DynamicData/blob/master/README.md)\n\n## External workbenches \n\nFreeCAD workbenches are easy to program in [Python](Python.md), there are therefore many people developing additional workbenches outside of the FreeCAD main developers.\n\nThe [external workbenches](external_workbenches.md) page has some information and tutorials on some of them, and the [FreeCAD Addons](https://github.com/FreeCAD/FreeCAD-addons) project aims at gathering them and making them easily installable from within FreeCAD.\n\nNew workbenches are in development, stay tuned!\n\n\n---\n⏵ [documentation index](../README.md) > [Addons](Category_Addons.md) > [External Workbenches](Category_External%20Workbenches.md) > DynamicData Workbench\n"} {"id": "freecad-docs:wiki/FCGear_WormGear.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/FCGear_WormGear.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/FCGear_WormGear.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7b978dfeec27d313a2093c9d7d3f97fc7494207d134268e64a4746dd6636d66b", "bytes": 4975, "tokens": 1566, "text": "---\n GuiCommand:\n Name: FCGear WormGear\n MenuLocation: Gear , Worm Gear\n Workbenches: FCGear_Workbench\n Shortcut: None\n Version: v0.16\n SeeAlso: PartDesign_InvoluteGear\n---\n\n# FCGear WormGear\n\n## Description\n\nThe worm can be considered a special case of a helical gear. Imagine that there is only one tooth on a spur gear. Now increase the helix angle so much that the tooth winds around the spur gear several times before it emerges on the opposite side. The result would be a single thread worm.\n\nFor a single-start worm, each full turn (360 degrees) of the worm advances the gear by one tooth. So a gear with 24 teeth will provide a gear reduction of 24:1. For a multi-start worm, the gear reduction equals the number of teeth on the gear, divided by the number of starts on the worm.\n\nA worm can only be used with a worm wheel. This is called a worm drive. Like other gear arrangements, a worm drive can reduce rotational speed or transmit higher torque. One of the major advantages of worm gear drive units are that they can transfer motion in 90 degrees. A worm drive is also self-locking.\n\n ![](images/Worm-Gear_example.png ) \n*Worm gear (No. of teeth 3)*\n\n## Usage\n\n1. Switch to the \"\" [FCGear Workbench](FCGear_Workbench.md).\n2. There are several ways to invoke the command:\n - Press the **[ [Worm Gear](FCGear_WormGear.md)** button in the toolbar.\n - Select the **Gear → [ Worm Gear** option from the menu.\n3. Change the gear parameter to the required conditions (see [Properties](#Properties.md)).\n\n## Properties\n\nAn FCGear WormGear object is derived from a [Part Feature](Part_Feature.md) object and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{Properties_Title|base}}\n\n- **diameter|Length**: Default is {{Value|5 mm}}. Pitch diameter.\n\n- **height|Length**: Default is {{Value|5 mm}}. Value of the worm length.\n\n- **module|Length**: Default is {{Value|1 mm}}. Module is the ratio of the reference diameter of the gear divided by the number of teeth (see [Notes](#Notes.md)).\n\n- **reverse_pitch|Bool**: Default is {{False}}, {{True}} changes the rotating direction from right to left.\n\n- **teeth|Integer**: Default is {{Value|3}}. Number of teeth (see [Notes](#Notes.md)).\n\n\n{{Properties_Title|computed}}\n\n- **beta|Angle**: (read-only) Lead angle (see also the information in [Notes](#Notes.md) and [Useful formulas](#Useful_formulas.md)).\n\n\n{{Properties_Title|involute}}\n\n- **pressure_angle|Angle**: Default is {{Value|20 °}} (see [Notes](#Notes.md)).\n\n\n{{Properties_Title|tolerance}}\n\n- **clearance|Float**: Default is {{Value|0.25}} (see [Notes](#Notes.md)).\n\n- **head|Float**: Default is {{Value|0}}. This value is used to change the tooth height.\n\n\n{{Properties_Title|version}}\n\n- **version|String**:\n\n## Notes\n\n- **beta**: If the lead angle is less than 5°, it is a self-locking gear. A typical example are the tuning pegs on a guitar or ukulele.\n\n- **clearance**: At a worm gearing, clearance is the distance between the tooth tip of the worm and the tooth root of the worm wheel.\n\n- **module**: Using ISO (International Organization for Standardization) guidelines, Module size is designated as the unit representing gear tooth-sizes. Module (m): m = 1 (p = 3.1416), m = 2 (p = 6.2832), m = 4 (p = 12.566). If you multiply Module by Pi, you can obtain Pitch (p). Pitch is the distance between corresponding points on adjacent teeth. If the module is changed, the lead angle also changes (**beta**).\n\n- **teeth**: The number of teeth in a worm is called the number of threads. Correspondingly, one speaks of single, double or multiple thread worms. In general, mainly single worms are produced, but in special cases the number of starts can be up to four (sometimes also more). If the number of teeth is changed, **beta** also changes.\n\n- **pressure_parameter**: Only change the parameter, if sufficient knowledge of the gear geometry is available.\n\n## Useful formulas \n\n- **beta (lead angle)**= arctan (**module** \\* **teeth** : **pitchdiameter (diameter)**)\n\n- **axial pitch**= **pi** \\* **module** \\* **teeth**\n\n- **beta (lead angle)**= arctan (**axial pitch** : (**pitchdiameter (diameter)** \\* **pi**))\n\n- **worm length**= 4,5 \\* **module** \\* **pi**\n\n## Worm wheel \n\nThe worm wheel must be designed manually. For this purpose [FCGear InvoluteGear](FCGear_InvoluteGear.md) can be used for a simple construction. In any case, in-depth knowledge of the gear types is required.\n\n ![](images/Worm-Gear_example3.png ) \n*Worm with worm wheel*\n\n\n---\n⏵ [documentation index](../README.md) > [Addons](Category_Addons.md) > [FCGear](Category_FCGear.md) > [External Command Reference](Category_External%20Command%20Reference.md) > FCGear WormGear\n"} {"id": "freecad-docs:wiki/FEM_Analysis.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/FEM_Analysis.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/FEM_Analysis.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "da9ab64e5dcbb0dc08bd52e01e65416c7965d1f827447f250818e1d10bcde31d", "bytes": 2611, "tokens": 821, "text": "---\n GuiCommand:\n Name: FEM Analysis\n MenuLocation: Model , Analysis container‏‎\n Workbenches: FEM_Workbench\n Shortcut: **S** **A**\n SeeAlso: FEM_tutorial\n---\n\n# FEM Analysis\n\n## Description\n\nThe FEM Analysis could be seen as a container that holds all objects of a Finite Element Analysis. It is mandatory to have an analysis container that holds all the needed objects. At least one of the following objects (apart from the mesh) is necessary for a mechanical analysis:\n\n- [solid material](FEM_MaterialSolid.md),\n- [fixed boundary condition](FEM_ConstraintFixed.md) or [displacement boundary condition](FEM_ConstraintDisplacement.md) or [rigid body constraint](FEM_ConstraintRigidBody.md).\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Analysis container](FEM_Analysis.md)** button.\n - Select the **Model → Analysis container‏‎** option from the menu.\n - Use the keyboard shortcut: **S** then **A**.\n2. A new Analysis is created and set to active.\n3. Other objects could be added or removed from the analysis container by drag and drop.\n4. To add new FEM objects to the document the analysis has to be active. Double-clicking on the analysis container activates the analysis.\n\n## Options\n\n- Up to date there is no option to choose.\n\n## Properties\n\n- **OutpuDir**: Specifies the working directory of the analysis\n\n## Scripting\n\nmost code here is deprecated in 0.17.\n\n- new analysis\n\n \n```python\nMechanicalAnalysis.makeMechanicalAnalysis( name )\n```\n\n- add object to the analysis\n\n \n```python\nApp.ActiveDocument.MechanicalAnalysis.Member = App.ActiveDocument.MechanicalAnalysis.Member + [ (object) ]\n```\n\n- remove object from the analysis\n\n \n```python\nmember = App.ActiveDocument.MechanicalAnalysis.Member\nmember.remove( documentobject )\n App.ActiveDocument.MechanicalAnalysis.Member = member\n```\n\n Examples: \n```python\nimport MechanicalAnalysis\nanalysis = MechanicalAnalysis.makeMechanicalAnalysis(\"MechanicalAnalysis\")\nFemGui.setActiveAnalysis(analysis)\n\naddobj = App.ActiveDocument.getObject(\"MechanicalMaterial\")\nApp.ActiveDocument.MechanicalAnalysis.Member = App.ActiveDocument.MechanicalAnalysis.Member + [addobj]\n\nremoveobj = App.ActiveDocument.getObject(\"MechanicalMaterial\")\nmember = App.ActiveDocument.MechanicalAnalysis.Member\nmember.remove(removeobj)\nApp.ActiveDocument.MechanicalAnalysis.Member = member\n```\n\n\n {{FEM Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [FEM](Category_FEM.md) > FEM Analysis\n"} {"id": "freecad-docs:wiki/FEM_ConstraintSpring.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/FEM_ConstraintSpring.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/FEM_ConstraintSpring.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "18251e1b17b25cfa75f059e4edd2650b7fceffc03f0bbbfadf6a2345cf16bf07", "bytes": 1491, "tokens": 527, "text": "---\n GuiCommand:Container|\n{{GuiCommand\n Name: FEM ConstraintSpring\n MenuLocation: Model , Mechanical boundary conditions and loads , Spring\n Workbenches: FEM_Workbench\n Shortcut: \n Version: 0.20\n SeeAlso: \n}}\n{{GuiCommandFemInfo\n Solvers: Elmer\n}}\n---\n\n# FEM ConstraintSpring\n\n## Description\n\nDefines a spring boundary condition to be used for mechanical analyses using the \"\" [Elmer solver](FEM_SolverElmer.md).\n\n\n(v0.21) \n\n: The spring constraint can be used for the equations \"\" [Deformation](FEM_EquationDeformation.md) and \"\" [Elasticity](FEM_EquationElasticity.md).\n\n## Usage\n\n1. Either use the toolbar button ** [Spring](FEM_ConstraintSpring.md)** or the menu **Model → Mechanical boundary conditions and loads → Spring**.\n2. Press the **Add** button.\n3. In the [3D view](3D_view.md) select the faces to which the spring should be applied. To remove faces from the selection, press the **Remove** button and click on them.\n4. Specify the normal or tangential stiffness (in N/m) and select which one Elmer should use.\n\n\n {{FEM Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [FEM](Category_FEM.md) > FEM ConstraintSpring\n"} {"id": "freecad-docs:wiki/FEM_Examples.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/FEM_Examples.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/FEM_Examples.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6ff655292a745bf251399c7c069cbd6851ef565a6aa25e75bfacb288ba27a200", "bytes": 1381, "tokens": 457, "text": "---\n GuiCommand:\n Name: FEM Examples\n MenuLocation: Utilities , Open FEM examples\n Workbenches: FEM_Workbench\n Version: 0.19\n SeeAlso: FEM_tutorial\n---\n\n# FEM Examples\n\n## Description\n\n[FEM Examples](FEM_Examples.md) launches a graphical interface that allows you to access the different examples available in the \"\" [FEM](FEM_Workbench.md) workbench.\n\n ![](images/FEM_Example_gui.png ) \n*The example selection dialog*\n\n## Usage\n\n1. The examples will use one of the [finite element solvers](FEM_Solver.md) that the workbench supports. Therefore the necessary [FEM solver](FEM_Solver.md) must be installed before they can be run.\n2. Select the **Utilities → Open FEM examples** option from the menu or press the ** [Open FEM examples](FEM_Examples.md)** button.\n3. The **FEM Examples** view opens with various categories, **All**, **Constraints**, **Equations**, **Materials**, **Meshes**, **Solvers**.\n4. Open the categories, select one example, and press **Setup** to open the simulation case only.\n5. Or press **Run** to open the case, and start the simulation, so that the results are available.\n\n\n {{FEM Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [FEM](Category_FEM.md) > FEM Examples\n"} {"id": "freecad-docs:wiki/FEM_SolverCalculiX.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/FEM_SolverCalculiX.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/FEM_SolverCalculiX.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "4532096c9f4f8c1e95deb5b12f3cf469557e5f1b6c384b428c108e9b32e43789", "bytes": 970, "tokens": 344, "text": "---\n GuiCommand:\n Name: FEM SolverCalculiX\n MenuLocation: Solve , Solver CalculiX \n Workbenches: FEM_Workbench\n Shortcut: **S** **C**\n---\n\n# FEM SolverCalculiX\n\n## Description\n\nThe **Solver CalculiX (new framework)** command creates a SolverCalculix object, which uses the same framework as Elmer and Z88 solvers (the code is not visible for the user). It is preferred to use the original framework \"\" [Solver CalculiX Standard](FEM_SolverCalculixCxxtools.md) because it contains extra checks, e.g. showing the elements with nonpositive Jacobian which might cause solution difficulties.\n\n## Usage\n\n1. Select **Solve → Solver CalculiX (new framework)** from the menu.\n\n## Related\n\n- [FEM CalculiX](FEM_CalculiX.md)\n\n\n {{FEM Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [FEM](Category_FEM.md) > FEM SolverCalculiX\n"} {"id": "freecad-docs:wiki/Fasteners_BOM.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Fasteners_BOM.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Fasteners_BOM.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5e600259eff044a094911c29e1dc6901fb8ba6625c48dea35975f25c35f95dfb", "bytes": 1330, "tokens": 484, "text": "---\n GuiCommand:\n Name: Fasteners BOM\n MenuLocation: Fasteners , Generate BOM\n Workbenches: Fasteners_Workbench\n SeeAlso: Spreadsheet_Workbench\n---\n\n# Fasteners BOM\n\n## Description\n\nThe \"\" **Fasteners BOM** command creates a spreadsheet with a bill of materials (BOM) for the fasteners in the document.\n\n \"\" \n*A model with a Fasteners BOM spreadsheet*\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Generate BOM](Fasteners_BOM.md)** button.\n - Select the **Fasteners → Generate BOM** option from the menu.\n2. A Fasteners BOM spreadsheet is created.\n\n## Notes\n\n- A Fasteners BOM spreadsheet does not update if fasteners are changed, or if fasteners are added or removed. In such cases the command has to be used to create a new spreadsheet.\n- A Fasteners BOM spreadsheet can be exported with the [Spreadsheet Export](Spreadsheet_Export.md) command.\n\n\n {{Fasteners_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [External_Command_Reference](Category_External_Command_Reference.md) > [Fasteners](Category_Fasteners.md) > Fasteners BOM\n"} {"id": "freecad-docs:wiki/Fasteners_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Fasteners_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Fasteners_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2b9b13f0b02322bd6f158bf8251ed84ec547d4a02cd0a634cf32737fe22bac6a", "bytes": 33305, "tokens": 13597, "text": "# \"Fasteners Fasteners Workbench\n\n \n\n## Introduction\n\nThe \"\" [Fasteners Workbench](Fasteners_Workbench.md) is an [external workbench](External_workbenches.md) that can add various fasteners to parts.\n\n \"\" \n*The optional single toolbar layout of the workbench.
\nFasteners with metric dimensions have orange icons.
\nFasteners with inch dimensions have green icons.*\n\n## Installation\n\n1. Install the Fasteners Workbench via the \"\" [Addon Manager](Std_AddonMgr.md). For manual installation see [Installing more workbenches](Installing_more_workbenches.md).\n2. Restart FreeCAD.\n3. Select the \"\" [Fasteners Workbench](Fasteners_Workbench.md) from the [Workbench dropdown list](Std_Workbench.md).\n4. Optionally change the toolbar and menu layout:\n 1. Go to: **Edit → Preferences... → Fasteners → General settings**.\n 2. Select one of the available **Toolbar screw icons grouping** options:\n - \n **None**\n \n : All fasteners appear in a single toolbar. To see all available buttons use the **>>** button to expand it.\n\n - \n **Separate toolbars**\n \n : Fasteners are grouped in several toolbars. This is the default layout.\n\n - \n **Dropdown buttons**\n \n : Fasteners are grouped in toolbars with flyouts.\n 3. Optionally uncheck one or more **Fastener standards shown in toolbars** options. Unchecked standards are still available from the menu.\n 4. Restart FreeCAD.\n\n## Usage\n\nFasteners can be attached or unattached. Attached fasteners have a **Base Object**, a circular edge, and their **Placement** is dynamically linked to that object. The \"\" [Fasteners Move](Fasteners_Move.md) command can be used to attach or detach a fastener.\n\n### Unattached fasteners \n\n1. Select the desired fastener by clicking its button or by picking it from the menu.\n2. A fastener is created at the origin.\n3. Optionally change the dimensions and other properties of the fastener:\n 1. Select the fastener.\n 2. Go to the **Data** tab of the [Property editor](Property_editor.md).\n 3. Change the required properties.\n\n### Attached fasteners \n\n \"\" \"\" \n*On the left two selected circular edges. On the right the attached fasteners.*\n\n1. Specify if the selected holes are tap holes or pass holes by selecting \"\" [Fasteners MatchTypeInner](Fasteners_MatchTypeInner.md) or \"\" [Fasteners MatchTypeOuter](Fasteners_MatchTypeOuter.md) respectively (not used for countersunk screws).\n2. Select one or more circular edges and/or faces with circular edges. For countersunk screws the top edge of the chamfered hole must be selected.\n3. Select the desired fastener by clicking its button or by picking it from the menu.\n4. A fastener is attached to each of the selected circular edges.\n5. The default dimensions of each fastener depend on the radius of the circular edge it is attached to. Countersunk screws are matched by their head diameter, other fasteners are matched by their shaft diameter.\n6. Optionally change the dimensions and other properties of the fasteners. See above.\n7. Fasteners that appear upside-down can be inverted with the \"\" [Fasteners Flip](Fasteners_Flip.md) command or by changing their **Invert** property.\n8. Optionally change the **Offset** property to create space between the fasteners and the edges they are attached to.\n\n## Notes\n\n- To generate threads, the **Thread** property of a fastener must be changed to `True`. Generating threads is costly. Recomputes take much longer if there are many fasteners with threads in a document.\n- The **Invert** property and the **Offset** property are ignored for unattached fasteners.\n\n## Commands\n\n- \"\" [Invert fastener](Fasteners_Flip.md): Invert the orientation of attached fasteners.\n\n- \"\" [Move fastener](Fasteners_Move.md): Move and attach a fastener to a circular edge. Can also be used to detach a fastener.\n\n- \"\" [Simplify shape](Fasteners_Simplify.md): Create non-parametric copies of fasteners.\n\n- \"\" [Match for tap hole](Fasteners_MatchTypeInner.md): Consider circular edges to be tap holes when new fasteners are attached to them.\n\n- \"\" [Match for pass hole](Fasteners_MatchTypeOuter.md): Consider circular edges to be pass holes when new fasteners are attached to them.\n\n- \"\" [Generate BOM](Fasteners_BOM.md): Create a spreadsheet with a bill of materials for the fasteners in the document.\n\n- \"\" [Screw calculator](Fasteners_ScrewCalculator.md): Show a calculator to determine the tap hole size of screws.\n\n- \"\" [Change fastener parameters](Fasteners_ChangeParameters.md): Change the parameters of fasteners.\n\n## Fasteners\n\nFasteners with metric dimensions have orange icons. Fasteners with inch dimensions have green icons.\n\n### Hexagon head screws and bolts \n\n- \"\" **ASME B18.2.1.6** UNC hexagon head screw.\n\n- \"\" **ASME B18.2.1.8** UNC hexagon head screw with flange.\n\n- \"\" **DIN 571** Hexagon head wood screw.\n\n- \"\" **DIN 933** Hexagon head screw.\n\n- \"\" **DIN 961** Hexagon head screw.\n\n- \"\" **EN 1662** Hexagon head bolt with flange, small series.\n\n- \"\" **EN 1665** Hexagon head bolt with flange, heavy series.\n\n- \"\" \n**ISO 4014** Hexagon head bolt. *Product grades A and B.*\n\n- \"\" **ISO 4015** Hexagon head bolt with reduced shank.\n\n- \"\" \n**ISO 4016** Hexagon head bolt. *Product grade C.*\n\n- \"\" \n**ISO 4017** Hexagon head screw. *Product grades A and B.*\n\n- \"\" \n**ISO 4018** Hexagon head screw. *Product grade C.*\n\n- \"\" \n**ISO 4162** Hexagon bolt with flange, small series. *Product grade A with driving feature of product grade B.*\n\n- \"\" \n**ISO 8676** Hexagon head screw with fine pitch thread. *Product grades A and B.*\n\n- \"\" **ISO 8765** Hexagon head bolt with fine pitch thread.\n\n- \"\" \n**ISO 15071** Hexagon bolt with flange, small series. *Product grade A.*\n\n- \"\" \n**ISO 15072** Hexagon bolt with flange and fine pitch thread, small series. *Product grade A.*\n\n### Hexagon socket screws \n\n- \"\" **ASME B18.3.1A** UNC hexagon socket head cap screw.\n\n- \"\" **ASME B18.3.1G** UNC hexagon socket head cap screw with low head.\n\n- \"\" **ASME B18.3.2** UNC hexagon socket countersunk head screw.\n\n- \"\" **ASME B18.3.3A** UNC hexagon socket button head screw.\n\n- \"\" **ASME B18.3.3B** UNC hexagon socket button head screw with flange.\n\n- \"\" **ASME B18.3.4** UNC hexagon socket head shoulder screw.\n\n- \"\" **DIN 6912** Hexagon socket head cap screw with low head with center.\n\n- \"\" **DIN 7984** Hexagon socket head cap screw with low head.\n\n- \"\" **ISO 2936** Hexagon socket screw key.\n\n- \"\" **ISO 4762** Hexagon socket head cap screw.\n\n- \"\" **ISO 7379** Hexagon socket head shoulder screw.\n\n- \"\" **ISO 7380-1** Hexagon socket button head screw.\n\n- \"\" **ISO 7380-2** Hexagon socket button head screw with flange.\n\n- \"\" **ISO 10642** Hexagon socket countersunk head screw.\n\n### Hexalobular socket head screws \n\n- \"\" **ISO 14579** Hexalobular socket head cap screw.\n\n- \"\" **ISO 14580** Hexalobular socket cheese head screw.\n\n- \"\" **ISO 14581** Hexalobular socket countersunk flat head screw.\n\n- \"\" **ISO 14582** Hexalobular socket countersunk head screw, high head.\n\n- \"\" **ISO 14583** Hexalobular socket pan head screw.\n\n- \"\" **ISO 14584** Hexalobular socket raised countersunk head screw.\n\n### Slotted head screws \n\n- \"\" **ASME B18.6.1.2** Slotted flat countersunk head wood screw.\n\n- \"\" **ASME B18.6.1.4** Slotted oval countersunk head wood screw.\n\n- \"\" **ASME B18.6.3.1A** UNC slotted countersunk flat head screw.\n\n- \"\" **ASME B18.6.3.4A** UNC slotted oval countersunk head screw.\n\n- \"\" **ASME B18.6.3.9A** UNC slotted pan head screw.\n\n- \"\" **ASME B18.6.3.10A** UNC Slotted fillister head screw.\n\n- \"\" **ASME B18.6.3.12A** UNC Slotted truss head screws.\n\n- \"\" **ASME B18.6.3.16A** UNC Slotted round head screw.\n\n- \"\" \n**DIN 84 (superseded by ISO 1207)** Slotted cheese head screw. *Product grade A.*\n\n- \"\" **DIN 96** Slotted half round head wood screw.\n\n- \"\" **GOST 1144-1** Slotted half round head wood screw.\n\n- \"\" **GOST 1144-2** Slotted half round head wood screw.\n\n- \"\" \n**ISO 1207** Slotted cheese head screw. *Product grade A.*\n\n- \"\" \n**ISO 1580** Slotted pan head screw. *Product grade A.*\n\n- \"\" \n**ISO 2009** Slotted countersunk flat head screw. *Product grade A.*\n\n- \"\" \n**ISO 2010** Slotted raised countersunk head screw. *Product grade A.*\n\n### H cross head screws \n\n- \"\" **ASME B18.6.1.3** Flat countersunk head wood screw.\n\n- \"\" **ASME B18.6.1.5** Oval countersunk head wood screw.\n\n- \"\" **ASME B18.6.3.1B** UNC flat countersunk head screw.\n\n- \"\" **ASME B18.6.3.4B** UNC oval countersunk head screw.\n\n- \"\" **ASME B18.6.3.9B** UNC pan head screw.\n\n- \"\" **ASME B18.6.3.10B** UNC fillister head screw.\n\n- \"\" **ASME B18.6.3.12C** UNC truss head screws.\n\n- \"\" **ASME B18.6.3.16B** UNC round head screw.\n\n- \"\" **DIN 967** Pan head screw with collar.\n\n- \"\" **DIN 7996** Pan head wood screw.\n\n- \"\" **GOST 1144-3** Pan head wood screw.\n\n- \"\" **GOST 1144-4** Pan head wood screw.\n\n- \"\" \n**ISO 7045** Pan head screw. *Product grade A.*\n\n- \"\" \n**ISO 7046** Countersunk flat head screw. *Product grade A.*\n\n- \"\" \n**ISO 7047** Raised countersunk head screw. *Product grade A.*\n\n- \"\" **ISO 7048** Cheese head screw.\n\n- \"\" **ISO 7049-C** Pan head self tapping screws with conical point.\n\n- \"\" **ISO 7049-F** Pan head self tapping screws with flat point.\n\n- \"\" **ISO 7049-R** Pan head self tapping screws with rounded point.\n\n### Other head bolts \n\n- \"\" **ASME B18.2.1.1** UNC square head bolt.\n\n- \"\" **ASME B18.5** UNC Round head square neck bolt.\n\n- \"\" **DIN 478** Square head bolt with collar.\n\n- \"\" **DIN 603** Round head square neck bolt.\n\n- \"\" **ISO 2342** Headless screw with shank\n\n### Set screws \n\n- \"\" **ASME B18.3.5A** UNC hexagon socket set screw with flat point.\n\n- \"\" **ASME B18.3.5B** UNC hexagon socket set screw with cone point.\n\n- \"\" **ASME B18.3.5C** UNC hexagon socket set screw with dog point.\n\n- \"\" **ASME B18.3.5D** UNC hexagon socket set screw with cup point.\n\n- \"\" **ISO 4026** Hexagon socket set screw with flat point.\n\n- \"\" **ISO 4027** Hexagon socket set screw with cone point.\n\n- \"\" **ISO 4028** Hexagon socket set screw with dog point.\n\n- \"\" **ISO 4029** Hexagon socket set screw with cup point.\n\n- \"\" **ISO 4766** Slotted socket set screw with flat point.\n\n- \"\" **ISO 7434** Slotted socket set screw with cone point.\n\n- \"\" **ISO 7435** Slotted socket set screw with long dog point.\n\n- \"\" **ISO 7436** Slotted socket set screw with cup point.\n\n### Thumb screws \n\n- \"\" **DIN 464** Knurled thumb screw, high type.\n\n- \"\" **DIN 465** Slotted knurled thumb screw, high type.\n\n- \"\" **DIN 653** Knurled thumb screw, low type.\n\n### Nuts\n\n- \"\" **ASME B18.2.2.1A** UNC hexagon machine screw nut.\n\n- \"\" **ASME B18.2.2.1B** UNC square machine screw nut.\n\n- \"\" **ASME 18.2.2.2** UNC square nut.\n\n- \"\" **ASME B18.2.2.4A** UNC hexagon nut.\n\n- \"\" **ASME B18.2.2.4B** UNC hexagon thin nut.\n\n- \"\" **ASME 18.2.2.5** UNC hexagon castle nut.\n\n- \"\" **ASME 18.2.2.12** UNC hexagon nut with flange.\n\n- \"\" **ASME 18.2.2.13** UNC hexagon coupling nut.\n\n- \"\" **ASME 18.6.9A** Wing nut, type A.\n\n- \"\" **DIN 315** Wing nut.\n\n- \"\" **DIN 557** Square nut.\n\n- \"\" **DIN 562** Square nut.\n\n- \"\" **DIN 917** Cap nut, low form.\n\n- \"\" **DIN 928** Square weld nut.\n\n- \"\" **DIN 929** Hexagon weld nut.\n\n- \"\" \n**DIN 934 (superseded by ISO 4035 and ISO 8673)** Hexagon thin nut chamfered. *Product grades A and B.*\n\n- \"\" **DIN 935** Hexagon castle nut.\n\n- \"\" **DIN 985** Nyloc nut.\n\n- \"\" **DIN 1587** Cap nut.\n\n- \"\" **DIN 6330** Hexagon nut 1.5d high.\n\n- \"\" **DIN 6331** Hexagon with collar 1.5d high.\n\n- \"\" **DIN 6334** Hexagon coupling nut.\n\n- \"\" **DIN 7967** Self-locking counter nut.\n\n- \"\" **EN 1661** Hexagon nut with flange.\n\n- \"\" **GOST 11860-1** Cap nut.\n\n- \"\" \n**ISO 4032** Hexagon nut, style 1. *Product grades A and B.*\n\n- \"\" \n**ISO 4033** Hexagon high nut, style 2. *Product grades A and B.*\n\n- \"\" **ISO 4034** Hexagon nut, style 1.\n\n- \"\" \n**ISO 4035** Hexagon thin nut chamfered, style 0. *Product grades A and B.*\n\n- \"\" **ISO 4161** Hexagon nut with flange.\n\n- \"\" **ISO 7040** Prevailing torque type hexagon nut (with non-metallic insert).\n\n- \"\" **ISO 7041** Prevailing torque type hexagon nut (with non-metallic insert), style 2.\n\n- \"\" **ISO 7043** Prevailing torque type hexagon nut with flange (with non-metallic insert).\n\n- \"\" **ISO 7044** Prevailing torque type all-metal hexagon nut with flange.\n\n- \"\" **ISO 7719** Prevailing torque type all-metal hexagon nut.\n\n- \"\" **ISO 7720** Prevailing torque type all-metal hexagon nut, style 2.\n\n- \"\" \n**ISO 8673** Hexagon nut with fine pitch thread, style 1. *Product grades A and B.*\n\n- \"\" \n**ISO 8674** Hexagon high nut with fine pitch thread, style 2. *Product grades A and B.*\n\n- \"\" \n**ISO 8675** Hexagon thin nut with fine pitch thread, style 0. *Product grades A and B.*\n\n- \"\" **ISO 10511** Prevailing torque type hexagon thin nut (with non-metallic insert).\n\n- \"\" **ISO 10512** Prevailing torque type hexagon nut with fine pitch thread (with non-metallic insert).\n\n- \"\" **ISO 10513** Prevailing torque type all-metal hexagon nut with fine pitch thread.\n\n- \"\" **ISO 10663** Hexagon nut with flange and fine pitch thread.\n\n- \"\" **ISO 12125** Prevailing torque type hexagon nut with flange and fine pitch thread (with non-metallic insert).\n\n- \"\" **ISO 12126** Prevailing torque type all-metal hexagon nut with flange and fine pitch thread.\n\n- \"\" **ISO 21670** Hexagon weld nut with flange.\n\n- \"\" **SAE J483a 1** Low cap nut.\n\n- \"\" **SAE J483a 2** High cap nut.\n\n### T-slot fasteners \n\n- \"\" **DIN 508** T-slot nut.\n\n- \"\" **GN 505** Serrated quarter-turn T-slot nut.\n\n- \"\" **GN 505.4** Serrated T-slot bolt.\n\n- \"\" **GN 506** T-Slot swivel nut.\n\n- \"\" **GN 507** T-slot nut.\n\n- \"\" **ISO 299** T-Slot nut.\n\n### Washers\n\n- \"\" **ASME B18.21.1.12A** UN washer, narrow series.\n\n- \"\" **ASME B18.21.1.12B** UN washer, regular series.\n\n- \"\" **ASME B18.21.1.12C** UN washer, wide series.\n\n- \"\" **DIN 6319C** Spherical washer.\n\n- \"\" **DIN 6319D** Conical seat.\n\n- \"\" **DIN 6319G** Conical seat.\n\n- \"\" **DIN 6340** Washer for clamping devices.\n\n- \"\" \n**ISO 7089** Plain washer, normal series. *Product grade A.*\n\n- \"\" \n**ISO 7090** Plain washer chamfered, normal series. *Product grade A.*\n\n- \"\" \n**ISO 7092** Plain washer, small series. *Product grade A.*\n\n- \"\" \n**ISO 7093-1** Plain washer, large series. *Product grade A.*\n\n- \"\" \n**ISO 7094** Plain washer, extra large series. *Product grade C.*\n\n- \"\" **ISO 8738** Plain washer for clevis pins.\n\n- \"\" **NFE27-619** Countersunk washer.\n\n### Rods, taps and dies \n\n- \"\" Inch threaded rod for tapping holes.\n\n- \"\" Tool object for cutting external inch threads.\n\n- \"\" UNC inch threaded rod.\n\n- \"\" DIN 975 metric threaded rod.\n\n- \"\" Metric threaded rod for tapping holes.\n\n- \"\" Tool object for cutting external metric threads.\n\n### Inserts\n\n- \"\" Heat staked insert.\n\n- \"\" Self-clinching nut.\n\n- \"\" Self-clinching standoff.\n\n- \"\" Self-clinching stud.\n\n- \"\" PCB spacer female/female.\n\n- \"\" PCB standoff female/male.\n\n- \"\" 4 prong threaded wood insert (DIN 1624 Tee nuts).\n\n### Retaining rings \n\n- \"\" **DIN 471** External retaining ring.\n\n- \"\" **DIN 472** Internal retaining ring.\n\n- \"\" **DIN 6799** E-clip retaining ring.\n\n### Nails\n\n- \"\" **DIN 1143** Round plain head nail for use in automatic nailing machines.\n\n- \"\" **DIN 1144-A** Nail for the installation of wood wool composite panels, 20mm round head.\n\n- \"\" **DIN 1151-A** Round plain head wire nail.\n\n- \"\" **DIN 1151-B** Round countersunk head wire nail.\n\n- \"\" **DIN 1152** Round lost head wire nail.\n\n- \"\" **DIN 1160-A** Clout or slate nail.\n\n- \"\" **DIN 1160-B** Clout or slate wide head nail.\n\n### Pins\n\n- \"\" **ISO 1234** Split pin.\n\n- \"\" **ISO 2338** Parallel pin.\n\n- \"\" **ISO 2339** Taper pin.\n\n- \"\" **ISO 2340A** Clevis pin.\n\n- \"\" **ISO 2340B** Clevis pin without head (with split pin holes).\n\n- \"\" **ISO 2341A** Clevis pin with head.\n\n- \"\" **ISO 2341B** Clevis pin with head (with split pin hole).\n\n- \"\" **ISO 8733** Parallel pin with internal thread, unhardened.\n\n- \"\" **ISO 8734** Dowel pin.\n\n- \"\" **ISO 8735** Parallel pin with internal thread, hardened.\n\n- \"\" **ISO 8736** Taper pin with internal thread, unhardened.\n\n- \"\" **ISO 8737** Taper pin with external thread, unhardened.\n\n- \"\" **ISO 8739** Full-length grooved pin with pilot.\n\n- \"\" **ISO 8740** Full-length grooved pin with chamfer.\n\n- \"\" **ISO 8741** Half-length reverse taper grooved pin.\n\n- \"\" **ISO 8742** Third-length center grooved pin.\n\n- \"\" **ISO 8743** Half-length center grooved pin.\n\n- \"\" **ISO 8744** Full-length taper grooved pin.\n\n- \"\" **ISO 8745** Half-length taper grooved pin.\n\n- \"\" **ISO 8746** Grooved pin with round head.\n\n- \"\" **ISO 8747** Grooved pin with countersunk head.\n\n- \"\" **ISO 8748** Coiled spring pin, heavy duty.\n\n- \"\" **ISO 8750** Coiled spring pin, standard duty.\n\n- \"\" **ISO 8751** Coiled spring pin, light duty.\n\n- \"\" **ISO 8752** Slotted spring pin, heavy duty.\n\n- \"\" **ISO 13337** Slotted spring pin, light duty.\n\n## Obsolete\n\n- \"\" [Make countersunk](Fasteners_ChamferHole.md): Chamfer holes for countersunk screws. Not available in (v0.5.13) .\n\n## References\n\n- Author: [shaise](http://theseger.com/projects/author/shaise/)\n - ScrewMaker: Ulrich Brammer\n - Workbench wrapper: Shai Seger\n- Source code: \n- Bug reports and feature requests: \n- Forum topic: \n\n## Links\n\n- [BOLTS](https://github.com/jreinhardt/BOLTS): An open library for technical specifications.\n\n {{Fasteners_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [User_Documentation](Category_User_Documentation.md) > [External_Workbenches](Category_External_Workbenches.md) > [Fasteners](Category_Fasteners.md) > Fasteners Workbench\n"} {"id": "freecad-docs:wiki/Flamingo.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Flamingo.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Flamingo.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "33adae79db5758d76fadc3643d95d25eb8129acc14d69698bdeff7935a3b7702", "bytes": 126, "tokens": 58, "text": "# Flamingo\n1. REDIRECT [Flamingo Workbench](Flamingo_Workbench.md)\n\n\n---\n⏵ [documentation index](../README.md) > Flamingo\n"} {"id": "freecad-docs:wiki/FreeCAD_Docker_CLI_mode.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/FreeCAD_Docker_CLI_mode.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/FreeCAD_Docker_CLI_mode.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b37e1cd9b8508b5a69c1d2f76651de96ad75befc0a93a1dbcc5d6b111f9228cf", "bytes": 1960, "tokens": 684, "text": "# FreeCAD Docker CLI mode\n## Overview\n\nDocker image of FreeCAD compiled without GUI. This Docker image is especially for developers who only want to use FreeCAD in the command-line interface (CLI).\n\n### Benefits\n\nAll of FreeCAD\\'s dependencies are already installed, compatible with each other, and configured appropriately, allowing you to get started developing very quickly.\n\n- Easy to use and lightweight.\n- It gives better performance in terms of speed.\n- No need to add FreeCAD paths to import it into Python.\n\n## Docker Repository \n\n- Docker Hub: \n- Github repository: \n\n## Prerequisites\n\n- 3 GB of free storage\n- Docker\n\n## Installation\n\n1. Pull the Docker image.{{Code|lang=bash|code=\n docker pull amrit3701/freecad-cli:latest\n }}\n\n\n1. When you successfully pulled Docker image, now you can run image.{{Code|lang=bash|code=\n docker run -it amrit3701/freecad-cli:lastest bash\n }}\n\n\n## Additional information \n\n### Extend Docker image \n\nYou can also extend this Docker images to add additional dependencies for your project. For eg {{Code|lang=docker|code=\n\n# Dockerfile\n\nFROM amrit3701/freecad-cli:lastest\n\n# Add additional dependencies\n\n# pip3.8 install \n}}\n\n### Import FreeCAD in Python \n\nAfter running Docker image, just run \n\n\n{{Code|lang=bash|code=\n$ docker run -it amrit3701/freecad-cli:lastest bash\nroot@f0ec904cf9b9:/# python3.8\nPython 3.8.5 (default, Jul 20 2020, 19:48:14)\n[GCC 7.5.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import FreeCAD\n>>> import Part\n>>> import Draft\n>>> import Arch\n}}\n\n\n### Launch FreeCADCmd \n\nTo launch FreeCAD inside Docker image, just run FreeCADCmd command.\n\n## Discussion\n\nFreeCAD forum thread: \n\n\n---\n⏵ [documentation index](../README.md) > FreeCAD Docker CLI mode\n"} {"id": "freecad-docs:wiki/GitHub.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/GitHub.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/GitHub.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0c870e1bd7c022e1f86f9e7658afb28ed7dcbedc9b3c0024b993f8b14defed6a", "bytes": 130, "tokens": 51, "text": "# GitHub\n1. REDIRECT [Source_code_management](Source_code_management.md)\n\n\n---\n⏵ [documentation index](../README.md) > GitHub\n"} {"id": "freecad-docs:wiki/How_to_install_macros.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/How_to_install_macros.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/How_to_install_macros.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "bf001c65264a2cf73ff94e4efb6781058a7d0d81a2fe01d7f92c5a70577805f3", "bytes": 19930, "tokens": 6650, "text": "---\n TutorialInfo:\n Topic: Programming\n Level: Medium programmer\n Time: 15 minutes\n FCVersion: All\n Author: User:Mario52\n---\n\n# How to install macros\n\n \n\n\n## Description\n\nSince v0.17 it is easy to add macros by using the [Addon Manager](Std_AddonMgr.md). A regular user doesn\\'t need to do more than use this tool. Keep reading for more information regarding installation of [macros](macros.md).\n\nMacros are sequences of commands which are used to perform a complex drawing operation. Macros are [Python](Python.md) scripts, which means they are text files that can be written and edited with a text editor.\n\nWhile Python scripts normally have the `.py` extension, FreeCAD macros should have the `.FCMacro` extension. A collection of macros written by experienced users is found in the [macros recipes](macros_recipes.md) page.\n\nSee [Introduction to Python](Introduction_to_Python.md) to learn about the Python programming language, and then [Python scripting tutorial](Python_scripting_tutorial.md) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md) to learn about writing macros.\n\nHere is a video on [installing FreeCAD macros in Ubuntu](https://wiki.opensourceecology.org/wiki/Installing_Macros_in_FreeCAD).\n\n## The Macro menu and toolbar \n\n### Toolbar\n\n- \"\" [Macro recording\\...](Std_DlgMacroRecord.md)\n- \"\" [Stop macro recording](Std_MacroStopRecord.md)\n- \"\" [Macros\\...](Std_DlgMacroExecute.md)\n- \"\" [Execute macro](Std_DlgMacroExecuteDirect.md)\n\n### Menu\n\nBesides the tools in the toolbar, the following functions are also available in the **Macro** menu.\n\n- [Attach to remote debugger](Std_MacroAttachDebugger.md)\n- \"\" [Debug macro](Std_MacroStartDebug.md)\n- \"\" [Stop debugging](Std_MacroStopDebug.md)\n- [Step over](Std_MacroStepOver.md)\n- [Step into](Std_MacroStepInto.md)\n- [Toggle breakpoint](Std_ToggleBreakpoint.md)\n\n## Macros directory \n\n\n
\n\n\nMacros are created in a specific folder under the user\\'s FreeCAD directory. This directory can be configured in the [Execute macro dialog](Std_DlgMacroExecute.md), or in the [Preferences Editor](Preferences_Editor.md), through the menu **Edit → Preferences → Python → Macro → Macro recording settings**.\n\nDownloaded macros should also be placed in this directory.\n\n\n
\n\n\n### Default directory \n\nMacros can be simply copied into\n\n \n```python\n$ROOT_DIR/\n```\n\nwhere `$ROOT_DIR` is a top level directory searched by FreeCAD on startup.\n\nThe `$ROOT_DIR` could be a system wide directory, in which case the macro is installed for all users.\n\n- On Linux it is usually `/usr/share/freecad/`\n- On Windows it is usually `C:\\Program Files\\FreeCAD\\`\n- On Mac OSX it is usually `/Applications/FreeCAD/`\n\nThe `$ROOT_DIR` could be a particular user\\'s directory.\n\n- On Linux it is usually `/home/username/.local/share/FreeCAD/` ((v0.20) ) or `/home/username/.FreeCAD/` ({{VersionMinus|0.19}}).\n- On Windows it is usually `C:\\Users\\username\\AppData\\FreeCAD\\`\n- On Mac OSX it is usually `/Users/username/Library/Preferences/FreeCAD/`\n\n### Configuring the user directory \n\n1\\. Open the menu **Macro → [Macros...](Std_DlgMacroExecute.md)** to open the [Execute macro dialog](Std_DlgMacroExecute.md).\n\n![](images/Dxf_Importer_Install_01.png ) \n*align=center|Opening the Execute macro dialog*\n\n2\\. Set the appropriate `User macros location`.\n\n- Linux: usually `/home/username/.local/share/FreeCAD/` ((v0.20) ) or `/home/username/.FreeCAD/` ({{VersionMinus|0.19}})\n- Windows: usually `C:\\Users\\username\\AppData\\Roaming\\FreeCAD\\`\n- MacOS: usually `/Users/username/Library/Preferences/FreeCAD/`\n\n![](images/Dxf_Importer_Install_02.png ) \n*align=center|Setting of the macros directory*\n\n3\\. Navigate to that directory in your computer.\n\n- Linux: paste the address into your file manager, \\\"Nautilus\\\" or other. You may have to press **Ctrl**+**H** to make the hidden directory `.FreeCAD/` visible.\n- Windows: paste the address into your \\\"File explorer\\\" and confirm.\n- MacOS: locate the folder in the \\\"Finder\\\" or paste the address into a \\\"File explorer\\\"; remember the `file:///` prefix in the \\\"File explorer\\\" for a file on disk.\n\n![](images/Dxf_Importer_Install_03.png ) \n*align=center|Accessing the macros directory in the operating system*\n\n4\\. Add macro files to this directory.\n\n- Linux: leave the file manager open, and bookmark the location for faster access.\n- Windows: leave open the file explorer.\n- MacOS: either leave a \\\"Finder\\\" window open, or bookmark the location in your \\\"File explorer\\\", or set up an \\\"Alias\\\" to point to it, or drag the folder into the \\\"SideBar\\\" of the \\\"Finder\\\" so it is there to use from other programs such as text editors.\n\n![](images/Dxf_Importer_Install_04.png ) \n*align=center|Macros directory*\n\n \n\n\n
\n\n\n
\n\n\n## Installing macros \n\n\n
\n\n\n### Automatic method \n\nStarting with FreeCAD 0.17, use the [Addon Manager](Std_AddonMgr.md) in **Tools → Addon manager** to install a macro that has been included in the [FreeCAD-macros](https://github.com/FreeCAD/FreeCAD-macros) repository.\n\n\n
\n\n\nIn past versions of FreeCAD you could use two automated ways to install macros and other addons:\n\n- [addons_installer.FCMacro](https://github.com/FreeCAD/FreeCAD-addons): itself a macro, this was the precursor to the Addon Manager, and is hosted in the [FreeCAD-addons](https://github.com/FreeCAD/FreeCAD-addons) repository. You don\\'t need to use this tool in new installations of FreeCAD.\n- [freecad-pluginloader](https://github.com/microelly2/freecad-pluginloader): also a macro, it could be used to install new components to FreeCAD. It is no longer developed.\n\nThe recommended way to install addons, that is, [external workbenches](external_workbenches.md) and macros, is the [Addon Manager](Std_AddonMgr.md). However, you can still add macros to your system with the manual methods described in the following sections; this is useful if you are developing and testing your own code.\n\n\n
\n\n\n
\n\n\n
\n\n\n### Manual method 1. Copy the code to the macro editor \n\nFor macros that are relatively small, 300 lines or less, the code can be copied and pasted directly into the FreeCAD macro editor.\n\n\n
\n\n\nWe will use \"\" [Macro Apothem Based Prism GUI](Macro_Apothem_Based_Prism_GUI.md) as an example.\n\n1\\. Go to the macro wiki page, which should be listed in [Macros recipes](Macros_recipes.md).\n\nIf there is a custom icon download it; click on it with the right mouse button and select `Save image as...`; place the icon in the macros directory. This icon can be used as a shortcut for the macro in a [custom toolbar](Customize_Toolbars.md). The default icon is \"\".\n\n![](images/Macro_Install_HowTo_28.png ) \n*align=center|Downloading the icon from the macro page*\n\n2\\. In the macro page, select the code inside the **Script** or **Macro** sections, and copy it.\n\n3\\. In FreeCAD, open the menu **Macro → [Macros...](Std_DlgMacroExecute.md)** to open the [Execute macro dialog](Std_DlgMacroExecute.md).\n\n![](images/Dxf_Importer_Install_01.png ) \n*align=center|Opening the Execute macro dialog*\n\n4\\. Click **Create**.\n\n![](images/Macro_Install_HowTo_17.png ) \n*align=center|Creating a new macro*\n\n5\\. Enter the macro name, here `Macro_Apothem_Based_Prism_GUI`, and press **OK**.\n\n![](images/Macro_Install_HowTo_18.png ) \n*align=center|Entering the macro name*\n\n6\\. The macro editor opens, showing the full path of the new macro.\n\n![](images/Macro_Install_HowTo_19.png ) \n*align=center|The macro editor*\n\n7\\. Paste the code in the editor window, and then click the cross on the tab to close the window.\n\n![](images/Macro_Install_HowTo_20.png ) \n*align=center|Closing the macro editor*\n\n8\\. A window appears asking for confirmation to save the code; click on **Yes**. You can also use **Ctrl**+**S** to save the file.\n\nRestart FreeCAD to correctly register the new macro.\n\n![](images/Macro_Install_HowTo_27.png ) \n*align=center|Asking for confirmation to save the code*\n\n9\\. Open the menu again, **Macro → [Macros...](Std_DlgMacroExecute.md)**, select the new macro and press **Execute**.\n\n![](images/Macro_Install_HowTo_21.png ) \n*align=center|Selecting the macro to run it*\n\n10\\. The macro now runs. Fill in the fields with your values and click the **OK** button.\n\n![](images/Macro_Install_HowTo_22.png ) \n*align=center|The macro in action; fill in the information and press OK when ready*\n\n11\\. This macro should return an error if no document is active; other macros open a new document if none exists.\n\nCreate a new document with **File → [New](Std_New.md)**, and then repeat the previous steps to execute the macro.\n\n![](images/Macro_Install_HowTo_23.png) \n*align=center|The macro returning an error if no document is active*\n\n12\\. Once an active document is available, the macro runs and creates an object.\n\n![](images/Macro_Install_HowTo_24.png ) \n*align=center|Object created by the macro*\n\n13\\. You can open the macro in the editor again to run it or modify it. Go to **Macro → [Macros...](Std_DlgMacroExecute.md)**, select the macro and press **Edit**.\n\n![](images/Macro_Install_HowTo_25.png ) \n*align=center|Opening the macro in the editor*\n\n14\\. The macro can now be run with **Macro → [Execute macro](Std_DlgMacroExecuteDirect.md)**, or by clicking on the ** [Std DlgMacroExecuteDirect](Std_DlgMacroExecuteDirect.md)** button in the toolbar.\n\n![](images/Macro_Install_HowTo_26.png ) \n\n\n
\n\n\n
\n\n\n
\n\n\n### Manual method 2. Add a macro file from a compressed .zip file \n\nSome macros are too big that it\\'s inconvenient to copy and paste them into the macro editor, or they cannot be hosted in the wiki. In this case, the code may be hosted somewhere else, in a Github repository, or in the [FreeCAD forum](https://forum.freecadweb.org/). The code may also be compressed into a `.zip` file, tarball `.tar.xz`, or other type of archive if it contains several files. If the code is distributed in this way, the archive should be extracted and the files placed in the macros directory.\n\n\n
\n\n\nWe will use \"\" [Macro screw maker](Macro_screw_maker1_2.md) as an example.\n\n1\\. Download the compressed code from the forum, [Screw Maker](http://forum.freecadweb.org/viewtopic.php?f=22&t=6558#p52887).\n\nYou need to use a decompressor to get the internal files.\n\n- For Windows you can use an application like [7-zip](http://www.7-zip.org/) or [L-Zarc](http://www.kanmandet.dk/?p=37) or [quickzip](http://www.quickzip.org/quickzip51.html).\n- For Linux you can use a command from the terminal\n\n \n```python\nunzip your_file.zip -d your_directory\n```\n\n2\\. Download the compressed archive with the macro code to a local folder.\n\n![](images/Macro_Install_HowTo_01.png ) \n*align=center|Downloading the compressed archive to a local directory*\n\n3\\. Decompress the file in the folder.\n\n![](images/Macro_Install_HowTo_02.png ) \n*align=center|Decompressing the file in the folder*\n\n4\\. The decompressor creates a new directory with the unpacked files.\n\n![](images/Macro_Install_HowTo_03.png ) \n*align=center|New directory created after unpacking the archive*\n\n5\\. Go inside the new directory, and copy or cut the macro file.\n\n![](images/Macro_Install_HowTo_04.png ) \n*align=center|Entering the newly created directory with the decompressed macro file*\n\n6\\. Go to the macro directory and paste the file there.\n\n![](images/Macro_Install_HowTo_05.png ) \n*align=center|Placing the macro file in the macro directory*\n\n7\\. In FreeCAD, open the menu **Macro → [Macros...](Std_DlgMacroExecute.md)** to open the [Execute macro dialog](Std_DlgMacroExecute.md).\n\n![](images/Macro_Install_HowTo_06.png ) \n*align=center|Opening the Execute macro dialog*\n\n8\\. Select the new macro and press **Execute**.\n\n![](images/Macro_Install_HowTo_07.png ) \n*align=center|Selecting the macro to run it*\n\n9\\. The macro now runs. Select the desired options, and click the **Create** button.\n\n\"\" \n*align=center|The macro in action; select the desired options, and press Create when ready*\n\n![](images/Macro_Install_HowTo_30.png ) \n*align=center|Object created by the macro*\n\n\n
\n\n\n
\n\n\n## Execute a macro in command line \n\n\n
\n\n\nCommand line execute a macro (.FCMacro or .py)\n\n\n
\n\n\non Windows\n\n \n```python\n\"C:\\Program Files\\FreeCAD\\bin\\FreeCAD.exe\" \"C:\\Users\\userName\\AppData\\Roaming\\FreeCAD\\Mod\\WorkFeature\\start_WF.FCMacro\"\n```\n\non Linux\n\n \n```python\ntodo\n```\n\n\n
\n\n\n
\n\n\n## Errors in macros \n\n\n
\n\n### Indentation errors \n\nThe white space at the beginning of the lines (indentation) in the [Python](Python.md) programming language is very important, and an integral part of the code. An inappropriate space may cause the code to not run or present errors.\n\nThis section describes some errors that may be encountered when copying and pasting, and writing macro code.\n\n\n
\n\nA typical indentation error looks like this:\n\n \n```python\n: ('expected an indented block', ('C:/Users/d/AppData/Roaming/FreeCAD/Macro_Apothem_Based_Prism_GUI.FCMacro', 21, 3, 'def priSm(self):\\n'))\n```\n\n#### Example 1 \n\nIf the code lacks any indentation, the code won\\'t work. Class (`class`) and function definitions (`def()`), as well as control structures (`if`, `while`, `for`) should be followed by a block of indented code.\n\nThis error is possible if the user doesn\\'t copy the code correctly, and all spaces are accidentally removed.\n\n![](images/Macro_Install_HowTo_09.png ) \n*align=center|Python code that lacks any indentation; it will cause an error when it's run*\n\nIndentation problem fixed.\n\n![](images/Macro_Install_HowTo_10.png ) \n*align=center|Python code with the correct indentation*\n\nIf the code is selected, all lines should be highlighted all the way to the left edge, indicating that the lines are aligned.\n\n![](images/Macro_Install_HowTo_11.png ) \n*align=center|Python code highlighted, showing that all lines start at the left edge*\n\n#### Example 2 \n\nIf an additional space is introduced at the beginning of all lines, the Python interpreter will fail and complain about unnecessary indentation. In this case, all lines need the initial space removed.\n\n![](images/Macro_Install_HowTo_12.png ) \n*align=center|Python code with additional space on each line*\n\n#### Example 3 \n\nHere the code has been copied from a forum thread by using the **Select all** button. Apparently the selection is good.\n\n![](images/Macro_Install_HowTo_14.png ) \n*align=center|Python code copied from a forum*\n\nHowever, when the selection is pasted into the macro editor, undesirable indentation seems to appear.\n\n![](images/Macro_Install_HowTo_15.png ) \n*align=center|Python code copied from a forum into the macro editor; unnecessary indentation is added*\n\nIn this case, the initial spaces need to be removed. This can be done with a specialized text editor to quickly decrease the indentation of the lines.\n\nIn Windows, [Notepad++](http://notepad-plus-plus.org/) can perform selection with **Alt** + Mouse dragging, and then use **Edit → Indent → Decrease the indentation**.\n\n![](images/Macro_Install_HowTo_16.png ) \n*align=center|Python code with the correct indentation*\n\n#### Example 4 \n\nHere the selection also selects the line numbers in the code example. If this selection is pasted into the macro editor, it won\\'t work. All line numbers need to be removed, and the spaces adjusted so that the Python code has the proper indentation.\n\n![](images/Macro_Install_HowTo_29.png ) \n*align=center|Selection that also selects the line numbers; if this code is pasted into the macro editor, it won't work*\n\n#### Good code \n\n![](images/Macro_Install_HowTo_13.png ) \n*align=center|Python code with the correct indentation*\n\n\n
\n\n\n
\n\n\n
\n\n\n### No text output from macros \n\nMacros may output information to the report view to detail what the code is doing when it is running.\n\nIf no information is displayed, make sure the report view and [Python](Python.md) console are visible, and that the output is directed tot he report view.\n\n\n
\n\n\n#### Printing information \n\nFreeCAD macros have two methods to print information to the report view.\n\nThe FreeCAD functions \n\n\n```python\nFreeCAD.Console.PrintMessage(\"Hello World! \\n\")\nFreeCAD.Console.PrintError(\"Hello World! \\n\")\nFreeCAD.Console.PrintWarning(\"Hello World! \\n\")\n```\n\n\nThe simple Python function \n\n\n```python\nprint(\"Hello World!\")\n```\n\n\n#### Enabling the report view \n\nTo see the information displayed in the console you should:\n\n1\\. Go to the menu **View → Panels**.\n\n![](images/Macro_Install_HowTo_31.png )\n\n![](images/Macro_Install_HowTo_32.png ) \n*align=center|Making the panels visible in the menu View → Panels*\n\n2\\. Enable the `Report view` and the `Python console`.\n\n![](images/Macro_Install_HowTo_33.png ) \n*align=center|Enabling the report view and the Python console*\n\n3\\. The panels are now visible, and commands like `FreeCAD.Console.PrintMessage()` now print information that appears in the `Report view`.\n\n![](images/Macro_Install_HowTo_34.png ) \n*align=center|FreeCAD main window with the Report view and the Python console*\n\n#### Enabling the print() command \n\nFreeCAD may need to be configured so the `print()` function of [Python](Python.md) redirects its output correctly to the report view.\n\n1\\. Go into the [Preferences Editor](Preferences_Editor.md) with the menu **Edit → Preferences**.\n\n![](images/Macro_Install_HowTo_35.png ) \n*align=center|Going into the preferences editor*\n\n2\\. Go to **Python** section, and then **Output window → Python interpreter**.\n\n![](images/Macro_Install_HowTo_36.png ) \n*align=center|Output window preferences*\n\n3\\. Check both boxes:\n\n- \"\" Redirect internal Python output to report view\n\n- \"\" Redirect internal Python errors to report view\n\nand then press the **OK** button.\n\n![](images/Macro_Install_HowTo_37.png ) \n*align=center|Redirecting the Python output to the report view*\n\n![](images/Macro_Install_HowTo_38.png ) \n\n\n
\n\n\n
\n\n\n---\n⏵ [documentation index](../README.md) > [Developer Documentation](Category_Developer%20Documentation.md) > [Python Code](Category_Python%20Code.md) > How to install macros\n"} {"id": "freecad-docs:wiki/Ifcopenshell.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Ifcopenshell.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Ifcopenshell.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "cd8ea4e33164afc04a2bc95d4d375fd4653c3d52c5b8b55f6237665abe1d9c2e", "bytes": 122, "tokens": 53, "text": "# Ifcopenshell\n1. REDIRECT [IfcOpenShell](IfcOpenShell.md)\n\n\n---\n⏵ [documentation index](../README.md) > Ifcopenshell\n"} {"id": "freecad-docs:wiki/Image_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Image_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Image_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c3ad7981fb456d1fe50d3ec04f40b7f786e92667ded988923da7b9de0aceaf22", "bytes": 2071, "tokens": 665, "text": "# Image Workbench\n**The '''Image Workbench''' is no longer included after version 0.20.
\nIts functionality has been integrated in [Std Base](Std_Base.md). See [Std Import](Std_Import.md) and [Std ViewLoadImage](Std_ViewLoadImage.md).**\n\n\"Image\n\n \n\n## Introduction\n\nThe \"\" [Image Workbench](Image_Workbench.md) manages different types of [bitmap](bitmap.md) images, and allows you to open them in FreeCAD.\n\n## Tools\n\n- \"\" [Open\\...](Image_Open.md): open an image on a new viewport.\n- \"\" [Create image plane\\...](Image_CreateImagePlane.md): import an image to a plane in the 3D view.\n- \"\" [Scale image plane](Image_Scaling.md): scale an image imported to a plane.\n\n## Features\n\n- Like a [Sketch](Sketcher_Workbench.md), an imported image can be attached to one of the main planes XY, XZ, or YZ, and given a positive or negative offset.\n- The image is imported with relation of 1 pixel to 1 millimeter.\n- The recommendation is to have the imported image at a reasonable resolution.\n\n## Workflow\n\nA major use of this workbench is tracing over the image, with the [Draft](Draft_Workbench.md) or [Sketcher](Sketcher_Workbench.md) tools, in order to generate a solid body based on the contours of the image.\n\nTracing over an image works best if the image has a small negative offset, for example, -0.1 mm, from the working plane. This means that the image will be slightly behind the plane where you draw your 2D geometry, so you won\\'t draw on the image itself.\n\nThe offset of the image can be set during import, or changed later through its properties.\n\n\n {{Image Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Obsolete Workbenches](Category_Obsolete%20Workbenches.md) > [Image](Category_Image.md) > Image Workbench\n"} {"id": "freecad-docs:wiki/Important_information.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Important_information.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Important_information.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "9250252273026aa91feda0aa22376ece91d981e2ae6152bb8f5d54c24b15bb32", "bytes": 1150, "tokens": 346, "text": "# Important information\n## Overview\n\n[Important information](Important_information.md) helps troubleshoot problems in your installation and usage of the program.\n\nThe [FreeCAD forum](https://forum.freecadweb.org/viewforum.php?f=3) is the best place to get help from expert users and developers. For other ways see [Help](Help.md).\n\n## Directions\n\n\n**Before asking for help, you need to follow these links or click the images/captions below**\n\n- [IMPORTANT: Please read first before asking for help](https://forum.freecadweb.org/viewtopic.php?f=3&t=2264) in the forum.\n- [Std About](Std_About.md) command in the software itself.\n\n ![](images/Important_information-updated.png ) \n*align=center|The request for important information is located at the top of every subforum. Click the image above to follow link.*\n\n![](images/Std_About_example.png )\n\n\n*align=center|Window with the \"[About](Std_About.md)\" information in the software. Do not take a picture of this window;
Click the **Copy to clipboard* button to be able to paste the information with your help request.**\n\n\n---\n⏵ [documentation index](../README.md) > Important information\n"} {"id": "freecad-docs:wiki/Macro_3D_Parametric_Curve.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_3D_Parametric_Curve.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_3D_Parametric_Curve.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "999b4eb7d8c0f51c1b0d7a712bf92ff99a680d43191143d892343bf6381be8ae", "bytes": 7394, "tokens": 2746, "text": "# Macro 3D Parametric Curve\n{{Macro\n|Name=Macro 3D Parametric Curve\n|Icon=Macro_3D_Parametric_Curve.png\n|Description=Draw a function described by parametric equations x(t), y(t) and z(t) with the possibility to choose between B-spline and polyline for the type of line between points.\n|Author=Lucio Gomez (psicofil)\n|Version=2.0\n|Date=2015-03-06\n|FCVersion=All\n|Download=[https://wiki.freecad.org/images/f/f5/Macro_3D_Parametric_Curve.png ToolBar Icon]\n|SeeAlso=[Macro Parametric Curve FP](Macro_Parametric_Curve_FP.md)\n}}\n\n## Description\n\nThis macro creates a curve described by parametric equations x(t), y(t) and z(t), with the possibility to choose between B-spline and polyline for the type of line between points.\n\n\"\" \n*Example Epicycloid curve‎*\n\n## Original Script \n\nYou can find the updated code (13/05/2015) on the following Github repository: [Get the code here!](https://github.com/psicofil/Macros_FreeCAD/blob/master/Macros/ParametricCurve.FCMacro)\n\n## Modified Script \n\n\"Example\n\nToolBar Icon ![](images/Macro_3D_Parametric_Curve.png )\n\n\n**Macro 3D Parametric Curve.FCMacro**\n\n\n{{MacroCode|code=\n\n# -*- coding: utf-8 -*-\n# Create a 3D parametric Curve.\n# Author: Gomez Lucio\n# Modified by Laurent Despeyroux on 9th feb 2015\n# - 3 helping variables added a, b and c\n# - enlarged GUI\n# - more flexible GUI\n# - basic error mangement\n \nimport FreeCAD\nfrom PySide import QtGui,QtCore\nimport Part\nimport Draft\nfrom math import *\n \nclass ParamCurv(QtGui.QWidget):\n def __init__(self):\n super(ParamCurv, self).__init__()\n self.initUI()\n def initUI(self):\n self.t0 = QtGui.QLabel(\"Equation :\",self)\n self.ta = QtGui.QLabel(\" a(t) \",self)\n self.la = QtGui.QLineEdit(self)\n self.la.setText(\"37\")\n self.tb = QtGui.QLabel(\" b(a,t) \",self)\n self.lb = QtGui.QLineEdit(self)\n self.lb.setText(\"1\")\n self.tc = QtGui.QLabel(\" c(a,b,t) \",self)\n self.lc = QtGui.QLineEdit(self)\n self.lc.setText(\"(a+cos(a*t)*2)*b\")\n self.t1 = QtGui.QLabel(\" X(a,b,c,t) \",self)\n self.l1 = QtGui.QLineEdit(self)\n self.l1.setText(\"cos(t)*c\")\n self.t2 = QtGui.QLabel(\" Y(a,b,c,t) \",self)\n self.l2 = QtGui.QLineEdit(self)\n self.l2.setText(\"sin(t)*c\")\n self.t3 = QtGui.QLabel(\" Z(a,b,c,t) \",self)\n self.l3 = QtGui.QLineEdit(self)\n self.l3.setText(\"0\")\n self.t31 = QtGui.QLabel(\"Parameters :\",self)\n self.t4 = QtGui.QLabel(\" Min t \",self)\n self.l4 = QtGui.QLineEdit(self)\n self.l4.setText(\"0\")\n self.t5 = QtGui.QLabel(\" Max t \",self)\n self.l5 = QtGui.QLineEdit(self)\n self.l5.setText(\"6.283185\")\n self.t6 = QtGui.QLabel(\" Interval \",self)\n self.l6 = QtGui.QLineEdit(self)\n self.l6.setText(\"0.01\")\n self.t7 = QtGui.QLabel(\"Type of Line :\",self)\n self.op1 = QtGui.QCheckBox(\" Polyline\",self)\n self.poly = False\n self.op1.stateChanged.connect(self.polyState)\n self.op1.setCheckState(QtCore.Qt.Checked)\n self.op2 = QtGui.QCheckBox(\" Bspline\",self)\n self.bsline = False\n self.op2.stateChanged.connect(self.bsplineState)\n self.t8 = QtGui.QLabel(\" Closed Curve\",self)\n self.op3 = QtGui.QCheckBox(\"\",self)\n self.cclose = False\n self.op3.stateChanged.connect(self.ccloseState)\n self.createbutt = QtGui.QPushButton(\"Create Curve\",self)\n self.exitbutt = QtGui.QPushButton(\"Close\",self)\n layout = QtGui.QGridLayout()\n self.resize(420, 380)\n self.setWindowTitle(\"Parametric Curve \")\n i = 0\n layout.addWidget(self.t0, i, 0)\n i = i+1\n layout.addWidget(self.ta, i, 0)\n layout.addWidget(self.la, i, 1)\n i = i+1\n layout.addWidget(self.tb, i, 0)\n layout.addWidget(self.lb, i, 1)\n i = i+1\n layout.addWidget(self.tc, i, 0)\n layout.addWidget(self.lc, i, 1)\n i = i+1\n layout.addWidget(self.t1, i, 0)\n layout.addWidget(self.l1, i, 1)\n i = i+1\n layout.addWidget(self.t2, i, 0)\n layout.addWidget(self.l2, i, 1)\n i = i+1\n layout.addWidget(self.t3, i, 0)\n layout.addWidget(self.l3, i, 1)\n i = i+1\n layout.addWidget(self.t31, i, 0)\n i = i+1\n layout.addWidget(self.t4, i, 0)\n layout.addWidget(self.l4, i, 1)\n i = i+1\n layout.addWidget(self.t5, i, 0)\n layout.addWidget(self.l5, i, 1)\n i = i+1\n layout.addWidget(self.t6, i, 0)\n layout.addWidget(self.l6, i, 1)\n i = i+1\n layout.addWidget(self.t8, i, 0)\n layout.addWidget(self.op3, i, 1)\n i = i+1\n layout.addWidget(self.t7, i, 0)\n i = i+1\n layout.addWidget(self.op1, i, 0)\n layout.addWidget(self.op2, i, 1)\n i = i+1\n layout.addWidget(self.createbutt, i, 0)\n layout.addWidget(self.exitbutt, i, 1)\n self.setLayout(layout)\n self.show()\n QtCore.QObject.connect(self.createbutt, QtCore.SIGNAL(\"pressed()\"),self.draw)\n QtCore.QObject.connect(self.exitbutt, QtCore.SIGNAL(\"pressed()\"),self.close)\n def ccloseState(self, state):\n if state == QtCore.Qt.Checked:\n self.cclose = True\n else:\n self.cclose = False\n def bsplineState(self, state):\n if state == QtCore.Qt.Checked:\n self.bsline = True\n self.op1.setCheckState(QtCore.Qt.Unchecked)\n else:\n self.bsline = False\n def polyState(self, state):\n if state == QtCore.Qt.Checked:\n self.poly = True\n self.op2.setCheckState(QtCore.Qt.Unchecked)\n else:\n self.poly = False\n def draw(self):\n msgBox = QtGui.QMessageBox()\n fa = str(self.la.text())\n fb = str(self.lb.text())\n fc = str(self.lc.text())\n fx = str(self.l1.text())\n fy = str(self.l2.text())\n fz = str(self.l3.text())\n t = float(str(self.l4.text()))\n tf = float(self.l5.text())\n intv = float(str(self.l6.text()))\n d=(tf-t)/intv\n matriz = []\n for i in range(int(d)):\n try:\n value=\"a\"\n a=eval(fa)\n value=\"b\"\n b=eval(fb)\n value=\"c\"\n c=eval(fc)\n value=\"X\"\n fxx=eval(fx)\n value=\"Y\"\n fyy=eval(fy)\n value=\"Z\"\n fzz=eval(fz)\n except ZeroDivisionError:\n msgBox.setText(\"Error division by zero in calculus of \"+value+\"() for t=\"+str(t)+\" !\")\n msgBox.exec_()\n except:\n msgBox.setText(\"Error in the formula of \"+value+\"() !\")\n msgBox.exec_()\n matriz.append(FreeCAD.Vector(fxx,fyy,fzz))\n t+=intv\n curva = Part.makePolygon(matriz)\n if self.bsline == True:\n Draft.makeBSpline(curva,closed=self.cclose,face=False)\n if self.poly == True:\n Draft.makeWire(curva,closed=self.cclose,face=False)\n def close(self):\n self.hide()\n \nParamCurv()\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > Macro 3D Parametric Curve\n"} {"id": "freecad-docs:wiki/Macro_CirclePlus.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_CirclePlus.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_CirclePlus.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "9c25ab982431aa2fced54a38d356ef59133059a148a2ff1e07cacac91b617686", "bytes": 3986, "tokens": 1312, "text": "# Macro CirclePlus\n{{Macro\n|Name=Macro CirclePlus\n|Icon=Macro_CirclePlus.png\n|Description=Creates circle or arc giving radius, diameter, circumference, area, startangle, endangle, arc, anglecenter, cord, arrow, center (point), placemObject on choice (With GUI)\n|Download=[https://www.freecadweb.org/wiki/images/4/4c/Macro_CirclePlus.png ToolBar Icon].\n|Author=mario52\n|FCVersion=All\n|Version=0.4\n|Date=2019/04/07\n}}\n\n## Description\n\nThis macro creates a circle or arc and lets the user, using the following option (via a dialog box), to customize the: *radius, diameter, circumference, area, startangle, endangle, arc, anglecenter, cord, arrow, center (point),* and *placemObject*.\n\nThe circle by default will face the screen (it refers to the function getCameraOrientation to get its orientation). It is possible to change manually change this function to customize the placement of the shape.\n\n### Legend\n\nIn the CirclePlus dialog certain spinboxes will change colors. Green indicates a spinbox that is modified and ready to be run. Orange will indicate the optional spinbox that the user can utilize if deemed necessary. Red indicates a missing or inadequate value. The until the correct values are used.\n\n \n\n## Usage\n\nCopy the code and paste it in the macro directory\n\n![](images/Macro_CirclePlus_00.png )\n\n- **X Y Z** : coordinates of circle if not coordinates the circle is created on point 0,0,0\n- **radius** : radius of cicle\n- **diameter** : diameter of circle\n- ****Reset**** : reset the coordinate value\n- ****Equal**** : copy the X value in Y and Z window\n- **CheckBox :**\n- **Options** : other options for create circle\n- **Point** : if checked the central point is created\n- **Info** : if checked display the information give in the macro\n- **Face** : if checked the face is created on circle\n- **Sector** : if checked the sector is created\n- **Segment** : if checked the segment is created\n- **SpinBox 1.0** : step increment for Radius and Diameter (Default: 1.0 (for modify the value on begin change the value Line 87 **\\\"incrementDS = xx.xx\\\"**))\n- **SpinBox 8.0** : give the height of text in the macro\n\n- ****Quit**** : quit the macro (this button is coloured in red in case error)\n- ****Ok**** : create the circle\n\n ![](images/Macro_CirclePlus_01.png )\n\n- **Options available**\n- **circumference** : circumference of circle\n- **area** : area of circle\n- **startangle** : start angle for arc\n- **endangle** : end angle for arc\n- **arc** and **anglecenter** : arc in combination with anglecenter\n - **arc** = length of arc\n - **anglecenter** = angle of center circle to extremities of arc\n- **cord** and **arrow** : cord in combination with arrow of circle\n - **cord** : length of cord of circle\n - **arrow** : length of arrow of circle\n\n \n\n## Script\n\nDownload image positioning on the icon \"\" and then drag the mouse right click \\\"save as\\\" (do not change the name)\n{{CodeDownload|https://gist.github.com/mario52a/0ed8129bacbe9124a41e3ae1d378d5b7|Last version Macro_CirclePlus
and the icons at the end of the page}}\n\n## Memo of circle \n\n**Examples codes**\n\n\"examples \"examples\" \n\n## Version\n\nver 04 , 07-04-2019 : replace setStyleSheet DoubleSpinBox by setStyleSheet Label cause: the increment in the Dspinbox does not work ??!\n\nver 03 , 06-04-2019 : supp all \\\"(QtGui.QApplication.translate(\\\"MainWindow\\\", \\\"Diameter\\\", None, QtGui.QApplication.UnicodeUTF8))\\\" give error in 0.18.16093 (Git) Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce Python version: 3.6.6 Qt version: 5.6.2\n\nver 0.2 , 05-04-2019 : add increment the step from 1.0 to 0.1 (DoubleSpinbox)\n\nver 0.1 , 2018-07-14 : add create segment\n\nver 0.0 , 2018-07-10 :\n\n\n---\n⏵ [documentation index](../README.md) > Macro CirclePlus\n"} {"id": "freecad-docs:wiki/Macro_Ellipse-Center+2Points.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Ellipse-Center+2Points.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Ellipse-Center+2Points.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b4bf0dc19aa8462dc42e1fb8df1d16c6c465a1b26dd0c87931606e59ec17d63b", "bytes": 2574, "tokens": 960, "text": "# Macro Ellipse-Center+2Points\n{{Macro\n|Name=Macro Ellipse-Center+2Points\n|Icon=Macro_Ellipse-Center%2B2Points.png\n|Description=Makes an ellipse by selecting three points (in this order): centre, major radius and minor radius\n|Author=Eriossoltero\n|Version=02.00\n|Date=2019-07-29\n|FCVersion=All\n|Download=[https://www.freecadweb.org/wiki/images/6/66/Macro_Ellipse-Center%2B2Points.png ToolBar Icon]\n}}\n\n## Description\n\nMakes an ellipse by selecting three points (in this order): centre, major radius and minor radius\n\n![](images/EllipseCenter2Point.png )\n\n## Latest\n\nThe latest version of the macro is to be found at [EllipseCenter2Points.FCMacro](https://github.com/FreeCAD/FreeCAD-macros/blob/master/ObjectCreation/EllipseCenter2Points.FCMacro) but the easiest way to install this macro is through the [Addon Manager](Std_AddonMgr.md).\n\n## Script\n\n\nToolBar Icon ![](images/Macro_Ellipse-Center%2B2Points.png )\n\n**Macro_EllipseCenter2Points.FCMacro**\n\n\n{{MacroCode|code=\n\n\n# Macro Begin: Ellipse-Center+2Points.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++\n# http://freecad-tutorial.blogspot.com/2011/12/engine-9-poly-v-belt.html\n# https://www.freecadweb.org/wiki/User:Eriossoltero\n# 13/03/2012, 29/07/2019\nimport Part, FreeCAD, math, PartGui, FreeCADGui\nfrom FreeCAD import Base\n\n# get the selected objects, with first selection for the trajectory and second for the section\n# Adapted from:\n# Macro Begin: Ellipse-Center+2Points.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++\n# http://freecad-tutorial.blogspot.com/2011/12/engine-9-poly-v-belt.html\nimport Part, FreeCAD, math, PartGui, FreeCADGui\nfrom FreeCAD import Base\n\n# get the selected objects, with first selection for the trajectory and second for the section\n# Adapted from:\n# http://freecad-tutorial.blogspot.com/2011/12/engine-9-poly-v-belt.html\ns = FreeCADGui.Selection.getSelection()\ntry:\n sel1=s[0].Shape\n sel2=s[1].Shape\n sel3=s[2].Shape\n pt_center = sel1.Point\n pt_radmay = sel2.Point\n pt_radmen = sel3.Point# create Part object in the current document\n myObject=App.ActiveDocument.addObject(\"Part::Feature\",\"Ellipse\")# create a shape and assign it to the current document\n ellipse = Part.Ellipse(pt_radmay, pt_radmen, pt_center)\n myObject.Shape = ellipse.toShape()\n # Macro End: Ellipse-Center+2Points.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++\n\nexcept:\n print( \"Wrong selection\")\n print( \"First:centre, Second:major radius and Third:minor radius\")\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > Macro Ellipse-Center+2Points\n"} {"id": "freecad-docs:wiki/Macro_FCInfoToMouse.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_FCInfoToMouse.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_FCInfoToMouse.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "24b8316f8a60a38c0c2b276363c23cd4b40de2e0af07312d4242e0844ea66506", "bytes": 19984, "tokens": 5981, "text": "# Macro FCInfoToMouse\n{{Macro\n|Name=Macro FCInfoToMouse\n|Icon=FCInfoToMouse.png\n|Description=Provides info about coordinates, length, and angles in real-time next to the mouse pointer.\n|Author=Mario52\n|Download=[https://wiki.freecad.org/images/1/10/FCInfoToMouse.png ToolBar Icon]\n|Version=00.04\n|Date=2018-03-27\n}}\n\n## Description\n\nProvides info about coordinates, length, and angles in real-time next to the mouse pointer in a bubble annotation displayed in the [3D view](3D_view.md)\n\n \n\n \"\" \n*FCInfoToMouse macro in action*\n\n## Usage\n\n1. Install the FCInfoToMouse macro in your macros directory via the [Addon Manager](Std_AddonMgr.md)\n2. Run the [Macro](Macros.md)\n\n: Result: an annotation appears and the mouse coordinate information is displayed in real-time.\n\n\n: \n\n : \"\"\n\n : \n \n*Figure 1*\n \n\n - **X, Y, Z**: mouse coordinates are displayed in the bubble (this only applies when \\\"Single\\\" mode is enabled) as seen in Fig. 1\n\n: \n\n : Once the mouse is clicked for the first time, additional info is displayed (when \\\"Forced\\\" mode is enabled this setting will be solely displayed)\n\n\n: \n\n : \"\"\n\n : \n \n*Figure 2*\n \n\n - **X1, Y1, Z1** : Initial coordinates of the 1st mouse click\n\n - **X2, Y2, Z2** : Current coordinates of the mouse\n\n - **L** : Length between the first mouse click and the location of the current mouse pointer\n\n - **XY, YZ, XZ** : Angles between the 1st point and moving mouse pointer in the XY, YZ, and XZ planes \n\n: \n\n : \"\"\n\n: \n \n*Figure 3 - when mouse pointer is over an object, the name of the object will be displayed*\n \n\n\n: \n\n : If the mouse hovers over an object, the object name appears at the top of the annotation (see Figure 3).\n\n \n\n### Keyboard Shortcuts \n\n****SHIFT** + **Q****: Quit the FCInfoToMouse macro. Upon quitting the macro, the annotation remains at its current mouse pointer location. Begin using the mouse normally if you want to delete the annotation manually.\n\n****SHIFT** + **M****: Toggle the mode between:\n\n- **single** which displays only the coordinates of the mouse pointer (Figure 1)\n- **force** which displays the \\\"**comprehensive visualisation**\\\" (Figure 2)\n- **normal** which displays the default behavior of the macro\n\n****SHIFT** + **C**** : for \\\"**hidden / visible**\\\"\n\n****SHIFT** + **D**** : to \\\"**Open/Close**\\\" a Spreadsheet with the coordinates saved to:\n\n: {\\| class=\\\"wikitable\\\" style=\\\"text-align: center; color: green;\\\"\n\n!Cell **A** !Cell **B** !Cell **C** !Cell **D** \\|- \\|x, y, z\n\n\n\n\n\\|x\n\n\n\n\n\\|y\n\n\n\n\n\\|z\n\n\n\n\n\\|}\n\n### Notes\n\nAt any time, you can change the properties of the annotation by clicking the object FCInfoToMouse in Combo View and click the View tab\n\nIf you want change the number of decimal change the line 43 (default 4)\n\nExample for 6 decimal places:\n\noriginal value \n```python\nglobal arrondi ; arrondi = 4\n``` replace to \n```python\nglobal arrondi ; arrondi = 6\n```\n\nTo make the configuration of the permanent annotation you can change the values in the configuration section lines **104 to 122**\n\n \n\n## Script\n\nThe icon **FCInfoToMouse.png** \"FCInfoToMouse\" for the [Customize_ToolsBar](http://www.freecadweb.org/wiki/index.php?title=Customize_ToolsBar) \n\n**Macro_FCInfoToMouse.FCMacro**\n\n\n{{MacroCode|code=\n\n# -*- coding: utf-8 -*-\n\"\"\"\n***************************************************************************\n* Copyright (c) 2016 *\n* *\n* This file is a supplement to the FreeCAD CAx development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n* *\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n***************************************************************************\n* WARNING! All changes in this file will be lost and * \n* may cause malfunction of the program *\n***************************************************************************\n\"\"\"\n# http://forum.freecadweb.org/viewtopic.php?f=22&t=9215\n# FCInfoToMouse\n\n__title__ = \"FCInfoToMouse\"\n__author__ = \"Mario52\"\n__url__ = \"https://www.freecadweb.org/wiki/Macro_FCInfoToMouse\"\n__version__ = \"00.04\"\n__date__ = \"27/03/2018\"\n#\nimport Draft, Part\nimport math,FreeCAD\nfrom FreeCAD import Base\nimport time\nApp = FreeCAD\n\nglobal arrondi ; arrondi = 4\n\nglobal objectAnn ; objectAnn = \"\" \nglobal positionX1 ; positionX1 = 0.0\nglobal positionY1 ; positionY1 = 0.0\nglobal positionZ1 ; positionZ1 = 0.0\nglobal force ; force = 0\nglobal hidden ; hidden = 0\nglobal coorBegin ; coorBegin = \"\"\nglobal pas ; pas = 0\n\nglobal spreadSheet; spreadSheet= 0\nglobal compteur ; compteur = 0 \nglobal spread ; spread = \"\"\n\nfrom math import sqrt, pi, sin, cos, asin, acos, atan, atan2, degrees\n\ndef angle2(vecteur_x1,vecteur_y1,vecteur_x2,vecteur_y2,mode): #tester getAngle ( Vector )\n# calcul de l'inclinaison d'une ligne a partir de deux Vecteurs\n# si \"mode\" = 1 alors affichage en degres sinon en radian\n try:\n deltaX = vecteur_x2 - vecteur_x1\n deltaY = vecteur_y2 - vecteur_y1\n if mode ==1:\n angle = degrees(atan2(float(deltaY),float(deltaX))) # degres (mode = 1)\n else:\n angle = atan2(float(deltaY),float(deltaX)) # radian (mode = 0)\n return round(angle,arrondi)\n except Exception:\n None\n\ndef sub(first, other): \n \"sub(Vector,Vector) - subtracts second vector from first one\"\n if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector):\n return FreeCAD.Vector(first.x-other.x, first.y-other.y, first.z-other.z)\n\ndef length(first):\n \"lengh(Vector) - gives vector length\"\n if isinstance(first,FreeCAD.Vector):\n return math.sqrt(first.x*first.x + first.y*first.y + first.z*first.z)\n\ndef dist(first, other):\n \"dist(Vector,Vector) - returns the distance between both points/vectors\"\n if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector):\n return length(sub(first,other))\n\ndef codeColor(color):\n try:\n rgb = float((float(color)/255.0))\n except Exception:\n rgb = 0.0\n return rgb\n\n\ndoc = FreeCAD.ActiveDocument \nif doc == None:\n doc = FreeCAD.newDocument()\n\n# for modify the configuration : line 104 to 122\n# PS: if DisplayMode = \"Line\" and Frame = False the annotation is transparent\n#\n##### Configuration Modify here # Begin #######################################\n #\n#BackgroundColor : #\nred_B = 0.0 # 0.0 to 255.0 #\ngreen_B = 84.0 # 0.0 to 255.0 #\nblue_B = 255.0 # 0.0 to 255.0 #\n #\ndisplayMode = \"Line\" # \"Line\" or \"Object\" #\nfontName = \"MS Shell Dlg 2\" # \"MS Shell Dlg 2\" for Windows #\nfontSize = 8.0 # Font size #\nframe = False # \"False\" or \"True\" #\njustification = \"Left\" # \"Left\", \"Right\", \"Center\" #\n #\n#TextColor : #\nred_T = 255.0 # 0.0 to 255.0 #\ngreen_T = 255.0 # 0.0 to 255.0 #\nblue_T = 255.0 # 0.0 to 255.0 #\n #\n##### Configuration End End ###################################################\n\nv=Gui.activeDocument().activeView()\nobjectAnn = App.ActiveDocument.addObject(\"App::AnnotationLabel\",\"FCInfoToMouse\")# create work annotation\nobjectAnn.LabelText=[\"Hello FreeCAD World\"]\n\nFreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).BackgroundColor = (codeColor(red_B),codeColor(green_B),codeColor(blue_B)) #\nFreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).DisplayMode = displayMode #\nFreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).FontName = fontName #\nFreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).FontSize = fontSize #\nFreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).Frame = frame #\nFreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).Justification = justification #\nFreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).TextColor = (codeColor(red_T),codeColor(green_T),codeColor(blue_T)) #\n\nimport os, sys, platform\nglobal PolicePath; PolicePath = \"\"\n\n#if platform.system() == \"Windows\" :\n# PolicePath = \"C:/Windows/Fonts/ARIAL.TTF\"\n#elif platform.system() == \"Linux\" :\n# PolicePath = \"/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-M.ttf\"\n#elif platform.system() == \"Darwin\":\n# PolicePath = \"/Library/Fonts/Arial.ttf\"\n#else:\n# PolicePath = \"C:/Windows/Fonts/ARIAL.TTF\"\n\np=FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Mod/Draft\")\nPolicePath = p.GetString(\"FontFile\")\n\nclass ViewObserver:\n def __init__(self, view):\n self.view = view\n\n def logPosition(self, info):\n global objectAnn\n global positionX1, positionY1, positionZ1\n global pas, arrondi\n global coorBegin\n global force\n global hidden\n global PolicePath\n global spreadSheet\n global compteur\n global spread\n\n######## for testing key ############\n# try: #\n# print info[\"Key\"] #\n# print info[\"State\"] #\n## print ord(info[\"Key\"]) #\n# except Exception: #\n# None #\n#####################################\n\n Button1 = 0\n\n try:\n if (info[\"Key\"] == \"Q\") and (info[\"State\"] == \"DOWN\"): # SHIFT + Q for quit\n v.removeEventCallback(\"SoEvent\",c) # close event observation\n FreeCAD.Console.PrintMessage( \"End FCInfoToMouse\" + \"\\n\")\n except Exception:\n None\n\n try:\n if (info[\"Key\"] == \"M\") and (info[\"State\"] == \"DOWN\"): # SHIFT + M for force display\n if force == 0:\n force = 1\n FreeCAD.Console.PrintMessage( \"Forced \" + \"\\n\")\n elif force == 1:\n force = 2\n FreeCAD.Console.PrintMessage( \"Single \" + \"\\n\")\n elif force == 2:\n force = 0\n FreeCAD.Console.PrintMessage( \"Normal \" + \"\\n\")\n except Exception:\n None\n\n try:\n if (info[\"Key\"] == \"C\") and (info[\"State\"] == \"DOWN\"): # SHIFT + C for hidden / visible annotation OK\n if hidden == 0:\n hidden = 1\n FreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).Visibility = False\n FreeCAD.Console.PrintMessage( \"concealed \" + \"\\n\")\n else:\n hidden = 0\n FreeCADGui.getDocument(doc.Name).getObject(objectAnn.Label).Visibility = True\n FreeCAD.Console.PrintMessage( \"visible \" + \"\\n\")\n except Exception:\n None\n\n try:\n if (info[\"Key\"] == \"D\") and (info[\"State\"] == \"DOWN\"): # SHIFT + S for Open spreadSheet\n if spreadSheet == 0:\n #spread = FreeCAD.ActiveDocument.getObjectsByLabel(spread.Name)[0] # for append in existant SpreadSheet\n spread = App.activeDocument().addObject('Spreadsheet::Sheet','MySpreedSheett')\n spreadSheet = 1\n FreeCAD.Console.PrintMessage(\"SpreadSheet open : \" + spread.Name + \"\\n\")\n else:\n spreadSheet = 0\n FreeCAD.Console.PrintMessage(\"SpreadSheet closed\" + \"\\n\")\n compteur = 0\n except Exception:\n None\n\n try:\n object2 = \"\"\n object = v.getObjectInfo(v.getCursorPos()) # here for object preselected\n object2 = object[\"Object\"] + \".\" + object[\"Component\"] # object + component\n pnt = FreeCAD.Vector(float(object[\"x\"]),float(object[\"y\"]),float(object[\"z\"]))# vector on position mouse to object\n# print \"pnt \",pnt\n except Exception:\n pos = info[\"Position\"] # if mouse in 3D view\n pnt = self.view.getPoint(pos) # vector detect on mouse position 3D view\n# print \"pnt \",pnt\n\n try:\n if (info[\"Button\"] == \"BUTTON1\") and (info[\"State\"] == \"DOWN\"): # coordinates clic to mouse\n positionX1 = round(pnt[0],arrondi)\n positionY1 = round(pnt[1],arrondi)\n positionZ1 = round(pnt[2],arrondi)\n \n coorBegin = \"\"\n coorBegin = \"X1: \"+str(positionX1)+\" Y1: \"+str(positionY1)+\" Z1: \"+str(positionZ1)\n if pas == 0:\n pas = 1\n else:\n pas = 0\n\n try: # spreadSheet\n if spreadSheet == 1:\n compteur += 1\n spread.set(\"A\"+str(compteur) , str(positionX1) + \", \" + str(positionY1) + \", \" + str(positionZ1))\n spread.set(\"B\"+str(compteur) , str(positionX1))\n spread.set(\"C\"+str(compteur) , str(positionY1))\n spread.set(\"D\"+str(compteur) , str(positionZ1))\n App.ActiveDocument.recompute()\n FreeCAD.Console.PrintMessage(str(compteur) + \" : \" + str(positionX1) + \", \" + str(positionY1) + \", \" + str(positionZ1) + \"\\n\")\n except Exception:\n None\n \n except Exception:\n None\n\n try:\n objectAnn.BasePosition = (pnt[0], pnt[1], pnt[2])\n if force == 2:\n objectAnn.LabelText = [\"X: \" + str(round(pnt[0],arrondi)) + \" Y: \" + str(round(pnt[1],arrondi)) + \" Z: \" + str(round(pnt[2],arrondi))]\n else:\n if ((pas == 1) or (force == 1)):\n coorEnd = longueur = angles = \"\"\n coorEnd = \"X2: \" + str(round(pnt[0],arrondi)) + \" Y2: \" + str(round(pnt[1],arrondi)) + \" Z2: \" + str(round(pnt[2],arrondi))\n longueur = \"L: \" + str(round(dist(FreeCAD.Vector(positionX1,positionY1,positionZ1), FreeCAD.Vector(pnt[0], pnt[1], pnt[2])),12)) # around to 12 decimales\n alphaXY = alphaXY = alphaXZ = 0.0\n alphaXY = str(round(angle2(positionX1,positionY1,pnt[0],pnt[1],1),arrondi))\n alphaYZ = str(round(angle2(positionY1,positionZ1,pnt[1],pnt[2],1),arrondi))\n alphaXZ = str(round(angle2(positionX1,positionZ1,pnt[0],pnt[2],1),arrondi))\n \n angles = \"XY: \" + alphaXY + unichr(176) + \" YZ: \" + alphaYZ + unichr(176) + \" XZ: \" + alphaXZ + unichr(176) # unichr(176) = degrees character\n \n if object2 == \"\":\n objectAnn.LabelText = [coorBegin, coorEnd, longueur, angles,]\n else:\n objectAnn.LabelText = [object2, coorBegin, coorEnd, longueur, angles,]\n else:\n if object2 == \"\":\n objectAnn.LabelText = [\"X: \" + str(round(pnt[0],arrondi)) + \" Y: \" + str(round(pnt[1],arrondi)) + \" Z: \" + str(round(pnt[2],arrondi)),]\n else:\n objectAnn.LabelText = [object2, \"X: \" + str(round(pnt[0],arrondi)) + \" Y: \" + str(round(pnt[1],arrondi)) + \" Z: \" + str(round(pnt[2],arrondi))]\n\n except Exception:\n FreeCAD.Console.PrintError(\"End FCInfoToMouse by an error\" + \"\\n\")\n v.removeEventCallback(\"SoEvent\",c) # close event observation\n\n##### Begin ######\nFreeCAD.Console.PrintMessage(\"__Welcome to FCInfoToMouse__\" + \"\\n\")\nFreeCAD.Console.PrintMessage(\"SHIFT + Q : for quit\" + \"\\n\")\nFreeCAD.Console.PrintMessage(\"SHIFT + M : for force display, mode single, mode normal\" + \"\\n\")\nFreeCAD.Console.PrintMessage(\"SHIFT + C : for concealed / visible\" + \"\\n\")\nFreeCAD.Console.PrintMessage(\"SHIFT + D : for create spreadSheet / close spreadSheet\" + \"\\n\")\nFreeCAD.Console.PrintMessage(\"____________________________\" + \"\\n\")\n\npas = 0\no = ViewObserver(v)\ntry:\n c = v.addEventCallback(\"SoEvent\",o.logPosition)\nexcept Exception:\n App.ActiveDocument.removeObject(objectAnn.Label)\n FreeCAD.Console.PrintMessage( \"Not GUI End FCInfoToMouse\" + \"\\n\")\n\n\n}}\n\n\nor to Gists [Macro_FCInfoToMouse.FCMacro](https://gist.github.com/mario52a/974214c4b83beaa41495) or the zip [Macro_FCInfoToMouse.FCMacro.zip](https://gist.github.com/mario52a/974214c4b83beaa41495/archive/d62630049d4663369fc80519a7655ee4c32c8711.zip) \n\n## Limitation\n\nIt is possible that the macro does not recognize some keys \n\n## Links\n\nThe discussion on the forum [From autocad to freecad](http://forum.freecadweb.org/viewtopic.php?f=3&t=13592)\n\nMy macros on [mario52a](https://gist.github.com/mario52a) gists \n\n## Version\n\n27/03/2018 ver 00.04 : add function \\\"Save the coordinate in a spreadSheet key \\\"D\\\" flip/flop on,off\n\n24/01/2016 ver 00.03 : add section configuration and replace key \\\"C\\\" to \\\"M\\\"\n\n23/01/2016 ver 00.02 : add function \\\"single\\\", replace key \\\"H\\\" to \\\"C\\\" and correct bug\n\n02/01/2016 : ver 0.1\n\n\n---\n⏵ [documentation index](../README.md) > Macro FCInfoToMouse\n"} {"id": "freecad-docs:wiki/Macro_Geodesic_Dome.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Geodesic_Dome.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Geodesic_Dome.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "569ca4f8e6e67b667ec755585ed1ea438d7577074fbabec27fdd45b9fc851b71", "bytes": 14835, "tokens": 4925, "text": "# Macro Geodesic Dome\n{{Macro\n|Name=Macro Geodesic Dome\n|Icon=Macro_Geodesic_Dome.svg\n|Description=This macro creates a parametric geodesic dome shell. The dome radius and the frequency parameter will be set at creation time.\n|Author=Ulrich Brammer, DeepSOIC, galou\n|Version=02.00\n|Date=2019-03-24\n|FCVersion=All\n|Download=[https://www.freecadweb.org/wiki/File:Macro_Geodesic_Dome.svg ToolBar Icon]\n}}\n\n## Description\n\nThis macro creates a parametric geodesic dome shell. The dome radius and the frequency parameter will be set at creation time.\n\n {{Codeextralink|https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/ParametricObjectCreation/geodesic_dome/geodesic_dome.py}}\n\n \"\"\n\n## Usage\n\n1\\. Install the macro using Addon Manager (menu Tools → Addon Manager). On tab \\\"Macros\\\", pick \\\"GeodesicDome\\\", click \\\"Install\\\". Then close addon manager.\n\n2\\. Run GeodesicDome.FCMacro. A dialog should appear\n\n3\\. Specify the parameters, click OK.\n\na dome shape should appear. You can then edit dome parameters by altering properties of GeoDome object.\n\n## Script\n\n(this is an old, non-parametric version of the script. Up-to-date version is in FreeCAD-macros repository, [here!](https://github.com/FreeCAD/FreeCAD-macros/blob/master/ParametricObjectCreation/geodesic_dome/geodesic_dome.py) ) \n\nToolBar Icon ![](images/Macro_Geodesic_Dome.svg )\n\n**Macro_Geodesic_Dome.FCMacro**\n\n # -*- coding: utf-8 -*-\n\n # Form implementation generated from reading ui file 'geodesic_dialog.ui'\n # And changed manually to use FreeCAD \"Gui::InputField\"\n # Created: Sun Jan 4 22:20:58 2015\n # by: pyside-uic 0.2.15 running on PySide 1.2.2\n #\n # Upgrade 2019/06/16 for use with FreeCAD 0.19 version\n #OS: Windows 10 (10.0)\n #Word size of OS: 64-bit\n #Word size of FreeCAD: 64-bit\n #Version: 0.19.16993 (Git)\n #Build type: Release\n #Branch: master\n #Hash: 5ea062f6699666b2f284f6a52105acf20828b481\n #Python version: 3.6.8\n #Qt version: 5.12.1\n #Coin version: 4.0.0a\n #OCC version: 7.3.0\n\n '''\n ************************************************************************\n * Copyright (c)2015 2019 Ulrich Brammer *\n * *\n * This file is a supplement to the FreeCAD CAx development system. *\n * *\n * This program is free software; you can redistribute it and/or modify *\n * it under the terms of the GNU Lesser General Public License (LGPL) *\n * as published by the Free Software Foundation; either version 2 of *\n * the License, or (at your option) any later version. *\n * for detail see the LICENCE text file. *\n * *\n * This software is distributed in the hope that it will be useful, *\n * but WITHOUT ANY WARRANTY; without even the implied warranty of *\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n * GNU Library General Public License for more details. *\n * *\n * You should have received a copy of the GNU Library General Public *\n * License along with this macro; if not, write to the Free Software *\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n * USA *\n * *\n ************************************************************************\n '''\n\n\n from PySide import QtCore, QtGui\n import FreeCAD, FreeCADGui, math, Part\n from FreeCAD import Base\n\n class Ui_Dialog(object):\n def setupUi(self, Dialog):\n Dialog.setObjectName(\"Dialog\")\n Dialog.resize(477, 188)\n self.dia = Dialog\n self.gridLayoutWidget = QtGui.QWidget(Dialog)\n self.gridLayoutWidget.setGeometry(QtCore.QRect(19, 19, 440, 141))\n self.gridLayoutWidget.setObjectName(\"gridLayoutWidget\")\n self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget)\n self.gridLayout.setContentsMargins(0, 0, 0, 0)\n self.gridLayout.setObjectName(\"gridLayout\")\n self.label = QtGui.QLabel(self.gridLayoutWidget)\n self.label.setObjectName(\"label\")\n self.gridLayout.addWidget(self.label, 0, 0, 1, 1)\n #self.lineEdit = QtGui.QLineEdit(self.gridLayoutWidget)\n fui = FreeCADGui.UiLoader()\n self.lineEdit = fui.createWidget(\"Gui::InputField\")\n \n self.lineEdit.setObjectName(\"lineEdit\")\n self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1)\n self.label_2 = QtGui.QLabel(self.gridLayoutWidget)\n self.label_2.setObjectName(\"label_2\")\n self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)\n self.lineEdit_2 = QtGui.QLineEdit(self.gridLayoutWidget)\n self.lineEdit_2.setObjectName(\"lineEdit_2\")\n self.gridLayout.addWidget(self.lineEdit_2, 1, 1, 1, 1)\n self.label_3 = QtGui.QLabel(self.gridLayoutWidget)\n self.label_3.setObjectName(\"label_3\")\n self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)\n self.buttonBox = QtGui.QDialogButtonBox(self.gridLayoutWidget)\n self.buttonBox.setOrientation(QtCore.Qt.Horizontal)\n self.buttonBox.setStandardButtons \\\n (QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)\n self.buttonBox.setObjectName(\"buttonBox\")\n self.gridLayout.addWidget(self.buttonBox, 2, 1, 1, 1)\n\n self.retranslateUi(Dialog)\n QtCore.QObject.connect(self.buttonBox, \\\n QtCore.SIGNAL(\"accepted()\"), self.makeSomething)\n QtCore.QObject.connect(self.buttonBox, \\\n QtCore.SIGNAL(\"rejected()\"), self.makeNothing)\n QtCore.QMetaObject.connectSlotsByName(Dialog)\n\n def retranslateUi(self, Dialog):\n # original code commented 2019/06/16\n # Dialog.setWindowTitle(QtGui.QApplication.translate \\\n # (\"Dialog\", \"Geodesic Dome Creator\", \\\n # None, QtGui.QApplication.UnicodeUTF8))\n # self.label.setText(QtGui.QApplication.translate \\\n # (\"Dialog\", \"Dome Radius\", None, QtGui.QApplication.UnicodeUTF8))\n # self.label_2.setText(QtGui.QApplication.translate \\\n # (\"Dialog\", \"Frequency Parameter\\n(Integer between 1 to 10)\", \\\n # None,QtGui.QApplication.UnicodeUTF8))\n # self.label_3.setText(QtGui.QApplication.translate \\\n # (\"Dialog\", \"This Macro creates \\na full geodesic dome shell.\\nX-Y-symmetry plane \\nfor even frequencies\", \\\n # None, QtGui.QApplication.UnicodeUTF8))\n ####\n # replacement code 2019/06/16\n Dialog.setWindowTitle(\"Geodesic Dome Creator\")\n self.label.setText(\"Dome Radius\")\n self.label_2.setText(\"Frequency Parameter\\n(Integer between 1 to 10)\")\n self.label_3.setText(\"This Macro creates \\na full geodesic dome shell.\\nX-Y-symmetry plane \\nfor even frequencies\")\n ####\n\n def makeSomething(self):\n print( \"accepted! Dome radius: \", self.lineEdit.property(\"text\"), \\\n \" with Frequency: \", int(self.lineEdit_2.text()))\n\n doc=App.activeDocument()\n label = \"GeodesicDome\"\n\n theDome = doc.addObject(\"Part::Feature\",label)\n radius = self.lineEdit.property(\"text\")\n frequency = int(self.lineEdit_2.text())\n \n self.dia.close()\n self.makeDome(theDome, radius, frequency)\n doc.recompute()\n \n \n def makeNothing(self):\n print( \"rejected!!\")\n self.dia.close()\n \n\n\n def makeDome(self, obj, domeRad_str, ny):\n \n def makeFreqFaces(fPt, sPt, thPt, ny = 1):\n # makes the geodesic dome faces out of the points of an\n # icosahedron triangle\n b = self.a/ny # length of frequent triangles\n # definition of direction vectors\n growVec = (sPt - fPt)\n # growVec = (fPt - sPt)\n growVec.multiply(1.0/ny)\n crossVec = (thPt - sPt)\n # crossVec = (sPt - thPt)\n crossVec.multiply(1.0/ny)\n \n for k in range(ny):\n kThirdPt = fPt + growVec * (k+0.0)\n dThirdPt = Base.Vector(kThirdPt.x, kThirdPt.y, kThirdPt.z)\n dThirdPt = dThirdPt.normalize().multiply(domeRad.Value)\n kSecPt = fPt + growVec * (k+1.0)\n dSecPt = Base.Vector(kSecPt.x, kSecPt.y, kSecPt.z)\n dSecPt = dSecPt.normalize().multiply(domeRad.Value)\n # thirdEdge = Part.makeLine(kSecPt, kThirdPt)\n # thirdEdge = Part.makeLine(dSecPt, dThirdPt)\n for l in range(k+1):\n firstPt = kSecPt + crossVec *(l+1.0)\n dFirstPt = firstPt.normalize().multiply(domeRad.Value)\n secPt = kSecPt + crossVec *(l+0.0)\n dSecPt =secPt.normalize().multiply(domeRad.Value)\n thirdPt = kThirdPt + crossVec *(l+0.0)\n dThirdPt = thirdPt.normalize().multiply(domeRad.Value)\n #thirdEdge = Part.makeLine(secPt, thirdPt)\n thirdEdge = Part.makeLine(dSecPt, dThirdPt)\n # Part.show(thirdEdge)\n if l > 0:\n print( \"in l: \", l, \" mod 2: \", l%2)\n # What to do here?\n #secEdge = Part.makeLine(oThirdPt,thirdPt)\n secEdge = Part.makeLine(doThirdPt,dThirdPt)\n # Part.show(secEdge)\n #thirdEdge = Part.makeLine(secPt, thirdPt)\n #thirdEdge = Part.makeLine(dSecPt, dThirdPt)\n # Part.show(thirdEdge)\n triWire = Part.Wire([firstEdge, secEdge, thirdEdge])\n # Part.show(triWire)\n triFace = Part.Face(triWire)\n self.domeFaces.append(triFace)\n #Part.show(triFace)\n \n oThirdPt = thirdPt\n doThirdPt = oThirdPt.normalize().multiply(domeRad.Value)\n # oFirstPt = firstPt\n #firstEdge = Part.makeLine(thirdPt,firstPt)\n firstEdge = Part.makeLine(dThirdPt,dFirstPt)\n oFirstEdge = firstEdge\n #secEdge = Part.makeLine(firstPt,secPt)\n secEdge = Part.makeLine(dFirstPt,dSecPt)\n #Part.show(firstEdge)\n #Part.show(secEdge)\n #Part.show(thirdEdge)\n triWire = Part.Wire([firstEdge, secEdge, thirdEdge])\n triFace = Part.Face(triWire)\n self.domeFaces.append(triFace)\n #Part.show(triFace)\n \n \n domeRad = FreeCAD.Units.Quantity(domeRad_str)\n \n # self.a = Strutlength of underlying icosahedron:\n self.a=(4.0*domeRad.Value)/math.sqrt(2.0*math.sqrt(5.0)+10.0) \n \n # icoAngle: angle of vertices of icosahedron points \n # not a north or south pole\n self.icoAngle = math.atan(0.5)\n \n self.icoLat = domeRad.Value * math.sin(self.icoAngle)\n self.latRad = domeRad.Value * math.cos(self.icoAngle)\n self.ang36 = math.radians(36.0)\n \n # Calculation all points of the icosahedron\n self.icoPts = []\n self.icoPts.append(Base.Vector(0.0, 0.0, domeRad.Value))\n \n for i in range(10):\n self.icoCos = self.latRad * math.cos(i*self.ang36)\n self.icoSin = self.latRad * math.sin(i*self.ang36)\n if i%2 == 0:\n self.icoPts.append(Base.Vector(self.icoSin, self.icoCos, self.icoLat))\n else:\n self.icoPts.append(Base.Vector(self.icoSin, self.icoCos, -self.icoLat))\n \n self.icoPts.append(Base.Vector(0.0, 0.0, -domeRad.Value))\n \n # making the faces of the icosahedron\n \n self.icoFaces = [] # collects faces of the underlying icosahedron\n self.domeFaces = [] # collects the faces of the geodesic dome\n \n thirdPt = self.icoPts[9]\n thirdEdge = Part.makeLine(self.icoPts[0],thirdPt)\n for i in range(5):\n j = i*2+1\n firstEdge = Part.makeLine(thirdPt,self.icoPts[j])\n secEdge = Part.makeLine(self.icoPts[j],self.icoPts[0])\n triWire = Part.Wire([firstEdge, secEdge, thirdEdge])\n triFace = Part.Face(triWire)\n self.icoFaces.append(triFace)\n # Part.show(triFace)\n makeFreqFaces(self.icoPts[j], self.icoPts[0], thirdPt, ny)\n \n thirdEdge = Part.makeLine(self.icoPts[0],self.icoPts[j])\n thirdPt = self.icoPts[j]\n \n thirdPt = self.icoPts[9]\n secPt = self.icoPts[10]\n thirdEdge = Part.makeLine(secPt,thirdPt)\n \n for i in range(10):\n j = i+1\n firstEdge = Part.makeLine(thirdPt,self.icoPts[j])\n secEdge = Part.makeLine(self.icoPts[j],secPt)\n triWire = Part.Wire([firstEdge, secEdge, thirdEdge])\n triFace = Part.Face(triWire)\n self.icoFaces.append(triFace)\n #Part.show(triFace)\n makeFreqFaces(self.icoPts[j], secPt, thirdPt, ny)\n \n thirdPt = secPt \n secPt = self.icoPts[j] \n thirdEdge = Part.makeLine(secPt,thirdPt)\n \n \n thirdPt = self.icoPts[10]\n thirdEdge = Part.makeLine(self.icoPts[11],thirdPt)\n for i in range(5):\n j = i*2+2\n firstEdge = Part.makeLine(thirdPt,self.icoPts[j])\n secEdge = Part.makeLine(self.icoPts[j],self.icoPts[11])\n triWire = Part.Wire([firstEdge, secEdge, thirdEdge])\n triFace = Part.Face(triWire)\n self.icoFaces.append(triFace)\n #Part.show(triFace)\n makeFreqFaces(self.icoPts[j], self.icoPts[11], thirdPt, ny)\n \n thirdEdge = Part.makeLine(self.icoPts[11],self.icoPts[j])\n thirdPt = self.icoPts[j]\n \n # Shell of a corresponding icosahedron \n newShell = Part.Shell(self.icoFaces)\n #Part.show(newShell)\n \n # Shell of the geodesic dome\n #self.domeShell = Part.Shell(self.domeFaces)\n #Part.show(self.domeShell)\n obj.Shape = Part.Shell(self.domeFaces)\n \n # Shere with radius of geodesic dome for debugging purposes\n testSphere = Part.makeSphere(domeRad.Value)\n #Part.show(testSphere)\n \n\n d = QtGui.QWidget()\n d.ui = Ui_Dialog()\n d.ui.setupUi(d)\n d.ui.lineEdit_2.setText(\"2\")\n d.ui.lineEdit.setProperty(\"text\", \"2 m\")\n\n d.show()\n\n\n## Link\n\nForum [Designing geodesic dome](https://forum.freecadweb.org/viewtopic.php?t=9174)\n\n\n---\n⏵ [documentation index](../README.md) > Macro Geodesic Dome\n"} {"id": "freecad-docs:wiki/Macro_Half-Hull_Model.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Half-Hull_Model.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Half-Hull_Model.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6ad03e255ae4d69b0c02c0df04d4f164c61b922d590de13c304d0ecf6b7cee31", "bytes": 26388, "tokens": 8116, "text": "# Macro Half-Hull Model\n{{Macro\n|Name=Macro Half-Hull Model\n|Icon=Macro_Half_Hull_Model.png\n|Description=This macro generates both three dimensional half-hull and full-hull models from a series of 2D line drawings.
This macro makes simple models of the hulls of boats and ships. It is intended to aid people modeling or designing hulls by providing the hull surface in a straight forward and timely fashion so they can avoid the time consuming full process.\n|Author=Piffpoof\n|Version=1.0\n|Date=2016-01-25\n|FCVersion=<= 0.16\n|Download=[https://www.freecadweb.org/wiki/images/4/44/Macro_Half_Hull_Model.png ToolBar Icon]\n}}\n\n## Description\n\nThis macro makes simple models of the hulls of boats and ships. It is intended to aid people modeling or designing hulls by providing the hull surface in a straight forward and timely fashion so they can avoid the time consuming full process.\n\n \n\n![](images/Macro_Half-Hull_ModelScreenBoatInABottle.jpg )\n\n## Background\n\nSince antiquity boat builders have had to design boats and then realise them in a three dimensional environment where very few lines are straight, very few surfaces flat and no angles constant over a distance. Hull models were used to make to-scale models which could then be used to review the design or communicate concepts to other persons. The laws of hydrodynamics demand that any vessel passing through a liquid be symmetrical in the cross-section if it is to track (move in a straight line) accurately. Consequently building one side of the hull in the model was all that was necessary - if the half-hull was perfect then its mirror image would also be perfect. In latter years half-hulls became used for symbolic purposes such as plaques, and nautical art.\n\nThis code came out of a project to build a model in FreeCAD of a 12.5 metre sailing boat. The builders no longer had drawings and the son of the original owner doubted there ever were full drawings. Consequently the hull dimensions had to be measured and then a model constructed within the software, Modern software packages like FreeCAD offer many beneficial features like symmetry constraints but when the final measurement is a model that is \\\"easy on the eye\\\", much \\\"massaging\\\" of models is required. This code was written to help automate that process.\n\nThe initial purpose of this code was to provide a symmetrical hull which was malleable so it could be fitted to the 3D model being constructed. As the software progressed it was generalised so hopefully it would be of some use to persons:\n\n- boat designers producing boat diagrams which can be built from\n- boat builders who are trying to model what is described on their diagrams\n- model hull builders.\n\nCertainly commercial boat designers have all sorts of high end software to assist their work, this isn\\'t supposed to replace that. Rather this is for the hobbyist or home builder to tinker around with.\n\nNautical blueprints have a distinct history with respect to buildings and so are somewhat different in presentation. This is an example of a sailing boat which is more than a century old:\n\n![](images/Macro_Half-Hull_ModelImage0.jpg )\n\nOne of the end goals of this software is to use the Draft workbench to generate some of these diagrams using the model to generate the lines.\n\n**Note on Units in FreeCAD:**\n\nAt present there isn\\'t really any units management system within FreeCAD, but obviously a boat builder or modeller will need an accurate dimensioning system. To use this macro, decide to set the FreeCAD grid size to what ever is appropriate for your work (e.g. mm, cm, inch, foot). FreeCAD is consistent, one FreeCAD unit will constantly equal to one FreeCAD unit. And if you have decided to have a FreeCAD unit equal a specific physical length, then your drawings will remain consistently dimensioned. At present there is work on a units system for FreeCAD so this situation may change soon.\n\n## Description \n\nFor this macro the hull shapes are defined by a minimum of 3 FreeCAD Sketches: one in the YZ plane, one or more in the XZ plane, one in the XY plane. Here is the minimum hull supported by this macro, it has only 3 Sketches:\n\n![](images/Macro_Half-Hull_ModelImage1.jpg )\n\nNote: in the above diagram we are looking directly at the stern, the bow is pointing away from the viewpoint.\n\nFrom front to back (bow to stern) the 3 Sketches are:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\nstemline\n\n\n\n\nYZ plane\n\n\n\n\nred line in sketch\n\n\n
\n\ncross-section\n\n\n\n\nXZ plane\n\n\n\n\ngreen line in Sketch\n\n\n
\n\ntransom\n\n\n\n\nXY plane\n\n\n\n\nblue line in Sketch\n\n\n
\n\nPerhaps it is easier to see with 7 Sketches (one in YZ plane, one in XY plane and 5 in the XZ plane):\n\n![](images/Macro_Half-Hull_ModelImage2.jpg )\n\nWith 5 Sketches in the XZ plane it is becoming easier to perceive the shape of the hull. The next 2 pictures show the Sketch lines superimposed on the model FreeCAD constructs,\n\n![](images/Macro_Half-Hull_ModelImage3.jpg )\n\nthe second is the same model rotated 90 degrees so the bow is in the foreground:\n\n![](images/Macro_Half-Hull_ModelImage3a.jpg )\n\nSome points to consider:\n\n- the Sketches are only for:\n - the stemline (or bow line) in the YZ plane (red in the above diagram);\n - the top of the transom in the XY plane (blue in the above diagram);\n - multiple cross-sections of the hull in the XZ plane (green in the above diagram)\n- only the starboard side of the hull is drawn in the Sketches, the port side will be generated as a mirror image\n- each multiple-segment line must be in a separate Sketch\n- each Sketch must have the same number of line segments (which is 3 in the previous examples)\n- the more line segments in each Sketch, the closer the FreeCAD generated model will approximate a curved hull\n- there is no limit to the number of line segment in each Sketch, any number from one up\n- there is no limit to the number of Sketches in the XZ plane (i.e. cross-sections), any number from one up\n\nWith enough Sketches the model generated may even approach:\n\n![](images/Macro_Half-Hull_ModelImage4.jpg )\n\nThe HalfHull macro generates 4 models:\n\n- starboard half-hull\n- port half-hull\n- complete hull\n- bulkheads for the complete hull, either with a flush deck or with a coachhouse\n\nThese models are all output in the unified location space of FreeCAD so they can be fitted together - for example the bulkheads can be inserted into the complete hull seamlessly. This is a picture of bulkheads in a boat model during construction:\n\n![](images/Macro_Half-Hull_ModelImage5.jpg )\n\nAs well as the bulkheads generated by the macro (note that these bulkheads are for a coachhouse rather than a flush deck):\n\n![](images/Macro_Half-Hull_ModelImage6.jpg )\n\nThe composite image below shows the main outputs from this software (the port side half-hull is actually not shown but it is the mirror of the starboard half-hull which is shown). The outputs are in clockwise order from the upper left corner:\n\n- starboard half-hull\n- complete hull\n- bulkheads (for flush deck, the bulkheads in the previous image were for a coachhouse deck)\n- the complete hull with the bulkheads inserted\n\n![](images/Macro_Half-Hull_ModelImage7.jpg )\n\nAs novelty features, the macro will also optionally produce plaques for the half-hulls, and even a bottle for the complete hull:\n\n![](images/Macro_Half-Hull_ModelImage8.jpg )\n\n![](images/Macro_Half-Hull_ModelImage9.jpg )\n\n## Installation\n\nAll the code for halfHullModel.FCMacro is in one macro. So installation is comprised of copying the code to the appropriate Macro directory and invoking the Build Utility from the Macro menu, the Python console or a toolbar button (the preferred method).\n\n- see [How to install macros](How_to_install_macros.md) for information on how to install this macro code\n- see [Customize Toolbars](Customize_Toolbars.md) for information how to install as a button on a toolbar\n\n## Usage\n\nThe FreeCAD operations involved in generating the hull model are rather complex and numerous. Things like the direction a line is drawn can cause the FreeCAD construction of the hull to either abort or turn out like:\n\n![](images/Macro_Half-Hull_ModelUsage1.jpg )\n\nConsequently the steps below need to be followed closely. The macro does allow for certain data inconsistencies but generally if the data (i.e. the Sketches) are incorrect then the output will look like a cheese grater or the macro fill fail with an error.\n\nThe following instructions refer to the quadrants of the XY graph, this refers to the 4 quarters of the XY graph and they are labelled as follows:\n\n![](images/Macro_Half-Hull_ModelUsage2.jpg )\n\n**Create a New Document**\n\nThe very first thing is to create a new document in FreeCAD \"\". This document will hold all the Sketches that make up your hull definition.\n\n### Create the Stemline \n\nThe first step is one of creating data for the hull model to be made from. The data is supplied in the form of Sketches within FreeCAD. After the hull model is generated, if changes are to be made then the Sketches are simply edited, and the second step of running the macro repeatedly.\n\n1. create a new sketch \"\", in the YZ-Plane\n2. start at origin (0,0) and draw upwards into Quadrant I\n ![](images/Macro_Half-Hull_ModelUsage3.jpg )\n3. the bottom end of the stemline is at the origin (0,0) - this will be the point from where the placement of all the cross-sections and transom will be made\n4. the number of line segments in this Sketch determines the number which will be required in each other Sketch\n5. save sketch \"\"\n6. for ease of identification it is probably worth naming the Sketch something like \\\"stemline sketch\\\"\n\n### Create the Cross-section Sketch(es) \n\n1. create a new sketch \"\", in the XZ-Plane\n2. the following dialog will appear:\n ![](images/Macro_Half-Hull_ModelScreenSnapshot1.jpg )\n The dialog is asking how far from the origin the Sketch should be placed. This will refer to how far the cross-section is from the bottom of the stemline (which was placed at (0,0)). The cross-sections can be equally spaced but need not be. The forward-most cross-section will be at Y=0 (i.e. the origin where the stemline bottom ends) or at Y\\<=0. The cross-sections will be at increasingly negative Y values until the transom is at the most negative Y value. In the example above, the cross-section Sketch will be placed 50 FreeCAD units from the origin on the negative Y axis.\n3. start on the Y axis and draw upwards into Quadrant I\n - the first (i.e. foremost) cross-section should start at origin (0,0) (or it will look odd as the stemline ends at 0,0) but other cross-sections need only start on the Y axis.\n ![](images/Macro_Half-Hull_ModelUsage3.jpg )\n4. use the same number of line segments as in the Stemline Sketch\n5. save sketch \"\"\n6. repeat as this step necessary, it may be quicker to copy this sketch and then space the copies on the Y-axis, modifications may be made to the individual Sketches as required\n7. for naming, it will make things easier to give some sort of sequence to the cross-sections, starting at the bow (i.e. the stemline) and increasing towards the stern (i.e. the transom)\n\n### Create the Transom Sketch in the XY Plane \n\n1. create a new sketch \"\", in the XY-Plane\n2. start on the Y axis between quadrant III and IV, and draw upwards into Quadrant IV so that the end point is coincident with the rightmost point of the lowest cross-section Sketch in the YZ-plane\n ![](images/Macro_Half-Hull_ModelUsage4.jpg )\n3. use the same number of line segments as in the stemline Sketch\n4. save sketch \"\"\n5. for ease of identification it is probably worth naming the Sketch something like \\\"transom sketch\\\"\n\n**Save the New Document**\n\nNow save the document \"\" which contains the Sketches that will define the hull shape, giving it some name that is descriptive\n\nOnce the Sketches have all been created and positioned, the document should look like this from the top view \"\":\n\n![](images/Macro_Half-Hull_ModelUsage5.jpg )\n\nThe principal limitations for constructing the model are:\n\n- the stemline bottom should end at (0,0)\n- the bottom centremost end of each cross-section should end at the Y axis - note that it can have any Z value\n\nThis concludes the first step which is one of creating the data which the macro will use to create both half-hulls and complete-hulls. The second step is described in the following section which is titled User Interface\n\n## User Interface \n\nIn this step the macro will gather some information from the user and then process the input Sketches to generate the desired hull models. This is the only GUI image for the macro and is primarily configuration details for the production of the hull models from the Sketches:\n\n![](images/Macro_Half-Hull_ModelScreenSnapshot2.jpg )\n\nThe choices on the GUI window are:\n\n- Starboard half-hull\n - checking this will cause the macro to produce a starboard half-hull model\n - Mounting plaque\n - if checked the macro will mount the half-hull on a plaque\n - Allow space for keel\n - if checked will cause the half hull to be mounted higher on the plaque than the centre position, this is so a separately generated keel could be placed below the hull\n- Port half-hull\n - checking this will cause the macro to produce a port half-hull model\n - Mounting plaque\n - if checked the macro will mount the half-hull on a plaque\n - Allow space for keel\n - if checked will cause the half hull to be mounted higher on the plaque than the centre position, this is so a separately generated keel could be placed below the hull\n- Complete hull\n - checking this will cause the macro to produce a complete model\n - Bottle for complete hull\n - if checked the macro will place the complete hull inside a transparent bottle (complete with cork)\n - Allow space for keel\n - if checked will cause the half hull to be positioned higher in the bottle than the centre position, this is so a separately generated keel could be placed below the hull\n- Bulkheads for flush deck\n - checking this will cause the macro to produce bulkheads whose tops are level with the top of the hull, bulkheads will not be generated for the most forward 2 cross-sections or the aft-most 2 cross-sections\n- Bulkheads for coachhouse\n - checking this will cause the macro to produce bulkheads whose tops are possibly above the top of the hull.\n - Bulkheads to skip at bow determines how many cross-sections will be left without a bulkhead at the bow\n - Bulkheads to skip at stern determines how many cross-sections will be left without a bulkhead at the stern\n- The dimensions of the top of the bulkheads will be configured as per the following diagram:\n ![](images/Macro_Half-Hull_ModelUi1.jpg )\n- Cancel button\n - the execution is halted and the window closes\n- Re-Use Last File button\n - the execution uses the data file AND SETTINGS from the the last run, any changes to settings are ignored\n- Select File button\n - the standard Open File window is opened where the user can either select a file or Cancel and exit\n\nWhen the macro runs it takes configuring data from the user and then reads Sketcher sketches in the selected input file.\n\nNote: As the macro works through the Sketches it prints out any exceptions as well as some milestones on the Report View. If you get unexpected results or some parts are missing, that is probably the first place to check.\n\n## Options\n\nThere are various types of bows and sterns for boats, with sterns having much more variety than bows. Here are examples of transoms and bows from the real world alongside the similar macro output:\n\n**Sheer Stern**\n\nProbably the most common stern, typical of all sizes of vessels from commercial ships through to rowing boats.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n![](images/Macro_Half-Hull_ModelOption1.jpg )\n\n\n\n\n![](images/Macro_Half-Hull_ModelOption2.jpg )\n\n\n
\n\n- the XY transom should be as close to the aftmost cross-section as is possible.\n\n**Sugar-Scoop Stern**\n\nMost likely to be found on a sailing yacht, it is a product of designing to maximise the length of the waterline to benefit from class rules for racing under sail.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n![](images/Macro_Half-Hull_ModelOption3.jpg )\n\n\n\n\n![](images/Macro_Half-Hull_ModelOption4.jpg )\n\n\n
\n\n- place the aftmost 2 cross-sections as close as is feasible, then rotate the aftmost of the two through to an angle of 45 degrees (or whatever is called for) around the X-axis\n\n**Canoe Stern**\n\nFound on all sizes of water craft, power and sail, pleasure and commercial.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n![](images/Macro_Half-Hull_ModelOption5.jpg )\n\n\n\n\n![](images/Macro_Half-Hull_ModelOption6.jpg )\n\n\n
\n\n- place the aftmost 2 cross-sections as close as is feasible, then rotate the aftmost of the two through to an angle of 45 degrees around the X-axis\n\n**Normal Bow**\n\nThere is a lot less variety in bow shapes than with transoms:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n![](images/Macro_Half-Hull_ModelOption7.jpg )\n\n\n\n\n![](images/Macro_Half-Hull_ModelOption8.jpg )\n\n\n
\n\n**Trireme Bow**\n\nAlthough not seen very frequently in the last 2 millenia, this was once the definitive bow profile for war-making vessels:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n![](images/Macro_Half-Hull_ModelOption9.jpg )\n\n\n\n\n![](images/Macro_Half-Hull_ModelOption10.jpg )\n\n\n
\n\n- in order for the bow to be correct the poly-line for the stemline needs to be drawn from the bottom to the top which will mean right to left in the Sketcher\n\n## Sample Files \n\nThese files are samples of Sketch data to use with the macro, mainly they are the models for the screen snapshots in the Options section above. The files work with the Macro and so can be downloaded and played with to adapt to your specific requirements. The prefix of 5x3 (for example) means the model has 5 cross-sections and 3 line segments per cross-section (i.e. sketch)\n\nTo use one of the example files, right-click on the file link and select Save File As\\... from the menu. The filename will be specified, choose the desired folder/directory to hold the example file.\n\n- \\[\\| 3x1 hull\\] with the minimum number of Sketches (stemline, one cross-section, transom) with 1 line segment per Sketch \\<\\<\\<\\<\\< NOT CURRENTLY WORKING\n- \\[\\| 5x3 with normal bow\\]\n- \\[\\| 5x3 with trireme bow\\]\n- \\[\\| 5x3 with canoe stern\\]\n- \\[\\| 5x3 with sheer transom stern\\]\n- \\[\\| 5x3 with sugar scoop stern\\]\n- \\[\\| 5x5 workboat\\]\n- \\[\\| 7x5 pirate boat\\]\n- \\[\\| 12x3 sailing yacht\\]\n\n## Remarks\n\n- almost all the examples on this page are generated with only 3 line segments defining the side of the hull which gives a very faceted appearance, increasing the number of segments in each Sketch would generate a much smoother surface which would increase the realism\n- doesn\\'t do keels, skegs or rudders, in other words, it doesn\\'t do any of the wet area\n- doesn\\'t do square bows like push-boats or towed barges\n- doesn\\'t do submarines (although it will do the lower half of a submarine)\n\n## Known Problems \n\nThe \\'Ruled Surface\\' feature of FreeCAD is used to generate the hull sections from the Sketches. It can sometimes generate the wrong result and display a grater like surface instead of a smooth planar one. This will typically occur when the Sketches are rotated such as when a Sugar Scoop stern is modeled. Also angling a Sheer Transom stern can cause this. If it occurs then typically it will do so in either the half-hull models or the complete hull model - it never seems to occur in all three models for the same hull. Also it usually only happens at the extreme bow or stern. If it happens to section in the middle of the boat then most likely one of the Sketches was drawn in the wrong direction (i.e. either random sequence or top-down where as all lines should be drawn bottom-up)\n\nIt can usually be removed by using the following steps:\n\n- in the Model tab of the Combo View, click on the faulty segment to select it, the faulty segment will show as highlighted on the display\n- select the Data tab on the bottom half of the Combo View, the lower part of the window will have a Label \\\"Ruled Surface\\\" with a single parameter \\'Orientation\\'\n- there is a popup menu to the right which has the values \\'Automatic\\', \\'Forward\\', \\'Reversed\\', it will initially be set to \\'Automatic\\'\n- try one of the other settings (remembering the faulty segment must still be selected in the upper part of the Combo View) which will usually correct the problem\n\nThe following screen snapshot shows the relevant portion of the screen:\n\n![](images/Macro_Half-Hull_ModelKnownProblems1.jpg )\n\n## Future Possibilities \n\n- replace line segments of cross-sections with curved lines\n - this is just at the idea stage but would give a much smoother surface in the vertical dimension, however the horizontal surface would still be faceted as it is now\n- integrate with Draft workbench to produce drawings from models\n - an initial goal, but the feasibility has not been investigated\n- handle keels, skegs and rudders\n - one work around for keels with the present system is to model the keel as a half-hull on it\\'s own and then assemble it onto the bottom of the main hull; this would still do nothing for rudders and skegs though\n\n## Glossary\n\nAs with any ancient and practiced trade, a rich and sometimes confusing vocabulary has developed around ships, boats and nautical practices. In describing this macro it is both awkward and inefficient to describe the process without using the correct and accurate terms. The obvious problem is that the average lay person will be unfamiliar with such terminology, hence this vocabulary:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\naft\n\n\n\n\nthe rear aspect of anything on a boat\n\n\n
\n\n\n\n\n\n
\n\nchine\n\n\n\n\na planar facet of a hull, can be used to\n\n           approximate a curved surface or as a finished building technique\n\n\n
\n\n\n\n\n\n
\n\ncoachhouse\n\n\n\n\nthe part of the central deck which is raised above the deck level - usually to accommodate increased headroom in the interior of the boat\n\n\n
\n\n\n\n\n\n
\n\nflush deck\n\n\n\n\na deck that runs smoothly from the top of one side of the hull to the other, the converse to a coachhouse deck\n\n\n
\n\n\n\n\n\n
\n\nforward\n\n\n\n\nalso \\'fore\\'; the front aspect of anything on a boat\n\n\n
\n\n\n\n\n\n
\n\nport\n\n\n\n\nlefthand side looking forward\n\n\n
\n\n\n\n\n\n
\n\nstarboard\n\n\n\n\nrighthand side looking forward\n\n\n
\n\n\n\n\n\n
\n\nstemline\n\n\n\n\nthe sloped vertical edge which is the bow of a hull\n\n\n
\n\n\n\n\n\n
\n\ntransom\n\n\n\n\nthe curved top edge of the stern face which can be flat or curved\n\n\n
\n\n## Links\n\n- [Half Hull Model Ship](http://en.wikipedia.org/wiki/Half_hull_model_ship) (Wikipedia)\n- [Why Half Hulls](http://www.halfhullshipmodels.com/smf/discussions-of-half-hulls-and-ship-models/understanding-and-practising-half-hull-boat-modelling/?PHPSESSID=56fedd9f6fa2db453a77347f10d57b7f) (Maritime Half Hull Ship Models and Nautical Art website)\n- [Traditional Model Yacht Design](http://pages.swcp.com/usvmyg/design/design.htm) (US Vintage Model Yacht Group)\n\n## Script\n\n ToolBar Icon ![](images/Macro_Half_Hull_Model.png )\n\n**Macro_Half_Hull_Model.FCMacro** \n\nThis script is running bug free. But due to the large range of possible inputs it may fail for some inputs. If so please report it.\n\nThe script is too long for the Wiki to display so it must be copied or downloaded from [unabbreviated script on pastebin.com](http://pastebin.com/raw.php?i=tZMpUi6F)\n\n\n---\n⏵ [documentation index](../README.md) > Macro Half-Hull Model\n"} {"id": "freecad-docs:wiki/Macro_Megaminx.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Megaminx.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Megaminx.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "75d913653406fb7282b51494b8bc82c87549c3e0027dd2a9dbd4475c24fb7e73", "bytes": 2492, "tokens": 742, "text": "# Macro Megaminx\n{{Macro\n|Name=Macro_Megaminx\n|Icon=Macro_Megaminx.png\n|Description=This macro creates a virtual [https://en.wikipedia.org/wiki/Megaminx Megaminx].\n|Author=aleph0\n|SeeAlso=[Macro Rubik Cube](Macro_Rubik_Cube.md)\n|Date=2019-02-17\n|FCVersion=0.18 and higher\n|Download=[https://www.freecadweb.org/wiki/images/4/43/Macro_Megaminx.png ToolBar Icon]\n}}\n\n## Description\n\nThis macro creates a FreeCAD document containing a virtual a virtual [Megaminx](https://en.wikipedia.org/wiki/Megaminx) and enables you to manipulate it. It displays six views of the Megaminx including each of the twelve faces at least once. There are various arrows (each with a tooltip which will be displayed as long as you hover the mouse over it). By clicking on arrows you can rotate faces of the Megaminx, rotate the whole Megaminx, or rotate or reflect the history which it maintains of the rotations that you have done so far. There is also a Megaminx menu which is shown at the right of the menu bar as long as you have at least one Megaminx document open. From the menu you can display some help text, reset the Megaminx to its initial (solved) state, undo the last rotation (and remove it from the history), copy the history to the clipboard, step through the history, randomise the Megaminx, and enable or disable the echoing of rotations to the Report View. All of these functions can also be invoked by typing suitable commands into the Python console window.\n\nA history saved to the clipboard can be pasted into the Python console window or copied into a file which can be called as a macro into the active Megaminx document. You can have more than one Megaminx document open at a time, although only one can be active.\n\n## Script\n\nToolBar icon \"\"\n\n {{Codeextralink|https://raw.githubusercontent.com/rparkins999/Megaminx/master/Megaminx.FCMacro}}\n\n**Macro_Megaminx.FCMacro**\n\n![](images/Macro_Megaminx.png )\n\n\n## Use\n\nDownload the code from into your macro directory. Run the macro to create a Megaminx document. Then you can play with it. The history functions can be used to construct and save operators (aka algorithms) which do useful transformations on the Megaminx. A suitable set of these will give you a complete solution. The step_history function can be used to help you play back an operator onto a real Megaminx.\n\n\n---\n⏵ [documentation index](../README.md) > Macro Megaminx\n"} {"id": "freecad-docs:wiki/Macro_Recompute_Profiler.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Recompute_Profiler.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Recompute_Profiler.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0f38d6b80bcf048b48ffb23f16f417a80c279619c797bb62c6c3cf803029b545", "bytes": 7682, "tokens": 2574, "text": "# Macro Recompute Profiler\n{{Macro\n|Name=Macro Recompute Profiler\n|icone=Macro_Recompute_Profiler.png\n|Description=This macro is to help you find, what features cause long delays in updates to the project. It performs a recompute, measuring the time it takes to recompute each feature.\n|Author=DeepSOIC\n|Version=0.1\n|Date=2017-04-03\n|FCVersion=0.17.10644 and above\n|Download=[https://www.freecadweb.org/wiki/images/c/ca/Macro_Recompute_Profiler.png ToolBar Icon]\n}}\n\n## Description\n\nThis macro is to help you find, what features cause long delays in updates to the project. It performs a recompute, measuring the time it takes to recompute each feature.\n\n## Usage\n\nThis macro requires FreeCAD no less than 0.17.10644\n\nSave the macro to a file.\n\n1\\. Open your project\n\n2\\. Right-click an object in model tree, pick \\\"Mark to recompute\\\"\n\n3\\. Run this macro.\n\nA progress bar will appear. As each object is recomputed, a line is printed to Report View, containing the time and the label of the object. If any object fails to recompute, the macro will display an error message and terminate the process.\n\n## Macro\n\nToolBar Icon ![](images/Macro_Recompute_Profiler.png )\n\n**RecomputeProfiler.FCMacro**\n\n\n{{MacroCode|code=\n__Title__=\"Macro Recompute Profiler\"\n__Author__ = \"DeepSOIC\"\n__Version__ = \"0.1\"\n__Date__ = \"03.04.2017\"\n\n__Comment__ = \"Measures time it takes to recmpute features in a project\"\n__Wiki__ = \"https://www.freecadweb.org/wiki/index.php?title=Macro_Recompute_Profiler\"\n__Help__ = \"Right-click an object, and pick 'Mark to recompute', then run this macro. This will only profile recomputing the subgraph. To profile the whole project, right-click the project in tree view, and pick 'Mark to recompute', then run this macro. Results will be printed to report view.\"\n__Status__ = \"experimental\"\n__Requires__ = \"freecad 0.17.10644\"\n__Communication__ = \"https://forum.freecadweb.org/memberlist.php?mode=viewprofile&u=3888\" \n\nimport FreeCAD as App\n\nimport FreeCADGui as Gui\n\nclass ExecutionError(Exception):\n pass\n\nclass CancelError(Exception):\n pass\n\ndef execute(feature):\n feature.recompute()\n if 'Invalid' in feature.State:\n raise ExecutionError(\"Feature '{label}' failed to recompute\".format(label= feature.Label))\n\ndef msgbox(title, text):\n from PySide import QtGui\n mb = QtGui.QMessageBox()\n mb.setIcon(mb.Icon.Information)\n mb.setText(text)\n mb.setWindowTitle(title)\n mb.exec_()\n\ndef log(string):\n App.Console.PrintWarning(string+\"\\n\")\n\ndef getAllDependent(feat_list):\n '''getAllDependent(feat_list): gets all features that depend on features in feat_list, directly or indirectly.\n Returns a set. Features from feat_list are not included, unless there are interdependencies between them.'''\n\n list_traversing_now = feat_list\n set_of_deps = set()\n list_of_deps = []\n\n while len(list_traversing_now) > 0:\n list_to_be_traversed_next = []\n for feat in list_traversing_now:\n for dep in feat.InList:\n if not (dep in set_of_deps):\n set_of_deps.add(dep)\n list_of_deps.append(dep)\n list_to_be_traversed_next.append(dep)\n\n list_traversing_now = list_to_be_traversed_next\n\n return set_of_deps\n\n\ndef run():\n touched = [obj for obj in App.ActiveDocument.Objects if 'Touched' in obj.State]\n\n if len(touched) == 0:\n App.ActiveDocument.RecomputesFrozen = True\n msgbox(\"Macro Recompute Profiler\", \"Project was switched to suspend recomputes. Please modify an object that triggers a recompute, and run this macro again. The macro will perform a step-by-step recompute, and measure the time it takes to recompute features.\")\n return\n\n log(\"{n} features are touched\".format(n= len(touched)))\n\n log(\"Generating execution order...\")\n\n to_be_executed = set.union(getAllDependent(touched), set(touched))\n log(\"Number of features to execute: {n}\".format(n= len(to_be_executed)))\n\n exec_list = []\n for obj in App.ActiveDocument.TopologicalSortedObjects[::-1]:\n if obj in to_be_executed:\n exec_list.append(obj)\n assert(len(exec_list) == len(to_be_executed))\n n = len(exec_list)\n\n log(\"Execution order:\")\n for obj in exec_list:\n log(\" \"+obj.Label)\n\n\n import PySide\n progress = PySide.QtGui.QProgressDialog(u\"Preparing to recompute....\", u\"Abort\", 0, n+1)\n progress.setModal(True)\n progress.show()try:\n log(\"Recomputing... (time in seconds, label)\")\n import time\n for obj in exec_list:\n progress.setValue(progress.value()+1)\n progress.setLabelText(\"Recomputing {feature}...\".format(feature= obj.Label))\n if progress.wasCanceled():\n raise CancelError()\n\n time_start = time.time()\n try:\n execute(obj)\n finally:\n exec_time = time.time()-time_start\n log(\"\\t{time}\\t{label}\".format(time= exec_time, label= obj.Label))\n\n progress.setValue(n+1)\n msgbox(\"Macro Recompute Profiler\", \"Recompute completed. Results are in report view.\")\n\n for obj in exec_list:\n obj.purgeTouched()\n\n except Exception as err:\n msgbox(\"Macro Recompute Profiler\", \"An error occured: {err}\".format(err= str(err)))\n finally:\n progress.hide()\n App.ActiveDocument.RecomputesFrozen = False\n\nrun()\n}}\n\n\n## Post-processing results \n\nThe output of the macro will be interleaved with general messages produced by recomputing features. It generally looks like this:\n\n {{code|code=\nRecomputing... (time in seconds, label)\nSketcher::setUpSketch()-T:0\nSketcher::Solve()-DogLeg-T:0\n 0.00999999046326 Sketch - master section\n 0.0199999809265 Clone of Sketch - master section (2D)001\nSketcher::setUpSketch()-T:0\nSketcher::Solve()-DogLeg-T:0\n 0.00999999046326 Sketch013\nSketcher::setUpSketch()-T:0\nSketcher::Solve()-DogLeg-T:0\n 0.00999999046326 Sketch011\n 0.0 Clone of Sketch - master section (2D)\nSketcher::setUpSketch()-T:0\nSketcher::Solve()-DogLeg-T:0\n 0.0 Sketch008\n 0.130000114441 LinearArray\nSketcher::setUpSketch()-T:0\nSketcher::Solve()-DogLeg-T:0\n...\n}}\n\nThe result lines have an easy signature to separate them off: they start with a tab. So, if you copy-paste the whole chunk to a spreadsheet program, generic messages will end up in column 1, while the results are in columns 2 and 3. So, you can sort by column 2, to get a nice table like that:\n\n {{code|code=\n0.59100008 Slice\n0.352999926 Populate LinearArray with Compound\n0.160000086 CompoundFilter\n0.138999939 Cut\n0.130000114 LinearArray\n0.108999968 Fusion\n0.069999933 Moved CompoundFilter\n0.067000151 Module - spokes\n0.029999971 Sweep\n0.019999981 Clone of Sketch - master section (2D)001\n0.010999918 ArrayFilter003\n...\n}}\n\n(For MS-Excel, pasting right after copying text from report view doesn\\'t split it into columns, don\\'t know why\\... pasting the text to Notepad and re-copying it from Notepad and pasting to excel helps.)\n\n## FreeCAD version \n\nThis macro requires FreeCAD no less than 0.17.10644, which was the version where App.ActiveDocument.RecomputesFrozen became available. It might be functional with a bit older FreeCAD, but certainly won\\'t work with v0.16.\n\nThis macro was created using this version of FreeCAD:\n\n \n```python\nOS: Windows 10\nWord size of OS: 64-bit\nWord size of FreeCAD: 64-bit\nVersion: 0.17.10665 (Git)\nBuild type: Release\nBranch: master\nHash: 47847513a85ff6615774ef628230f79e37471daf\nPython version: 2.7.8\nQt version: 4.8.7\nCoin version: 4.0.0a\nOCC version: 7.0.0\n```\n\n\n---\n⏵ [documentation index](../README.md) > Macro Recompute Profiler\n"} {"id": "freecad-docs:wiki/Macro_Remove_parametric_history.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Remove_parametric_history.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Remove_parametric_history.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d1fd5cf8180e4d26c2505bf266b76c54d30935b6431cfe723afa3e4d7b146421", "bytes": 1079, "tokens": 385, "text": "# Macro Remove parametric history\n{{Macro\n|Name=Remove parametric history\n|Icon=Macro_Remove_parametric_history.png\n|Description=This will remove all parametric associativity from an object, leaving it as a \"dumb\" shape\n|Author=Yorik\n|Version=1.0\n|Date=2011-08-01\n|FCVersion=All\n|Download=[https://www.freecadweb.org/wiki/images/b/b7/Macro_Remove_parametric_history.png ToolBar Icon]\n}}\n\n## Description\n\nThis will remove all parametric associativity from an object, leaving it as a \\\"dumb\\\" shape\n\nBefore and after:\n\n![](images/RPH_before.png )\n\n![](images/RPH_after.png )\n\n## Script\n\n\nToolBar Icon ![](images/Macro_Remove_parametric_history.png )\n\n**Remove parametric history.FCMacro**\n\n\n{{MacroCode|code=\n\noriginalObject = FreeCAD.ActiveDocument.ActiveObject\nnewShape = originalObject.Shape.copy()\nnewName = FreeCAD.ActiveDocument.ActiveObject.Name\nFreeCAD.ActiveDocument.removeObject(newName)\nnewObject = FreeCAD.ActiveDocument.addObject(\"Part::Feature\",newName)\nnewObject.Shape = newShape\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > Macro Remove parametric history\n"} {"id": "freecad-docs:wiki/Macro_Template.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Template.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Template.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "9b2a0841c592953939bcf14fdc82aad187a168749b79d0410a08c570a879ed9f", "bytes": 3756, "tokens": 1095, "text": "# Macro Template\n{{Macro\n |Name=Macro_Template\n |Description=Minimum required text to publish the FreeCAD Addon.\n |Author=Screeneroner\n |Version=Template\n |Date=2023-09-28\n}}\n\n## THE GUIDE \n\nTo make your macro available in the Addon Manager, it must be published in the FreeCAD Repository. There are two ways to do it with and without GitHub. Publishing via GitHub requires its deep knowledge, which most of us haven\\'t. So here will be described the easiest way - without GitHub.\n\nActually the FreeCAD Repository is a wiki web page . Once you (by yourself) add here a link to the properly formatted wiki-page, you macros will be shown in the FreeCAD Addon Manager. To make changes to this repository page and pages with your macros, you should become a wiki-editor. You can\\'t register as the editor by yourself. Instead, you should send a private message to \\@yorik and/or \\@Kunda1 with request containing you login and preferred e-mail (the latest changes in getting wiki editing permissions you may find here ). Once you get a e-mail with admins response (be patient - it may request several days), follow the link in it activate your new account, then set a permanent password, and confirm your e-mail. Now you can start publishing your macros.\n\nThe following codes snippets you should use to create your own macro that will be available in the FreeCAD Addon Manager:\n\n1. for wiki page about your macro with its code inside\n2. for making your macro visible in the FreeCAD Addon Manager macros list.\n\n## 1. Code for pasting into your wiki page editor \n\nType in your web browser address (replace the placeholder \\'My_Macro_Name\\' with your real name). The prefix \\\"Macro\\_\\\" after the \\\"wiki.freecad.org/\\\" is mandatory. If the name is used - you will see its content. In this case, you should choose another macro name. If name is available - you will see an empty page with a link at its end \\\"create this page\\\". Click it to create your page and paste into the empty entry field this snippet:\n\n {{Macro\n |Name=Macro_Template\n |Description=Minimum required text to publish the FreeCAD Addon.\n |Author=Screeneroner\n |Version=Template\n |Date=2023-09-28\n }}\n ==Script==\n {{MacroCode|code=\n <nowiki>\n __Name__ = \"Macro_Template\"\n __Comment__ = \"This page contains the minimum required text to publish the FreeCAD Addon\"\n __Author__ = \"Screeneroner\"\n __Version__ = \"Template\"\n __Date__ = \"2023-08-01\"\n __Help__ = \"Use this text to start publishing your macro\"\n\n print(\"Hello World!\")\n </nowiki>\n }}\n\n## 2. Code for pasting into [Addon Macro Repository](https://wiki.freecad.org/index.php?title=Macros_recipes) \n\n * [Macro Template](Macro_Template.md): Macro Template for the new macro wiki page.\n\n## Script\n\nThis is the real script that just prints text \\\"Hello World!\\\" in the FreeCAD console. Once you create the wiki page about your macro and include it in Addon Manager Repository, you may install it and verify that the installed version of \\'your\\' macro really makes the given printout. If all working fine - you may start replacing dummy print with your real code.\n\n\n{{MacroCode|code=\n__Name__ = \"Macro_Template\"\n__Comment__ = \"This page contains the minimum required text to publish the FreeCAD Addon\"\n__Author__ = \"Screeneroner\"\n__Version__ = \"Template\"\n__Date__ = \"2023-08-01\"\n__Help__ = \"Use this text to start publishing your macro\"\n\nprint(\"Hello World!\")\n}}\n\n\n---\n⏵ [documentation index](../README.md) > Macro Template\n"} {"id": "freecad-docs:wiki/Macro_Wiki_Object_Properties_List_Generator_Basic_Version.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Wiki_Object_Properties_List_Generator_Basic_Version.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Wiki_Object_Properties_List_Generator_Basic_Version.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "493efc8c8be19b6dac80358f11f9a5c3da46889022bed54f1b42be7431df4034", "bytes": 8935, "tokens": 2673, "text": "# Macro Wiki Object Properties List Generator Basic Version\n{{Macro\n|Name=Wiki List Generator of Object Properties\n|Description=This macro generate properties list of selected object. List presented in wiki format into Python report view.\n|Author=Evgeniy\n|Date=2021-09\n|Version=0.1\n|SeeAlso=[Macro Wiki Object Properties List Generator](Macro_Wiki_Object_Properties_List_Generator.md)\n}}\n\n## Description\n\nThis simple macro generate properties list of selected object. The parameters list is printed to the [Report view](Report_view.md) of FreeCAD. This example is more educational in nature and is not applicable for use without editing after generate, since it includes absolutely all the parameters of the object. The lists of properties that are published in this wiki contain, as a rule, only unique parameters. The parameters inherited from the parents objects are not published.\n\n## Usage\n\n- Preparing:\n - Copy code of Macro from this page and place it in a new \\*.FCMacro file.\n - Save FCMacro file, and place it in the FreeCAD Macros folder.\n - Disable **Include a timecode for each entry** checkbox in Preferences -\\> General -\\> Output window (Tab).\n- First using:\n - Select (or create and select) object the type of you need in tree view.\n - Select Macro -\\> Macros\\... item in main menu.\n - In opened window find \\*.FCMacro file what you save letter and press **Execute** Button.\n- How to use again:\n - To quickly run this macro again, you can use keyboard shortcut **Shift+Ctrl+1** (on Windows) it will launch the last run macro.\n\n## Recommendations\n\nDo not delete spaces between lines. This is necessary to simplify the translation. Each line separated by a space will be considered a separate part for translation. When creating texts, always remember that large monolithic fragments of text are difficult for translators to translate.\n\n## Example of using \n\n- For example open the Arch Workbench\n- Create a Structure object.\n- Select the created Structure object.\n- Run the macro.\n- Copy the text from the report view and paste it in a wiki page and check the result.\n\n## Results of using \n\nThe results may look like this:\n\n\n## Properties\n\n### View\n\n- **Proxy|PythonObject**:\n\n\n{{TitleProperty|Component}}\n\n- **UseMaterialColor|Bool**: Use the material color as this object\\'s shape color, if available\n\n\n{{TitleProperty|Display Options}}\n\n- **BoundingBox|Bool**: Display object bounding box\n\n- **DisplayMode|Enumeration**: Set the display mode\n\n- **ShowInTree|Bool**: Show the object in the tree view\n\n- **Visibility|Bool**: Show the object in the 3d view\n\n\n{{TitleProperty|Nodes}}\n\n- **NodeColor|Color**: The color of the nodes line\n\n- **NodeLine|Float**: The width of the nodes line\n\n- **NodeSize|Float**: The size of the node points\n\n- **NodeType|Enumeration**: The type of structural node\n\n- **ShowNodes|Bool**: If the nodes are visible or not\n\n\n{{TitleProperty|Object Style}}\n\n- **AngularDeflection|Angle**: Specify how finely to generate the mesh for rendering on screen or when exporting.\n\nThe default value is 28.5 degrees, or 0.5 radians. The smaller the value the smoother the appearance in the 3D view, and the finer the mesh that will be exported.\n\n- **Deviation|FloatConstraint**: Sets the accuracy of the polygonal representation of the model\n\nin the 3D view (tessellation). Lower values indicate better quality. The value is in percent of object\\'s size.\n\n- **DiffuseColor|ColorList**: Object diffuse color.\n\n- **DrawStyle|Enumeration**: Defines the style of the edges in the 3D view.\n\n- **Lighting|Enumeration**: Set object lighting.\n\n- **LineColor|Color**: Set object line color.\n\n- **LineColorArray|ColorList**: Object line color array.\n\n- **LineMaterial|Material**: Object line material.\n\n- **LineWidth|FloatConstraint**: Set object line width.\n\n- **PointColor|Color**: Set object point color\n\n- **PointColorArray|ColorList**: Object point color array.\n\n- **PointMaterial|Material**: Object point material.\n\n- **PointSize|FloatConstraint**: Set object point size.\n\n- **ShapeColor|Color**: Set shape color\n\n- **ShapeMaterial|Material**: Shape material\n\n- **Transparency|Percent**: Set object transparency\n\n\n{{TitleProperty|Selection}}\n\n- **OnTopWhenSelected|Enumeration**: Enabled: Display the object on top of any other object when selected\n\nObject: On top only if the whole object is selected Element: On top only if some sub-element of the object is selected\n\n- **Selectable|Bool**: Set if the object is selectable in the 3d view\n\n- **SelectionStyle|Enumeration**: Set the object selection style\n\n### Data\n\n- **Placement|Placement**:\n\n- **Proxy|PythonObject**:\n\n- **Shape|Part::PropertyPartShape**:\n\n- **Visibility|Bool**:\n\n\n{{TitleProperty|Base}}\n\n- **ExpressionEngine|ExpressionEngine|Hidden**: Property expressions\n\n- **Label|String**: User name of the object (UTF8)\n\n- **Label2|String|Hidden**: User description of the object (UTF8)\n\n\n{{TitleProperty|Component}}\n\n- **Additions|LinkList**: Other shapes that are appended to this object\n\n- **Axis|Link**: An optional axis or axis system on which this object should be duplicated\n\n- **Base|Link**: The base object this component is built upon\n\n- **CloneOf|Link**: The object this component is cloning\n\n- **HiRes|Link**: An optional higher-resolution mesh or shape for this object\n\n- **HorizontalArea|Area**: The area of the projection of this object onto the XY plane\n\n- **Material|Link**: A material for this object\n\n- **MoveBase|Bool**: Specifies if moving this object moves its base instead\n\n- **MoveWithHost|Bool**: Specifies if this object must move together when its host is moved\n\n- **PerimeterLength|Length**: The perimeter length of the horizontal area\n\n- **StandardCode|String**: An optional standard (OmniClass, etc\\...) code for this component\n\n- **Subtractions|LinkList**: Other shapes that are subtracted from this object\n\n- **VerticalArea|Area**: The area of all vertical faces of this object\n\n\n{{TitleProperty|IFC}}\n\n- **IfcData|Map**: IFC data\n\n- **IfcProperties|Map**: IFC properties of this object\n\n- **IfcType|Enumeration**: The type of this object\n\n\n{{TitleProperty|IFC Attributes}}\n\n- **Description|String**: Description of IFC attributes are not yet implemented\n\n- **GlobalId|String**: Description of IFC attributes are not yet implemented\n\n- **ObjectType|String**: Description of IFC attributes are not yet implemented\n\n- **PredefinedType|Enumeration**: Description of IFC attributes are not yet implemented\n\n- **Tag|String**: Description of IFC attributes are not yet implemented\n\n\n{{TitleProperty|Structure}}\n\n- **FaceMaker|Enumeration**: The facemaker type to use to build the profile of this object\n\n- **Height|Length**: The height or extrusion depth of this element. Keep 0 for automatic\n\n- **Length|Length**: The length of this element, if not based on a profile\n\n- **Nodes|VectorList**: The structural nodes of this element\n\n- **NodesOffset|Distance**: Offset distance between the centerline and the nodes line\n\n- **Normal|Vector**: The normal extrusion direction of this object (keep (0,0,0) for automatic normal)\n\n- **Profile|String**: A description of the standard profile this element is based upon\n\n- **Tool|Link**: An optional extrusion path for this element\n\n- **Width|Length**: The width of this element, if not based on a profile\n\n\n## Script\n\n {{MacroCode|code= \n#! python\n# -*- coding: utf-8 -*-\n# (c) 2021 <Evgeniy> LG\nfrom FreeCAD import Qt\n\ndef print_obj_properties(obj,typ):\n prop={}\n i=1\n for pr in obj.PropertiesList:\n tp = obj.getTypeIdOfProperty(pr) or \"\"\n atr = obj.getTypeOfProperty(pr) or (\"\")\n # Wiki template supports only Hidden type of property. But it can be as: Hidden,Output,Readonly etc...\n if atr != \"\" and atr[0] == \"Hidden\":\n atr = \"|\"+atr[0]\n else:\n atr = \"\" \n prop[str(i)] = pr,obj.getGroupOfProperty(pr),tp.replace(\"App::Property\",\"\"),obj.getDocumentationOfProperty(pr),atr\n i+=1\n sorted_prop = sorted(prop.items(), key=lambda x: x[1][1])\n\n title=\"\"\n for pr in sorted_prop:\n if title != pr[1][1]:\n title = pr[1][1]\n print(\"\\n\"+\"{{TitleProperty{\"+title+\"}}\")\n print(\"\\n\"+\"* {{Property\"+typ+\"{\"+pr[1][0]+\"{\"+pr[1][2]+pr[1][4]+\"}}: \"+pr[1][3])\n\nprint(\"\\n\"+\"==Properties==\")\nprint(\"\\n\"+\"===View===\")\nobj = Gui.activeDocument().ActiveObject\nprint_obj_properties(obj,\"View\")\nprint(\"\\n\"+\"===Data===\")\nobj = FreeCAD.activeDocument().ActiveObject\nprint_obj_properties(obj,\"Data\")\n\n}}\n\n## Links\n\nThe discussion on the forum: \n\n\n---\n⏵ [documentation index](../README.md) > Macro Wiki Object Properties List Generator Basic Version\n"} {"id": "freecad-docs:wiki/Macro_Z_height_map.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Macro_Z_height_map.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Macro_Z_height_map.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2530880fb961dc4d19b08108a2ef6e902de09b4c60cdb9404670c8ad78cb835c", "bytes": 146, "tokens": 63, "text": "# Macro Z height map\n1. REDIRECT [Macro_Z_Height_Map](Macro_Z_Height_Map.md)\n\n\n---\n⏵ [documentation index](../README.md) > Macro Z height map\n"} {"id": "freecad-docs:wiki/Mesh_Difference.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_Difference.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_Difference.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "42ebd813e2a3925510c597a4a6c4491cf67a7fd600f05f92ff0fb384375fcfa2", "bytes": 1377, "tokens": 444, "text": "---\n GuiCommand:\n Name: Mesh Difference\n MenuLocation: Meshes , Boolean , Difference\n Workbenches: Mesh_Workbench\n SeeAlso: Mesh_Union, Mesh_Intersection\n---\n\n# Mesh Difference\n\n## Description\n\nThe **Mesh Difference** command creates a new non-parametric mesh object, a [Mesh Feature](Mesh_Feature.md), that is the difference of two mesh objects: one mesh object is cut from the other.\n\n[OpenSCAD](http://www.openscad.org/) must be installed to use this command, and the path to its executable must be set in the [OpenSCAD preferences](OpenSCAD_Preferences.md).\n\n ![](images/Mesh_Difference_example.png ) \n*On the left two mesh objects, on the right the mesh object that is the difference of those objects if the cube is selected as the main object*\n\n## Usage\n\n1. Select the main mesh object.\n2. Add the mesh object you want to cut from the main object to the selection. The mesh objects must overlap.\n3. There are several ways to invoke the command:\n - Press the ** [Difference](Mesh_Difference.md)** button.\n - Select the **Meshes → Boolean → Difference** option from the menu.\n\n## Properties\n\nSee: [Mesh Feature](Mesh_Feature.md).\n\n\n {{Mesh Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh Difference\n"} {"id": "freecad-docs:wiki/Mesh_Evaluation.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_Evaluation.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_Evaluation.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a6941876cce8e7d159cf205b63fb299e7bc2fe91cd80d2804ced27a65e4889dc", "bytes": 3455, "tokens": 1018, "text": "---\n GuiCommand:\n Name: Mesh Evaluation\n MenuLocation: Meshes , Analyze , Evaluate and repair mesh...\n Workbenches: Mesh_Workbench\n---\n\n# Mesh Evaluation\n\n## Description\n\nThe **Mesh Evaluation** command evaluates and repairs a mesh object.\n\n \"\" \n*The Evaluate & Repair Mesh dialog box with the Folds on surface option enabled*\n\n## Usage\n\n1. Optionally select a single mesh object.\n2. There are several ways to invoke the command:\n - Press the ** [Evaluate and repair mesh...](Mesh_Evaluation.md)** button.\n - Select the **Meshes → Analyze → Evaluate and repair mesh...** option from the menu.\n3. The **Evaluate & Repair Mesh** dialog box opens.\n4. Optionally press the **Settings...** button to change the following settings:\n - \n **Check for non-manifold points**\n \n\n - \n **Enable check for folds on surface**\n \n\n - \n **Only consider zero area faces as degenerated**\n \n5. If you have not yet selected a mesh object: select one from the dropdown list at the top of the dialog box.\n6. The dialog contains 7 or 8 (if the **Folds on surface** option is enabled) test options.\n7. Do not use the checkboxes, they will be checked automatically if errors are found.\n8. Press any of the **Analyze** buttons to start a test.\n9. Or use the **Analyze** button from the **All above tests together** option to run all 7 or 8 tests together.\n10. Errors will be indicated in the dialog box, and also, with yellow and red markers, in the [3D view](3D_view.md).\n11. Optionally press one or more **Repair** buttons to repair the errors that were found.\n12. Optionally press the **Reset** button to reset all test results. This will reset the dialog and remove the colored markers from the 3D view. If you want to repeat the same test or run all tests together there is no need to do this.\n13. Optionally select a different mesh object from the dropdown list to continue testing and repairing.\n14. Press the **Close** button to close the dialog box and finish the command.\n15. The **Refresh** button does not work properly at this time.\n\n## Notes\n\n- Repairing a mesh can mean that problematic elements are deleted from the mesh resulting in holes. Holes can be closed with the [Mesh FillupHoles](Mesh_FillupHoles.md), [Mesh FillInteractiveHole](Mesh_FillInteractiveHole.md) and [Mesh AddFacet](Mesh_AddFacet.md) commands.\n- See [this forum post](https://forum.freecadweb.org/viewtopic.php?f=3&p=533252#p533252) for an explanation of the mesh data structure. This information may help to understand why a mesh has problems.\n\n## Preferences\n\n- The **Check for non-manifold points** setting is stored: **Tools → Edit parameters... → BaseApp → Preferences → Mod → Mesh → Evaluation → CheckNonManifoldPoints**.\n- The **Enable check for folds on surface** setting is stored: **Tools → Edit parameters... → BaseApp → Preferences → Mod → Mesh → Evaluation → EnableFoldsCheck**.\n- The **Only consider zero area faces as degenerated** setting is stored: **Tools → Edit parameters... → BaseApp → Preferences → Mod → Mesh → Evaluation → StrictlyDegenerated**.\n\n\n {{Mesh Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh Evaluation\n"} {"id": "freecad-docs:wiki/Mesh_FillHoles.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_FillHoles.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_FillHoles.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "64ae3c15f2b65261846c6d49ddfef9e20590e25e0b4f702bbaa8128257d3937a", "bytes": 162, "tokens": 77, "text": "# Mesh FillHoles\n1. REDIRECT [Mesh_FillupHoles](Mesh_FillupHoles.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh FillHoles\n"} {"id": "freecad-docs:wiki/Mesh_FlipNormals.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_FlipNormals.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_FlipNormals.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "fff031b980363db2d8008048b63d1134eefcd1b50cb8f1891f313d034e87fd12", "bytes": 1122, "tokens": 371, "text": "---\n GuiCommand:\n Name: Mesh FlipNormals\n MenuLocation: Meshes , Flip normals\n Workbenches: Mesh_Workbench\n SeeAlso: Mesh_HarmonizeNormals\n---\n\n# Mesh FlipNormals\n\n## Description\n\nThe **Mesh FlipNormals** command reverses, flips, the normals of mesh objects.\n\n## Usage\n\n1. Select one or more mesh objects.\n2. There are several ways to invoke the command:\n - Press the ** [Flip normals](Mesh_FlipNormals.md)** button.\n - Select the **Meshes → Flip normals** option from the menu.\n\n## Notes\n\n- For a clear indication of the orientation of the faces of mesh objects make sure the **Lighting** property of the mesh objects is set to {{Value|One side}}. The color of the back side of their faces will then depend on the backlight settings: **Edit → Preferences... → Display → 3D View → Backlight color - Intensity**. See: [Preferences Editor](Preferences_Editor#3D_View.md).\n\n\n {{Mesh Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh FlipNormals\n"} {"id": "freecad-docs:wiki/Mesh_RemoveComponents.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_RemoveComponents.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_RemoveComponents.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d403dbdcb3cbe66ab2d317bab99e3f70104960220e7f98eea5f4af4244a36ab6", "bytes": 2620, "tokens": 742, "text": "---\n GuiCommand:\n Name: Mesh_RemoveComponents\n MenuLocation: Meshes , Remove components...\n Workbenches: Mesh_Workbench\n SeeAlso: Mesh_RemoveCompByHand, Arch_SplitMesh\n---\n\n# Mesh RemoveComponents\n\n## Description\n\nThe **Mesh RemoveComponents** command removes faces from mesh objects.\n\n \"\" \n*The Remove components task panel*\n\n## Usage\n\n1. The command uses the color red to mark selected faces. To see them properly:\n - The **Display Mode** of the mesh objects ideally should be {{Value|Flat lines}}, but should at least show faces. If necessary use the [Std DrawStyle](Std_DrawStyle.md) command to override this property.\n - The **Shape Color** of the mesh objects should not be red.\n2. There are several ways to invoke the command:\n - Press the ** [Remove components...](Mesh_RemoveComponents.md)** button.\n - Select the **Meshes → Remove components...** option from the menu.\n3. The **Remove components** task panel opens.\n4. Use one or more of the **Select** options to select faces:\n - Press the **Region** button and while holding down the left mouse button draw a region, a closed spline, in the [3D view](3D_view.md). Faces that match the **Region options** and (partially) fall inside the region will be selected.\n - Press the **All** button to select all faces.\n - Press the **Components** button to select all components with fewer than the specified maximum number of faces. Here a component refers to a complete group of connected faces. Usually a mesh object contains a single component. But, for example after using the [Mesh Merge](Mesh_Merge.md) command, a mesh object can contain multiple components.\n - Press the **Pick triangle** button to select a single face in the 3D view. If the **Select whole component** option is checked, selecting a face will result in selecting the entire component the face belongs to.\n5. Optionally use one or more of the **Deselect** options to deselect faces. These options are identical to the **Select** options, except that the number of faces for the **Components** button is a minimum number.\n6. Optionally press the **Invert** button to invert the selection.\n7. Press the **Delete** button to delete the selected faces.\n8. Press the **Close** button to close the task panel and finish the command.\n\n\n {{Mesh Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh RemoveComponents\n"} {"id": "freecad-docs:wiki/Mesh_SectionByPlane.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_SectionByPlane.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_SectionByPlane.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7aee63962bed52b92918b677b65d8b3b443202b589160f8f5e4e2a3da7ce3cf8", "bytes": 1792, "tokens": 640, "text": "---\n GuiCommand:\n Name: Mesh SectionByPlane\n MenuLocation: Meshes , Cutting , Create section from mesh and plane\n Workbenches: Mesh_Workbench\n SeeAlso: Mesh_CrossSections\n---\n\n# Mesh SectionByPlane\n\n## Description\n\nThe **Mesh SectionByPlane** command creates a cross section across a mesh object. The cross section is a [Part Feature](Part_Feature.md).\n\n## Usage\n\n1. Select a single mesh object and a single [Part plane](Part_Primitives.md). The (extended) plane should intersect the mesh object.\n2. There are several ways to invoke the command:\n - Press the ** [Create section from mesh and plane](Mesh_SectionByPlane.md)** button.\n - Select the **Meshes → Cutting → Create section from mesh and plane** option from the menu.\n\n## Properties\n\nSee: [Part Feature](Part_Feature.md).\n\n## Scripting\n\nSee also: [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nTo section a mesh use its `section` method. The method requires a second mesh object that need not be planar.\n\n \n```python\nimport FreeCAD as App\nimport Mesh\nimport Part\n\n# Create a non-parametric box-shaped mesh:\nmsh = App.ActiveDocument.addObject(\"Mesh::Feature\", \"Mesh\")\nmsh.Mesh = Mesh.createBox(30, 40, 50)\nmsh.ViewObject.DisplayMode = \"Flat Lines\"\n\n# Create a planar mesh from 3 points:\np1 = App.Vector(-20, -60, 0)\np2 = App.Vector(65, 25, 0)\np3 = App.Vector(-20, 25, 0)\nmsh_plane = Mesh.Mesh([p1, p2, p3])\n\n# Find the section loops (each loop is a list of points):\nloops = msh.Mesh.section(msh_plane)\n\n# Show the loop polygon:\nPart.show(Part.makePolygon(loops[0]))\n```\n\n\n {{Mesh Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh SectionByPlane\n"} {"id": "freecad-docs:wiki/Mesh_SegmentationBestFit.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_SegmentationBestFit.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_SegmentationBestFit.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5fdd01c30a4c0b2f19da5ab6abc2b5c05ff7872a6cceb9f375ce9b499da29ede", "bytes": 2711, "tokens": 776, "text": "---\n GuiCommand:\n Name: Mesh SegmentationBestFit\n MenuLocation: Meshes , Create mesh segments from best-fit surfaces...\n Workbenches: Mesh_Workbench\n SeeAlso: Mesh_Segmentation\n---\n\n# Mesh SegmentationBestFit\n\n## Description\n\nThe **Mesh SegmentationBestFit** command creates separate mesh segments for specified surface types of a mesh object. The command can also identify their parameters which can be useful when re-engineering a mesh object.\n\n## Usage\n\n1. If you plan to identify the parameters of a surface type, note that the command uses the color red to mark the faces selected for this option. To see them properly:\n - The **Display Mode** of the mesh object ideally should be {{Value|Flat lines}}, but should at least show faces. If necessary use the [Std DrawStyle](Std_DrawStyle.md) command to override this property.\n - The **Shape Color** of the mesh object should not be red.\n2. Select a single mesh object.\n3. There are several ways to invoke the command:\n - Press the ** [Create mesh segments from best-fit surfaces...](Mesh_SegmentationBestFit.md)** button.\n - Select the **Meshes → Create mesh segments from best-fit surfaces...** option from the menu.\n4. The **Mesh segmentation** task panel opens.\n5. Optionally press one of the **Parameters...** buttons to identify the parameters of a surface:\n - The **Surface fit** dialog box opens.\n - Select one or more faces belonging to the surface:\n - Press the **Region** button and while holding down the left mouse button draw a region, a closed spline, in the [3D view](3D_view.md). Faces that (partially) fall inside the region will be selected.\n - Press the **Triangle** button to select individual faces.\n - Optionally press the **Clear** button to clear the selection.\n - Press the **Compute** button to calculate the parameters.\n - Press the **OK** or **Cancel** button to close the dialog box.\n6. Select the surface type(s) you wish to create mesh segments for:\n - \n **Plane**\n \n\n - \n **Cylinder**\n \n\n - \n **Sphere**\n \n7. Specify the **Tolerance** values.\n8. Specify the **Minimum number of faces** values.\n9. Press the **OK** button.\n10. The command will create a [group](Std_Group.md) containing separate mesh objects, each a segment of the original mesh object.\n11. If the created group is empty try using the command again with modified settings.\n\n\n {{Mesh Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh SegmentationBestFit\n"} {"id": "freecad-docs:wiki/Mesh_to_Part.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Mesh_to_Part.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Mesh_to_Part.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "60321b1afba8c75d31111f1ad196653243b3ee7116d4108896bb631b1aa30f47", "bytes": 3764, "tokens": 1098, "text": "# Mesh to Part\n## Convert Part objects to meshes \n\nConverting higher-level objects such as [Part](Part_Workbench.md) shapes to simpler objects such as [meshes](Mesh_Workbench.md) is a pretty straightforward operation where all faces of a Part object get triangulated. The result of that triangulation (tessellation) is then used to construct a mesh:\n\n \n```python\nimport Mesh\n\nobj = FreeCADGui.Selection.getSelection()[0] # a Part object must be preselected\nshp = obj.Shape\nfaces = []\n\ntriangles = shp.tessellate(1) # the number represents the precision of the tessellation\nfor tri in triangles[1]:\n face = []\n for i in tri:\n face.append(triangles[0][i])\n faces.append(face)\n\nm = Mesh.Mesh(faces)\nMesh.show(m)\n```\n\nAlternative example:\n\n \n```python\nimport Mesh\nimport MeshPart\n\nobj = FreeCADGui.Selection.getSelection()[0] # a Part object must be preselected\nshp = obj.Shape\n\nmesh = FreeCAD.ActiveDocument.addObject(\"Mesh::Feature\", \"Mesh\")\nmesh.Mesh = MeshPart.meshFromShape(\n Shape=shp,\n LinearDeflection=0.01,\n AngularDeflection=0.025,\n Relative=False)\n```\n\n## Convert meshes to Part objects \n\nConverting meshes to Part objects is a common operation. Very often you will receive 3D data in a mesh format. Meshes are quite practical for representing free-form geometry and big visual scenes, as they are very lightweight. But in FreeCAD we generally prefer higher-level objects, solids, that can carry much more information and allow for curved faces.\n\nConverting meshes to those higher-level objects (handled by the [Part Workbench](Part_Workbench.md) in FreeCAD) is not an easy operation. Meshes can contain thousands of triangles (for example when generated by a 3D scanner), and solids made of the same number of faces would be extremely difficult to manipulate. So you generally want to optimize the object when converting.\n\nFreeCAD currently offers two methods to convert meshes to Part objects. The first method is a simple, direct conversion without any optimization:\n\n \n```python\nimport Mesh\nimport Part\n\nmesh = Mesh.createTorus()\nshape = Part.Shape()\nshape.makeShapeFromMesh(mesh.Topology, 0.05) # the second arg is the tolerance for sewing\nsolid = Part.makeSolid(shape)\nPart.show(solid)\n```\n\nThe second method offers the possibility to consider mesh facets co-planar when the angle between them is under a certain value, reducing the number of faces in the final result:\n\n \n```python\nimport Mesh\nimport Part\nimport MeshPart\n\nobj = FreeCADGui.Selection.getSelection()[0] # a Mesh object must be preselected\nmesh = obj.Mesh\nsegments = mesh.getPlanarSegments(0.00001) # use rather strict tolerance here\nfaces = []\n\nfor i in segments:\n if len(i) > 0:\n # a segment can have inner holes\n wires = MeshPart.wireFromSegment(mesh, i)\n # we assume that the exterior boundary is that one with the biggest bounding box\n if len(wires) > 0:\n ext = None\n max_length=0\n for i in wires:\n if i.BoundBox.DiagonalLength > max_length:\n max_length = i.BoundBox.DiagonalLength\n ext = i\n\n wires.remove(ext)\n # all interior wires mark a hole and must reverse their orientation, otherwise Part.Face fails\n for i in wires:\n i.reverse()\n\n # make sure that the exterior wires comes as first in the list\n wires.insert(0, ext)\n faces.append(Part.Face(wires))\n\nsolid = Part.Solid(Part.Shell(faces))\nPart.show(solid)\n```\n\n {{Mesh Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Developer Documentation](Category_Developer%20Documentation.md) > [Python Code](Category_Python%20Code.md) > [Mesh](Mesh_Workbench.md) > Mesh to Part\n"} {"id": "freecad-docs:wiki/OpenSCAD_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/OpenSCAD_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/OpenSCAD_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "4e1615e402f987bd6dbb480aa5d30c64dbe128e8dcec18d5a26c5f3c13790966", "bytes": 9442, "tokens": 2846, "text": "# \"OpenSCAD OpenSCAD Workbench\n\n \n\n## Introduction\n\nThe \"\" [OpenSCAD Workbench](OpenSCAD_Workbench.md) is intended to offer interoperability with the open source software [OpenSCAD](http://www.openscad.org/). This program is not distributed as part of FreeCAD, but should be installed to make full use of this workbench. OpenSCAD should not be confused with [OpenCASCADE](OpenCASCADE.md), which is the geometrical kernel that FreeCAD uses to build geometry on screen. The OpenCASCADE libraries are always needed to use FreeCAD, while the OpenSCAD executable is entirely optional.\n\nIt contains a [CSG](OpenSCAD_CSG.md) importer to open the CSG files from OpenSCAD, and an exporter to output a CSG based tree. Geometry which is not based on CSG operations will be exported as a mesh.\n\nThis workbench contains functions to modify the CSG feature tree and repair models. It also contains general purpose tools that do not require installation of OpenSCAD; they can be used in conjunction with other workbenches. For example, the [Mesh Workbench](Mesh_Workbench.md) internally uses the OpenSCAD functions to perform operations with [meshes](mesh.md), as they are quite robust.\n\n ![](images/OpenSCADexamaple1.png ) \n\n## Dependencies\n\nIn FreeCAD 0.19, the Ply (Python-Lex-Yacc) module, which is used to import CSG files, was removed from the FreeCAD source code, as it is a third party library not developed by FreeCAD. As a result, you now need to install Ply before using the OpenSCAD Workbench. When using a pre-packaged, stable version of FreeCAD this dependency should be installed automatically in all platforms; in other cases, for example, when [compiling](Compiling.md) from source, you may have to install it from an online repository.\n\nIn openSUSE this is done by:\n\n \n```python\nsudo zypper install python3-ply\n```\n\nIn Debian/Ubuntu based systems this is done like the following:\n\n \n```python\nsudo apt install python3-ply\n```\n\nThe general installation in all platforms can be done from the Python package index.\n\n \n```python\npip3 install --user ply\n```\n\n## OpenSCAD language and file format \n\nThe OpenSCAD language allows the use of variables and loops. It allows you to specify sub-modules to reuse geometry and code. This high degree of flexibility makes parsing very complex. Currently the OpenSCAD Workbench cannot handle the OpenSCAD language natively. Instead, if OpenSCAD is installed, it can be used to convert the input to the CSG format, which is a subset of the OpenSCAD language, and can be used as the input to OpenSCAD for further processing. During conversion all parametric behavior is lost, meaning that all variable names are discarded, loops expanded, and mathematical expressions evaluated.\n\n## Tools\n\n- \"\" [Color Code Shape](OpenSCAD_ColorCodeShape.md): Change the color of selected or all shapes based on their validity.\n- \"\" [Replace Object](OpenSCAD_ReplaceObject.md): Replace an object in the feature tree.\n- \"\" [Remove Subtree](OpenSCAD_RemoveSubtree.md): Removes the selected objects and all children that are not referenced from other objects.\n- \"\" [Refine Shape Feature](OpenSCAD_RefineShapeFeature.md): Cleans unnecessary lines.\n- \"\" [Mirror Mesh Feature](OpenSCAD_MirrorMeshFeature.md): Create Mirror Mesh Feature.\n- \"\" [Scale Mesh Feature](OpenSCAD_ScaleMeshFeature.md): Scale a Mesh Feature.\n- \"\" [Resize Mesh Feature](OpenSCAD_ResizeMeshFeature.md): Resize a Mesh Feature.\n- \"\" [Increase Tolerance Feature](OpenSCAD_IncreaseToleranceFeature.md): Increases tolerance of edges/faces/vertex of selected object(s).\n- \"\" [Convert Edges To Faces](OpenSCAD_Edgestofaces.md): Convert edges to faces. Useful to prepare imported DXF geometry for extrusion.\n- \"\" [Expand Placements](OpenSCAD_ExpandPlacements.md): Expand all placements downwards the FeatureTree.\n- \"\" [Explode Group](OpenSCAD_ExplodeGroup.md): Explodes fused part primitives.\n- \"\" [Add OpenSCAD Element](OpenSCAD_AddOpenSCADElement.md): Add an OpenSCAD element by entering OpenSCAD code into the task panel.\n- \"\" [Mesh Boolean](OpenSCAD_MeshBoolean.md): Creates new mesh object by boolean operation from shapes.\n- \"\" [Hull](OpenSCAD_Hull.md): Applies a hull to selected shapes.\n- \"\" [Minkowski](OpenSCAD_Minkowski.md): Applies a minkowski sum to selected shapes.\n\n## Preferences\n\n- \"\" [Preferences](OpenSCAD_Preferences.md): preferences available for the OpenSCAD tools.\n\n## Limitations\n\nOpenSCAD creates constructive solid geometry, as well as imports mesh files and extrudes 2D geometry from [DXF](DXF.md) files. FreeCAD allows you to create CSG with primitives as well. The FreeCAD geometry kernel (OCCT) works using a boundary representation. Therefore conversion from CSG to BREP should, in theory, be possible whereas conversion from BREP to CSG is, in general, not.\n\nOpenSCAD works internally on meshes. Some operations which are useful on meshes are not meaningful on a BREP model and can not be fully supported. Among these are convex hull, minkowski sum, glide and subdiv. Currently we run the OpenSCAD binary in order to perform hull and minkwoski operations and import the result. This means that the involved geometry will be triangulated. In OpenSCAD non-uniform scaling is often used, which does not impose any problems when using meshes. In our geometry kernel geometric primitives (lines, circular sections, etc) are converted to BSpline prior to performing such deformations. Those BSplines are known to cause trouble in later boolean operations. An automatic solution is not available at the moment. Please feel free to post to the forum if you encounter such problems. Often such problems can be solved be remodeling small parts. A deformation of a cylinder can substituted by an extrusion of an ellipses.\n\n## Importing text \n\nImporting OpenSCAD code with texts requires that the fonts that are used are properly installed on your system. You can verify this by opening OpenSCAD as a standalone tool and checking the list in **Help → Font List**. The list will also give you the correct font names. If a font does not appear in the list after installing, you may have to manually copy the font file to the appropriate system directory.\n\nImporting texts is relatively slow. Behind the scenes FreeCAD uses a DXF file created by OpenSCAD. The more contours there are the slower the import.\n\nIt can be a good idea to first import a simple test case (replace {{Incode|NameOfFont}} with the correct font name):\n\n\n TESTFONT=\"NameOfFont\";\n linear_extrude(0.001) {\n text(\"A\", size=5, font=TESTFONT, script=\"Latn\");\n };\n\n\nThe {{Incode|script=\"Latn\"}} parameter can be left out here, but is required if the text string does not contain any letters, but only punctuation and/or numbers.\n\nPlease note that {{Incode|use ;}} statements in your source files are ignored when importing in FreeCAD. Under OpenSCAD the effect of a {{Incode|use}} statement is that the provided font file is temporarily added to the list of known fonts (although even there the statement does not work when a script is modified interactively).\n\n## Hints\n\nWhen importing [DXF](DXF.md) set the Draft precision to a sensible amount as this will affect the detection of connected edges.\n\nIf FreeCAD crashes when importing CSG, it is strongly recommended that you enable \\\"automatically check model after boolean operation\\\" in **Menu → Edit → Preferences → Part Design → Model setting**.\n\n## Tutorials\n\n- [Import OpenSCAD code](Import_OpenSCAD_code.md)\n\n## Links\n\n- The official OpenSCAD project source code repository hosted on [GitHub](https://github.com/openscad/openscad)\n- Open tickets tagged \\\"OpenSCAD\\\" on the [FreeCAD Github issue tracker](https://github.com/FreeCAD/FreeCAD/labels/WB%20OpenSCAD). There are also tickets on the now archived [mantis bugtracker](https://freecadweb.org/tracker/search.php?tag_string=OpenSCAD).\n- Models tagged with \\\"OpenSCAD\\\" on [Thingiverse](http://www.thingiverse.com/tag:openscad)\n\n\n {{OpenSCAD Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Workbenches](Category_Workbenches.md) > [OpenSCAD](Category_OpenSCAD.md) > OpenSCAD Workbench\n"} {"id": "freecad-docs:wiki/PDF.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PDF.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PDF.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f6179249965d55f62b5baa0fb20a47b349b2024d15d26b381c38a717e39faabe", "bytes": 1740, "tokens": 539, "text": "# PDF\n## Description\n\n[Portable Document Format](https://en.wikipedia.org/wiki/PDF) (PDF) is a file format developed by Adobe in the 1990s to present documents, including text and images.\n\nPDF is based on the PostScript language, which is a vector-based format to describe pages. In this sense it\\'s similar to [SVG](SVG.md), as it allows scaling a drawing to any size without losing its shape or amount of details.\n\nNevertheless, a PDF can contain many things, including text, fonts, vector graphics, and [bitmap](bitmap.md) images. PDF was standardized as an open format in 2008, as ISO 32000.\n\nPDF is commonly used as a sharing format, that is, to share documents, text, or images, that will display and print exactly as the author intended.\n\n## Usage\n\nAs FreeCAD is based on the Qt graphical toolkit, it can export the [3D view](3D_view.md) natively to PDF. This can be useful to export carefully created drawings that other users don\\'t need to modify. For example, pages created with the [TechDraw Workbench](TechDraw_Workbench.md) can be [exported](Std_Export.md) in this way for sharing or printing. In many cases it is also possible to perform two way conversion between PDF and [SVG](SVG.md).\n\nThe option to export to PDF is available in the **File → [Export PDF](Std_Export.md)** menu.\n\n## Related\n\n- See also: \"\" [Std Export](Std_Export.md) and \"\" [Std PrintPdf](Std_PrintPdf.md).\n\n- For [power users](Power_users_hub.md), there is an option to utilize the [Python console](Python_console.md) to export a PDF.\n\n\n---\n⏵ [documentation index](../README.md) > [File_Formats](Category_File_Formats.md) > PDF\n"} {"id": "freecad-docs:wiki/PartDesign_AdditivePipe.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PartDesign_AdditivePipe.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PartDesign_AdditivePipe.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "61674a685890d347055ae9baf3f0aab7e604cea675cc0daaff8002a200642ca5", "bytes": 8074, "tokens": 2330, "text": "---\n GuiCommand:\n Name: PartDesign AdditivePipe\n MenuLocation: Part Design , Create an additive feature , Additive pipe\n Workbenches: PartDesign_Workbench\n Version: 0.17\n SeeAlso: PartDesign_AdditiveLoft, PartDesign_SubtractivePipe\n---\n\n# PartDesign AdditivePipe\n\n## Description\n\n**Additive Pipe** creates a solid in the active Body by sweeping one or more sketches (also referred to as cross-sections) along an open or closed path. If the Body already contains features, the additive pipe will be merged to them.\n\n ![](images/PartDesign_AdditivePipe_example.svg ) \n*On the left: cross-sections (A) and (B) to be swept along path (C); resulting Additive pipe on the right.*\n\n## Usage\n\nThe example image above shows two different cross-section shapes. The text below will describe the procedure with a single shape only. This will achieve a part with the same cross-section along the whole path.\n\n1. Create two separate sketches;\n - one for the path, e.g two lines connected by a curve as in the image above,\n - one for the cross-section shape, e.g. a circle as the first shape in the image above. Instead of a sketch also the face of a 3D object can be used. ((v0.20) )\n2. **Arrange** the two shapes in 3D correctly. It is recommended to place the origin of the cross-section onto the line of the path. The two sketches should in most cases be **orthogonal**. This can be done with the \\'Map Mode\\' function (make both sketches visible with **Space**. Select the cross-section sketch. Select Properties/DataTab/MapMode. Click the appearing **...** button at the right side. In the Attachment Dialog select a vertex of the path sketch and select the correct mode to get the two sketches aligned correctly.\n3. There are several ways to invoke the tool:\n - Press the ** [Additive pipe](PartDesign_AdditivePipe.md)** button.\n - Select the **PartDesign → Create an additive feature → Additive pipe** option from the menu.\n4. In the **Select feature** dialog select a sketch to be used as a cross-section and click **OK**.\n - Alternatively, a sketch or a face of a 3D object ((v0.20) ) can be selected before starting the tool. You will not get this dialog then.\n5. In the **Pipe parameters** under **Path to sweep along**, press the **Object** button.\n6. Select the sketch to be used as a path in the 3D view. In this case, the whole sketch will be used as a path.\n - Alternatively, single edges of the sketch can be selected by pressing **Add Edge** and selecting edges in the 3D view. Note that you must press the **Add Edge** for each edge again. You must select a continuous line with no branches.\n7. The other settings should work with the default settings in most cases.\n8. Click **OK**.\n\nTo use more than one cross-section, start with the first cross-section sketch as described above. Then under **Section transformation** set the Transform mode to *Multisection*; press **Add Section** then select a sketch in the [3D view](3D_view.md). Repeat for each additional cross-section.\n\n## Options\n\n**Section Transformation**:\n\n- Select **Constant** to use a single profile\n- Select **Multisection** to use multiple profiles\n\n**Section Orientation**:\n\n- Standard\n\n : This keeps the cross-section shape perpendicular to the path. This is the default setting.\n- Fixed\n - Orientation set by the first profile and constant throughout. This deactivates the alignment to the path normal vector. That means that the cross-section shape will not rotate with the path. Sweep along a circle to see the effect.\n- Frenet\n - Create minimum possible twisting of profile. For more info, see [Frenet-Serret Formulas](https://en.wikipedia.org/wiki/Frenet%E2%80%93Serret_formulas)\n- Auxiliary\n - Specify secondary path to guide pipe.\n - For each point **P** along the sweep path, there will be a corresponding point **Q** on the auxiliary path.\n - As the profile is swept, it will be transformed such that the **PQ** line is the normal of the sweep path.\n - If **Curvelinear equivalence** is set, then the **Q** points are scaled proportionally along the sweep path, regardless of its length.\n- Binormal\n - Specify binormal vector in X, Y and Z\n\n**Corner Transition**\n\n- Transformed\n- Right\n- Rounded\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA PartDesign AdditivePipe object is derived from a [Part Feature](Part_Feature.md) object and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{TitleProperty|Base}}\n\n- **Add Sub Shape|PartShape|Hidden**:\n\n- **Base Feature|Link|Hidden**:\n\n- **_Body|LinkHidden|Hidden**:\n\n\n{{TitleProperty|Part Design}}\n\n- **Refine**: true or false. If set to true, cleans the solid from residual edges left by features. See [Part RefineShape](Part_RefineShape.md) for more details.\n\n\n{{TitleProperty|Sketch Based}}\n\n- **Profile|LinkSub**: reference to sketch.\n\n- **Midplane|Bool**: extrude symmetrically to sketch face.\n\n- **Reversed|Bool**: reverses extrusion direction.\n\n- **Up To Face|LinkSub**: face where feature will end.\n\n- **Allow Multi Face|Bool**: allow multiple faces in profile.\n\n\n{{TitleProperty|Sweep}}\n\n- **Sections|LinkSubList**: lists the sections used.\n\n- **Spine|LinkSub**: spine (path) to sweep along.\n\n- **Spine Tangent|Bool**: true or false (default). True extends the spine to include tangent edges.\n\n- **Auxiliary Spine|LinkSub|Hidden**: secondary spine (path) to orient the Sweep.\n\n- **Auxiliary Spine Tangent|Bool**: true or false (default). True extends the auxiliary spine to include tangent edges.\n\n- **Auxiliary Curvelinear|Bool**: true or false (default). True calculates the normal between equidistant points on both spines.\n\n- **Mode|Enumeration**: profile mode. Options are *Fixed*, *Frenet*, *Auxiliary* or *Binormal*. See [Options](#Options.md).\n\n- **Binormal|Vector**: binormal vector for corresponding orientation mode.\n\n- **Transition|Enumeration**: transition mode. Options are *Transformed*, *Right Corner* or *Round Corner*.\n\n- **Transformation|Enumeration**: *Constant* uses a single cross-section. *Multisection* uses two or more cross-sections. *Linear*, *S-shape* and *Interpolation* are currently not functional.\n\n## Notes\n\n- To better control the shape of the pipe, it is recommended that all cross-sections have the same number of segments. For example, for a pipe between a rectangle and a circle, the circle should be broken down into 4 connected arcs.\n- You can pipe from or toward a single [vertex](Glossary#V.md) from a sketch or the body. (v0.20) \n- When you select a [vertex](Glossary#V.md) as section, it must be the last section of the pipe. Otherwise the pipe body would consist of two solids connected at a single point. This would violates the CAD kernel\\'s definition of a 3D object. You can change the order of the sections by dragging them in the list.\n- The path can only be from a single sketch, feature or ShapeBinder. In case you want to sweep along several edges from different sketches, use a [SubShapeBinder](PartDesign_SubShapeBinder.md).\n- The path must not contain branches or T-junctions etc. Loops are allowed.\n- It can lead to issues if the cross-section is not perpendicular to the path in 3D.\n- A cross-section cannot lie on the same plane as the one immediately preceding it.\n- The cross-sections must not contain disjoint or crossing loops.\n- If the sketch has inner geometry, then the order in which the sketch geometry is created should be the same for all sections. Either start all sections with the inner geometry, or start them all with the outer. Otherwise an invalid pipe will be created where inner and outer walls cross.\n\n\n {{PartDesign Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign AdditivePipe\n"} {"id": "freecad-docs:wiki/PartDesign_Boolean.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PartDesign_Boolean.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PartDesign_Boolean.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b8786a0da4f4fd385aac928a099b1230046bf7da13f8b5a6b438cd03336874a0", "bytes": 3386, "tokens": 972, "text": "---\n GuiCommand:\n Name: PartDesign Boolean\n MenuLocation: Part Design , Boolean operation\n Workbenches: PartDesign_Workbench\n Version: 0.17\n---\n\n# PartDesign Boolean\n\n## Description\n\n**PartDesign Boolean** imports one or more [PartDesign Bodies](PartDesign_Body.md) or [PartDesign Clones](PartDesign_Clone.md) (designated as \\\"tool bodies\\\") into the active PartDesign Body and applies a Boolean operation (fuse, cut or common).\n\n ![](images/PartDesign_Boolean_example.png ) \n\n\n*On the left: active body (A) with tool bodies (B) and (C); result on the right after a Boolean Cut.*\n\n## Usage\n\n1. [Activate the Body](PartDesign_Body#Active_status.md) which is to receive the Boolean feature. ***Note**: It is important that neither the active Body nor any of the features it contains be selected!*\n2. Press the ** [PartDesign Boolean](PartDesign_Boolean.md)** button.\n3. In **Boolean Parameters**, click on the **Add body** button. The active body temporarily disappears from the [3D view](3D_view.md) to facilitate tool body selection.\n4. In the 3D view, select the Body to use in the Boolean feature. Repeat to add more Bodies.\n5. Select the type of Boolean operation in the drop down menu (Fuse, Cut or Common)\n6. Click **OK**.\n\nAlternatively, objects can be selected prior to pressing the Boolean button. They will be added automatically. When pre-selecting you are not restricted to Bodies. [PartDesign ShapeBinder](PartDesign_ShapeBinder.md), [PartDesign SubShapeBinder](PartDesign_SubShapeBinder.md) and even solids created with other workbenches can then also be selected.\n\n## Options\n\n- **Fuse:** merges the tool body or bodies to the active body.\n- **Cut:** subtracts the tool body or bodies from the active body.\n- **Common:** extracts the intersection from the selected body or bodies with the active body\n- Press the **Remove body** button to remove a body, by selecting it in the [3D view](3D_view.md).\n\n## Properties\n\n- **Type**: sets the Boolean operation (Fuse, Cut, Common)\n\n- **Label**: name given to the operation, this name can be changed at convenience.\n\n- **Group**: lists the tool bodies.\n\n- **Display**: sets the display between 2 modes:\n\n - Result (default): displays the result of the Boolean feature. In this mode, the tool Bodies cannot be displayed in their original state, even when their visibility is toggled on.\n - Tools: displays the tool Bodies in their original state. This mode is useful when tool Bodies need to be edited, or used in later operations.\n\n- **Selectable**: true or false. If set to false, the feature cannot be selected in the 3D view.\n\n- **Visibility**: true or false. Toggles the feature\\'s visibility in the 3D view.\n\n## Limitations\n\n- For Common to work with more than one tool body, they must all intersect each other along with the active Body.\n- Tool bodies adopt the local origin of the active Body. If the active Body is not located at (0,0,0) in the global coordinate system, the tool bodies\\' placement need to be relative to the active Body. It may be easier to leave the active Body\\'s placement at the origin before applying the Boolean feature, than to change its placement.\n\n\n {{PartDesign Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign Boolean\n"} {"id": "freecad-docs:wiki/PartDesign_Legacy.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PartDesign_Legacy.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PartDesign_Legacy.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b84b6fddac8a344a36460cf80f4cc48fc952f264a9c0b11715b971cdde644e6a", "bytes": 188, "tokens": 75, "text": "# PartDesign Legacy\n1. REDIRECT [PartDesign_Workbench](PartDesign_Workbench.md)\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign Legacy\n"} {"id": "freecad-docs:wiki/PartDesign_Mirrored.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PartDesign_Mirrored.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PartDesign_Mirrored.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "07bbfb90a9f27d80e8fd5641ea9d3169028c44a1ff5ad49ed867b274f4a0ce65", "bytes": 4277, "tokens": 1262, "text": "---\n GuiCommand:\n Name: PartDesign Mirrored\n MenuLocation: Part Design , Apply a pattern , Mirrored\n Workbenches: PartDesign_Workbench\n SeeAlso: PartDesign_MultiTransform\n---\n\n# PartDesign Mirrored\n\n## Description\n\nThe \"\" **PartDesign Mirrored** tool mirrors one or more features.\n\n ![](images/PartDesign_Mirrored_example.svg ) \n*A Pocket feature created from a sketch containing a circle (A) is used to create a mirrored feature. The vertical axis of the sketch (B) is used to the define the mirror plane. The result (C) is shown on the right.*\n\n## Usage\n\n### Create\n\n1. Optionally [activate](PartDesign_Body#Active_status.md) the correct Body.\n2. Optionally select one or more features.\n3. There are several ways to invoke the tool:\n - Press the ** [Mirrored](PartDesign_Mirrored.md)** button.\n - Select the **Part Design → Apply a pattern → Mirrored** option from the menu.\n4. If there is no active Body, and there are two or more Bodies in the document, the **Active Body Required** dialog will open and prompt you to activate one. If there is a single Body it will be activated automatically.\n5. If no features were selected the **Select feature** [task panel](Task_panel.md) opens: select one or more (hold down the **Ctrl** key) from the list and press the **OK** button.\n6. The **Mirrored parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n7. Press the **OK** button to finish.\n\n### Edit\n\n1. Do one of the following:\n - Double-click the Mirrored object in the [Tree view](Tree_view.md).\n - Right-click the Mirrored object in the [Tree view](Tree_view.md) and select **Edit Mirrored** from the context menu.\n2. The **Mirrored parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n3. Press the **OK** button to finish.\n\n## Options\n\n- Choose the mode:\n - \n **Transform body**\n \n : Transforms the whole base feature\\'s shape (default). (v1.0) \n\n - \n **Transform tool shapes**\n \n : Transforms the individual tool shapes of selected features.\n\n - To add features:\n 1. Press the **Add feature** button.\n 2. Select a feature in the [Tree view](Tree_view.md) or the [3D view](3D_view.md).\n 3. Repeat to add more features.\n - To remove features:\n 1. Press the **Remove feature** button.\n 2. Do one of the following:\n - Select a feature in the [Tree view](Tree_view.md) or the [3D view](3D_view.md).\n - Select a feature in the list and press the **Del** key.\n - Right-click a feature in the list and select **Remove** from the context menu.\n 3. Repeat to remove more features.\n - If there are several features in the pattern, their order can be important. See [PartDesign PolarPattern](PartDesign_PolarPattern#Ordering_features.md).\n- Specify the mirror **Plane**:\n - \n **Vertical sketch axis**\n \n : The Y axis of the sketch (the plane passes through this reference and the Z axis of the sketch, only available for sketch-based features).\n\n - \n **Horizontal sketch axis**\n \n : The X axis of the sketch (idem).\n\n - \n **Construction line #**\n \n : A separate entry for each construction line in the sketch (idem).\n\n - \n **Base XY plane**\n \n : The XY plane of the Body.\n\n - \n **Base YZ plane**\n \n : The YZ plane of the Body.\n\n - \n **Base XZ plane**\n \n : The XZ plane of the Body.\n\n - \n **Select reference...**\n \n : Select a planar face in the [3D view](3D_view.md).\n- If the **Update view** checkbox is checked the view will update in real time.\n\n## Limitations\n\nSee [PartDesign PolarPattern](PartDesign_PolarPattern#Limitations.md).\n\n\n {{PartDesign Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign Mirrored\n"} {"id": "freecad-docs:wiki/PartDesign_PolarPattern.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PartDesign_PolarPattern.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PartDesign_PolarPattern.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "1c0f57b17efa39ba68256b240d939b5f17c525c60ad70e8220235f38f9077484", "bytes": 6344, "tokens": 1820, "text": "---\n GuiCommand:\n Name: PartDesign PolarPattern\n MenuLocation: Part Design , Apply a pattern , PolarPattern\n Workbenches: PartDesign_Workbench\n SeeAlso: PartDesign_MultiTransform\n---\n\n# PartDesign PolarPattern\n\n## Description\n\nThe \"\" **PartDesign PolarPattern** tool creates a polar pattern of one or more features.\n\n ![](images/PartDesign_PolarPattern_example.png ) \n*A slot-shaped pocket (B) made on top of a base pad (A, also referred to as support) is used for a polar pattern. The result (C) is shown on the right.*\n\n## Usage\n\n### Create\n\n1. Optionally [activate](PartDesign_Body#Active_status.md) the correct Body.\n2. Optionally select one or more features in the [Tree view](Tree_view.md) or the [3D view](3D_view.md).\n3. There are several ways to invoke the tool:\n - Press the ** [PolarPattern](PartDesign_PolarPattern.md)** button.\n - Select the **Part Design → Apply a pattern → PolarPattern** option from the menu.\n4. If there is no active Body, and there are two or more Bodies in the document, the **Active Body Required** dialog will open and prompt you to activate one. If there is a single Body it will be activated automatically.\n5. If no features were selected the **Select feature** [task panel](Task_panel.md) opens: select one or more (hold down the **Ctrl** key) from the list and press the **OK** button.\n6. The **PolarPattern parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n7. Press the **OK** button to finish.\n\n### Edit\n\n1. Do one of the following:\n - Double-click the PolarPattern object in the [Tree view](Tree_view.md).\n - Right-click the PolarPattern object in the [Tree view](Tree_view.md) and select **Edit PolarPattern** from the context menu.\n2. The **PolarPattern parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n3. Press the **OK** button to finish.\n\n## Options\n\n- Choose the mode:\n - \n **Transform body**\n \n : Transforms the whole base feature\\'s shape (default). (v1.0) \n\n - \n **Transform tool shapes**\n \n : Transforms the individual tool shapes of selected features.\n\n - To add features:\n 1. Press the **Add feature** button.\n 2. Select a feature in the [Tree view](Tree_view.md) or the [3D view](3D_view.md).\n 3. Repeat to add more features.\n - To remove features:\n 1. Press the **Remove feature** button.\n 2. Do one of the following:\n - Select a feature in the [Tree view](Tree_view.md) or the [3D view](3D_view.md).\n - Select a feature in the list and press the **Del** key.\n - Right-click a feature in the list and select **Remove** from the context menu.\n 3. Repeat to remove more features.\n - If there are several features in the pattern, their order can be important. See [Ordering features](#Ordering_features.md).\n\n- Specify the **Axis** of the pattern:\n - \n **Normal sketch axis**\n \n : The Z axis of the sketch (only available for sketch-based features).\n\n - \n **Vertical sketch axis**\n \n : The Y axis of the sketch (idem).\n\n - \n **Horizontal sketch axis**\n \n : The X axis of the sketch (idem).\n\n - \n **Construction line #**\n \n : A separate entry for each construction line in the sketch (idem).\n\n - \n **Base X axis**\n \n : The X axis of the Body.\n\n - \n **Base Y axis**\n \n : The Y axis of the Body.\n\n - \n **Base Z axis**\n \n : The Z axis of the Body.\n\n - \n **Select reference...**\n \n : Select a [Datum Line](PartDesign_Line.md) in the [Tree view](Tree_view.md) or a [Datum Line](PartDesign_Line.md) or edge in the [3D view](3D_view.md).\n\n- Check the **Reverse direction** checkbox to reverse the pattern.\n\n- (v1.0) : Specify the angle **Mode**:\n\n - \n **Overall Angle**\n \n : Enter the overall **Angle**. If the angle is less than 360°, the occurrences are evenly distributed from 0° (first occurrence) to the given angle (last occurrence). If the angle is 360°, the occurrences are evenly distributed around the circle. For n occurrences an angle of 360° is equivalent to an angle of 360°\\*(1-1/n).\n\n - \n (v1.0) \n \n : **Offset Angle**: Enter the **Offset** angle from a given point on the first occurrence to the same point on the next occurrence. For n occurrences: OverallAngle=(n-1)\\*Offset.\n\n- Specify the number of **Occurrences** (including the original feature).\n\n- If the **Update view** checkbox is checked the view will update in real time.\n\n## Ordering features \n\nIf some of the selected features are additive and others subtractive, their order can have have an impact on the final result. You can change the order by dragging individual features in the list.\n\n ![](images/PartDesign_feature-order.gif ) \n*Effect of the feature order*\n\n## Limitations\n\n- Any shape in the pattern that does not overlap the parent feature will be excluded. This ensures that a PartDesign Body always consists of a single, connected solid.\n- The PartDesign patterns are not yet as optimized as their Draft counterparts. So for a large number of instances you should consider using a [Draft PolarArray](Draft_PolarArray.md) instead, combined with a Part boolean operation. This may require major changes to your model as you are leaving PartDesign and therefore cannot simply continue with further PartDesign features in the same body. An example is shown in [this Forum topic](https://forum.freecadweb.org/viewtopic.php?f=3&t=55192).\n- A pattern cannot be applied directly to another pattern, be it polar, linear or a mirror. For this you need a [PartDesign MultiTransform](PartDesign_MultiTransform.md).\n\n\n {{PartDesign Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign PolarPattern\n"} {"id": "freecad-docs:wiki/PartDesign_Revolution.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PartDesign_Revolution.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PartDesign_Revolution.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ea9193e75d237aba2d3ee4168b63ab8f3e1a0e17e9852cb9103a2487b9a89b7f", "bytes": 4546, "tokens": 1368, "text": "---\n GuiCommand:\n Name: PartDesign Revolution\n MenuLocation: Part Design , Create an additive feature , Revolution\n Workbenches: PartDesign_Workbench\n SeeAlso: PartDesign_Groove\n---\n\n# PartDesign Revolution\n\n## Description\n\nThe **Revolution** tool creates a solid by revolving a selected sketch or 2D object about a given axis.\n\n ![](images/PartDesign_Revolution_example.svg ) \n\n\n*Above: sketch (A) is revolved 270 degrees counter-clockwise around axis (B); resulting solid (C) is shown right.*\n\n## Usage\n\n1. Select a single sketch or one or more faces from the Body.\n2. Press the ** [Revolution](PartDesign_Revolution.md)** button.\n3. Set the Revolution parameters, see [Options](#Options.md) below.\n4. Press the **OK** button.\n\n## Options\n\nWhen creating a revolution, or after double-clicking an existing revolution in the [Tree view](Tree_view.md), the **Revolution parameters** task panel is shown. It offers the following settings:\n\n![](images/partdesign_revolution_parameters.png )\n\n### Type\n\n\n(v1.0) \n\nType offers five different ways of specifying the angle of the revolution:\n\n#### Dimension\n\nEnter a numeric value for the **Angle** of the revolution. With the option **Symmetric to plane** the revolution will extend half the given angle to either side of the sketch or face.\n\n#### To last \n\nThe revolution will extend up to the last face of the support it encounters in its direction. If there is no support, an error message will appear.\n\n#### To first \n\nThe revolution will extend up to the first face of the support it encounters in its direction. If there is no support, an error message will appear.\n\n#### Up to face \n\nThe revolution will extend up to a face. Press the **Face** button and select a face or a [datum plane](PartDesign_Plane.md) from the Body.\n\n#### Two dimensions \n\nThis allows to enter a second angle in which the revolution should extend in the opposite direction. The directions can be switched by checking the **Reversed** option.\n\n### Axis\n\nSpecifies the axis of the revolution:\n\n- **Vertical sketch axis**: selects the vertical sketch axis.\n- **Horizontal sketch axis**: selects the horizontal sketch axis.\n- **Construction line**: selects a construction line from the sketch used by the revolution. The dropdown list will contain an entry for each construction line. The first construction line will be labelled *Construction line 1*.\n- **Base (X/Y/Z) axis**: selects the X, Y or Z axis of the Body\\'s origin.\n- **Select reference\\...**: allows the selection of a straight edge or a [datum line](PartDesign_Line.md) from the Body.\n\nNote that when changing the axis, the **Reversed** option may be (un)checked automatically.\n\n### Angle\n\nDefines the angle of the revolution. This option is only available if **Type** is **Dimension** or **Two dimensions**. Angles larger than 360° are not possible. Nor are negative values, use the **Reversed** option instead.\n\n### Symmetric to plane \n\nCheck this option to extend the revolution half the given angle to either side of the sketch or face. This option is only available if **Type** is **Dimension**.\n\n### Reversed\n\nReverses the direction of the revolution.\n\n### 2nd angle \n\n\n(v1.0) \n\nDefines the angle of the revolution in the opposite direction. This option is only available if **Type** is **Two dimensions** and **Angle** is smaller than 360°.\n\n## Properties\n\n### Data\n\n\n{{TitleProperty|Part Design}}\n\n- **Refine|Bool**\n \n\n\n{{TitleProperty|Revolution}}\n\n- **Type|Enumeration**\n \n\n- **Base|Vector**: (read-only)\n\n- **Axis|Vector**: (read-only)\n\n- **Angle|Angle**\n \n\n- **Up To Face|LinkSub**\n \n\n- **Angle2|Angle**\n \n\n- **Reference Axis|LinkSub**\n \n\n\n{{TitleProperty|Sketch Based}}\n\n- **Profile|LinkSub**\n \n\n- **Midplane|Bool**\n \n\n- **Reversed|Bool**\n \n\n- **Allow Multi Face|Bool**\n \n\n## Notes\n\n- A \"\" [ShapeBinder](PartDesign_ShapeBinder.md) cannot be used for the profile.\n- When using a \"\" [SubShapeBinder](PartDesign_SubShapeBinder.md) for the profile, selecting the binder in the [Tree view](Tree_view.md) will fail, instead the binder\\'s face has to be selected in the [3D view](3D_view.md).\n\n\n {{PartDesign Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign Revolution\n"} {"id": "freecad-docs:wiki/PartDesign_Thickness.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/PartDesign_Thickness.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/PartDesign_Thickness.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2a4d4daafebb76cecf30ff2c363c07b9d461a7ec1f948234a563decad8e9ba55", "bytes": 6081, "tokens": 1836, "text": "---\n GuiCommand:\n Name: PartDesign Thickness\n MenuLocation: Part Design , Apply a dress-up feature , Thickness\n Workbenches: PartDesign_Workbench\n Version: 0.17\n SeeAlso: Part_Thickness\n---\n\n# PartDesign Thickness\n\n## Description\n\nThe \"\" **PartDesign Thickness** tool transforms a solid body into a hollow object with at least one open face, giving to each of its remaining faces a uniform thickness. It adds a **Thickness** object to the document with its corresponding representation in the [Tree view](Tree_view.md).\n\n \"\" \n*Base solid (A) → Solid with selected face to be opened (B) → Resulting hollow object (C)*\n\n## Usage\n\n### Add a thickness \n\n1. Optionally [activate](PartDesign_Body#Active_status.md) the Body to apply the Thickness to.\n2. Select one or more faces of the Body.\n3. There are several ways to invoke the tool:\n - Press the ** [Thickness](PartDesign_Thickness.md)** button.\n - Select the **Part Design → Apply a dress-up feature → Thickness** option from the menu.\n4. If there is no active Body, and there are two or more Bodies in the document, the **Active Body Required** dialog will open and prompt you to activate one. If there is a single Body it will be activated automatically.\n5. The **Thickness parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n6. Press the **OK** button to finish.\n\n: *Remember*:\n - Since there must be at least one face for the feature, the last remaining face in the list cannot be removed.\n\n### Edit a thickness \n\n1. Do one of the following:\n - Double-click the Thickness object in the [Tree view](Tree_view.md)\n - Right-click the Thickness object in the [Tree view](Tree_view.md) and select **Edit Thickness** from the context menu.\n2. The **Thickness parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n3. Press the **OK** button to finish.\n\n## Options\n\n- **Add face**: Add faces to the selection by pressing the **Add face** button and selecting more faces.\n\n- **Remove face**: Choose a way to remove faces from the selection:\n\n - Select one or more faces in the list and press the **Del** key or right-click the list and select **Remove** from the context menu.\n - Press the **Remove face** button. All previously selected faces are highlighted in purple. Select each face to be removed.\n\n- **Thickness**: Set the wall thickness either by editing the value or by clicking the up/down arrows.\n\n- **Mode**:\n\n - \n **Skin**\n \n : Select this option if you want to get an item like a vase, headless but with the bottom. Only this option can be selected.\n\n - \n **Pipe**\n \n : Not implemented. See [this forum topic](https://forum.freecadweb.org/viewtopic.php?p=484495#p484495).\n\n - \n **Recto Verso**\n \n : Not implemented. See [this forum topic](https://forum.freecadweb.org/viewtopic.php?p=484495#p484495).\n\n- **Join Type**:\n\n - \n **Arc**\n \n : When non-tangential faces are offset, new faces that do not intersect are joined by a fillet with a radius equal to the defined thickness.\n\n - \n **Intersection**\n \n : When non-tangential faces are offset, new faces that do not intersect are extended to meet at their virtual intersection.\n\n- **Intersection**: When checked, self-intersections in certain models are avoided. This option is not recommended as it relies on an incomplete [OpenCASCADE method](https://dev.opencascade.org/doc/refman/html/class_b_rep_offset_a_p_i___make_thick_solid.html#af78f35025a31e2ce8bd96c82fb33a981).\n\n- **Make thickness inwards**: When checked, faces are offset inward.\n\n## Notes\n\n- If thickness goes inwards, the value must be smaller than the smallest height of the Body.\n- The tool may fail with complex shapes. [Additive Pipe](PartDesign_AdditivePipe.md) or [Additive Loft](PartDesign_AdditiveLoft.md) may work better to create complex shapes.\n- Known errors:\n - BRep_API: command not done.\n - BRep_Tool: no parameter on edge.\n - Silently fails.\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA PartDesign Thickness object is derived from a [Part Feature](Part_Feature.md) object and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{Properties_Title|Base}}\n\n- **Base|LinkSub**: Sub-link to the parent feature\\'s list of selected edges and faces.\n\n- **Support Transform|Bool**: Include the base additive/subtractive shape when used in pattern features. If disabled, only the dressed part of the shape is used for patterning. Default: `False`.\n\n- **Add Sub Shape|PartShape|hidden**\n \n\n- **Base Feature|Link|hidden**: Link to the parent feature.\n\n- **_ Body|LinkHidden|hidden**: Link to the parent body.\n\n\n{{Properties_Title|Part Design}}\n\n- **Refine|Bool**: Refine shape (clean up redundant edges) after adding/subtracting. The default value is determined by the **Automatically refine model after sketch-based operation** preference. See [PartDesign Preferences](PartDesign_Preferences#General.md).\n\n\n{{Properties_Title|Thickness}}\n\n- **Value|Length**: Thickness value. Default: {{value|1 mm}}.\n\n- **Mode|Enumeration**: Mode. {{value|Skin}} (default), {{value|Pipe}} or {{Value|Recto verso}}. Only {{value|Skin}} is implemented.\n\n- **Join|Enumeration**: Join type. {{value|Arc}} (default) or {{Value|Intersection}}.\n\n- **Reversed|Bool**: Apply the thickness towards the solids interior. Default: `False`.\n\n- **Intersection|Bool**: Enable intersection-handling. Default: `False`.\n\n\n {{PartDesign Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign Thickness\n"} {"id": "freecad-docs:wiki/Part_API.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_API.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_API.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7fecf7d0f45c22c4f1387fec523edbad899158ca7878c94cb430ba2cdfecbeec", "bytes": 5661, "tokens": 1827, "text": "# Part API\n**(November 2018) This information may be incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation] or [https://freecad-python-stubs.readthedocs.io/en/latest/autoapi/Part/ autogenerated Python Part API documentation].**\n\nThe Part module is the direct connection between FreeCAD and the OpenCasCade kernel. It provides mainly [TopoShapes](TopoShape_API.md) which is the main object type used by OpenCascade. The Part module also contains a variety of convenience functions to create and manipulate topoShapes. Example: \n```python\nimport Part\nmycube = Part.makeBox(2,2,2)\nPart.show(mycube)\n```\n\n\n{{APIFunction|__fromPythonOCC__|OCC.Object|Helper method to convert a pythonocc shape to an internal shape|A Part.Shape}}\n\n\n{{APIFunction|__sortEdges__|list of edges|Helper method to sort an unsorted list of edges so that afterwards the start and end vertex of two consecutive edges are geometrically coincident. It returns a single list of edges and the algorithm stops after the first set of connected edges which means that the output list can be smaller than the input list. The sorted list can be used to create a Wire.|a list of edges}}\n\n\n{{APIFunction|__toPythonOCC__|Part.Shape|Helper method to convert an internal shape to pythonocc shape|an OCC.Shape}}\n\n\n{{APIFunction|cast_to_shape|Part.Shape|Cast to the actual shape type| }}\n\n\n{{APIFunction|export|list,string|Export a list of objects into a single file.| }}\n\n\n{{APIFunction|getSortedClusters|list of edges|Helper method to sort and cluster a variety of edges| }}\n\n\n{{APIFunction|insert|string,string|Insert the file (path given as first argument) into the given document (second argument).| }}\n\n\n{{APIFunction|makeBox|length,width,height,[pnt,dir]|Makes a box located at pnt with the dimensions (length,width,height). By default pnt is Vector(0,0,0) and dir is Vector(0,0,1)|the created shape}}\n\n\n{{APIFunction|makeCircle|radius,[pnt,dir,angle1,angle2]|Makes a circle with a given radius. By default pnt is Vector(0,0,0), dir is Vector(0,0,1), angle1 is 0 and angle2 is 360|the created shape}}\n\n\n{{APIFunction|makeCompound|list|Creates a compound out of a list of shapes.|the created shape}}\n\n\n{{APIFunction|makeCone|radius1,radius2,height,[pnt,dir,angle]|Makes a cone with given radii and height. By default pnt is Vector(0,0,0), dir is Vector(0,0,1) and angle is 360|the created shape}}\n\n\n{{APIFunction|makeCylinder|radius,height,[pnt,dir,angle]|Makes a cylinder with a given radius and height. By default pnt is Vector(0,0,0),dir is Vector(0,0,1) and angle is 360|the created shape}}\n\n\n{{APIFunction|makeHelix|pitch,height,radius,[angle,lefthand,heightstyle]|Makes a helix shape with a given pitch, height and radius. Defaults to right-handed cylindrical helix. Non-zero angle parameter produces a conical helix. Lefthand True produces left handed helix. Heightstyle applies only to conical helices. Heightstyle False (default) will cause the height parameter to be interpreted as the length of the side of the underlying frustum. Heightstyle True will cause the height parameter to be interpreted as the vertical height of the helix. Pitch is \"metric pitch\" (advance/revolution). For conical helix, radius is the minor radius.|the created shape}}\n\n\n{{APIFunction|makeLine|(x1,y1,z1),(x2,y2,z2)|Makes a line of two points|the created shape}}\n\n\n{{APIFunction|makeLoft|shapelist,[boolean,boolean]|Creates a loft shape using the list of profiles. Optionally make result a solid (vs surface/shell) or make result a ruled surface.|the created shape}}\n\n\n{{APIFunction|makePlane|length,width,[pnt,dir]|Makes a plane. By default pnt is Vector(0,0,0) and dir is Vector(0,0,1)|the created shape}}\n\n\n{{APIFunction|makePolygon|list|Makes a polygon of a list of Vectors|the created shape}}\n\n\n{{APIFunction|makeRevolution|Curve,[vmin,vmax,angle,pnt,dir]|Makes a revolved shape by rotating the curve or a portion of it around an axis given by (pnt,dir). By default vmin/vmax are set to bounds of the curve,angle is 360,pnt is Vector(0,0,0) and dir is Vector(0,0,1)|the created shape}}\n\n\n{{APIFunction|makeRuledSurface|Edge or Wire,Edge or Wire|Creates a ruled surface out of two edges or wires. If wires are used then these must have the same number of edges.|the created shape}}\n\n\n{{APIFunction|makeShell|list|Creates a shell out of a list of faces. Note: Resulting shell should be manifold. Non-manifold shells are not well supported.|the created shape}}\n\n\n{{APIFunction|makeSolid|Part.Shape|Creates a solid out of the shells inside a shape.|the created shape}}\n\n\n{{APIFunction|makeSphere|radius,[center_pnt, axis_dir, V_startAngle, V_endAngle, U_angle]|Makes a sphere (or partial sphere) with a given radius. By default center_pnt is Vector(0,0,0), axis_dir is Vector(0,0,1), V_startAngle is 0, V_endAngle is 90 and U_angle is 360|the created shape}}\n\n\n{{APIFunction|makeTorus|radius1,radius2,[pnt,dir,angle1,angle2,angle]|Makes a torus with a given radii and angles. By default pnt is Vector(0,0,0),dir is Vector(0,0,1),angle1 is 0,angle2 is 360 and angle is 360|the created shape}}\n\n\n{{APIFunction|makeTube|edge,float|Creates a tube.|the created shape}}\n\n\n{{APIFunction|open|string|Creates a new document and load the file into the document.| }}\n\n\n{{APIFunction|read|string|Loads the file and return the shape.|a shape}}\n\n\n{{APIFunction|show|shape|Adds the shape to the active document or create one if no document exists.| }}\n\n\n---\n⏵ [documentation index](../README.md) > [API](Category_API.md) > [Poweruser Documentation](Category_Poweruser%20Documentation.md) > [Part](Part_Workbench.md) > Part API\n"} {"id": "freecad-docs:wiki/Part_ColorPerFace.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_ColorPerFace.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_ColorPerFace.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "651765a7a3aad208358e1d5a2a758a49759b453144091d3e070a8e6c742a205e", "bytes": 2889, "tokens": 821, "text": "---\n GuiCommand:\n Name: Part ColorPerFace\n MenuLocation: View , Color per face\n Workbenches: Part_Workbench, PartDesign_Workbench\n SeeAlso: Std_SetAppearance\n---\n\n# Part ColorPerFace\n\n## Description\n\nThe **Part ColorPerFace** command sets the display properties of selected faces. To change a whole object use [Std SetAppearance](Std_SetAppearance.md) instead.\n\nThis page has been updated for version 1.0.\n\n ![](images/Part_ColorPerFace_Taskpanel.png ) \n*The Set appearance per face task panel*\n\n## Usage\n\n1. Select a single object.\n2. There are several ways to invoke the command:\n - If the [Part Workbench](Part_Workbench.md) is active: press the ** [Color per face](Part_ColorPerFace.md)** button.\n - Select the **View → Color per face** option from the menu.\n - Select the ** Set appearance per face...** option from the [Tree view](Tree_view.md) context menu.\n3. The **Set appearance per face** task panel opens.\n4. Select one or more faces:\n - Hold down **Ctrl** to select mutliple faces.\n - Optionally press the **Box selection** button, click in an empty area and drag a rectangle to select all faces belonging to the object that are (partially) inside the rectangle. Multiple box selections can be specified.\n5. Do one of the following:\n - Select a material from the list.\n 1. Optionally press the **Launch editor** button to launch the [Materials editor](Materials_Edit.md).\n - Specify a **Custom appearance**:\n 1. Press the **...** button.\n 2. The **Material properties** dialog box opens:\n ![](images/Material_Properties_Dialog.png )\n 3. These properties can be edited:\n - **Ambient color**: color of the shadows on the object.\n - **Diffuse color**: actual/base color of the object.\n - **Emissive color**: color of the light radiating from the object.\n - **Specular color**: color of the highlight (reflection) on a shiny surface of the object.\n - **Shininess**\n - **Transparency**\n 4. Optionally press the **Reset** button to change the appearance to that defined by the material.\n 5. Optionally press the **Default** button to change the appearance to match the current [preferences](PartDesign_Preferences#Shape_appearance.md).\n 6. Press the **Close** button when done.\n - Press the **Set to default** button to change the appearance to that defined by the material.\n6. Optionally select one or more new faces whose properties you want to change.\n7. Press the **OK** button to close the task panel and finish the command.\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part ColorPerFace\n"} {"id": "freecad-docs:wiki/Part_CompCompoundTools.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_CompCompoundTools.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_CompCompoundTools.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e8a006c1dbe95bfff8ec6a4023d58d9668775b0c7818d1751e411e88c20c51e9", "bytes": 220, "tokens": 85, "text": "# Part CompCompoundTools\n1. REDIRECT [Part_Workbench#Part_CompCompoundTools](Part_Workbench#Part_CompCompoundTools.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part CompCompoundTools\n"} {"id": "freecad-docs:wiki/Part_Compound.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_Compound.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_Compound.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "3a5e661303e736e3f2fc90b322a9db13212a00fae2b78ef37bb7cbe48c2f99a7", "bytes": 1266, "tokens": 355, "text": "---\n GuiCommand:\n Name: Part Compound‏‎\n MenuLocation: Part , Make compound\n Workbenches: Part_Workbench\n Version: 0.14\n SeeAlso: Part_Fuse, Part_CompoundFilter, Part_ExplodeCompound\n---\n\n# Part Compound\n\n## Description\n\nThis command creates a compound of objects with a topological shape such as solid objects and other objects with faces and/or edges. It cannot handle meshes as they do not have a topological shape.\n\n## Usage\n\n1. Mark the topological shapes to be added to the compound in the [tree view](Tree_view.md)\n2. Choose **Part → Compound → Make Compound** entry in the Part menu or click on the \"\" button.\n\n## Notes\n\nA compound containing pieces that intersect or touch is **invalid** for Boolean operations. Because of performance issues, checking if the pieces intersect is not done by default. Automatic geometry check (available for Boolean operations) is disabled for part compound as well.\n\nTo turn this check on go to **Tools → Edit Parameters → Preferences... → Mod → Part → CheckGeometry → RunBOPCheck** and set the parameter to `true`.\n\n\n {{Part_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part Compound\n"} {"id": "freecad-docs:wiki/Part_FaceColors.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_FaceColors.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_FaceColors.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0a0a9212966fcf1223dbc987a0fd77bbbe03f250118a3b8fa92ff6294a5f5bfb", "bytes": 166, "tokens": 67, "text": "# Part FaceColors\n1. REDIRECT [Part_ColorPerFace](Part_ColorPerFace.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part FaceColors\n"} {"id": "freecad-docs:wiki/Part_Fuse.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_Fuse.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_Fuse.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "01a3b6788424f415c761678d442c6b07fb50c64572670a2baa219ab5e0ffa355", "bytes": 2204, "tokens": 670, "text": "---\n GuiCommand:\n Name: Part Fuse\n MenuLocation: Part , Boolean , Union\n Workbenches: Part_Workbench\n SeeAlso: Part_Boolean, Part_Cut, Part_Common\n---\n\n# Part Fuse\n\n## Description\n\nThe **![](images/\u0001)_[Part_Fuse](Part_Fuse.md)** tool fuses (unites) selected Part objects into one. This operation is fully parametric and the components can be modified and the result recomputed.\n\n**Note:** This command is an automated form of the \"\" [Boolean operation](Part_Boolean.md).\n\n## Usage\n\n1. Select two or more shapes\n2. There are several ways to invoke the command:\n - Press the **![](images/\u0001) Part Fuse** button in the **Part tools** toolbar\n - Use the **Part → Boolean → Union** entry in the Part menu\n\n## Supported inputs \n\nInput objects must be [OpenCASCADE](OpenCASCADE.md) shapes. Examples: stuff made with Part, PartDesign, Sketcher workbenches. Not meshes (unless those were converted to shapes) - for meshes, there are specific Boolean tools in MeshDesign workbench.\n\n- Solid + Solid: the result is a solid that occupies all the volume covered by the inputs\n\n- Shell + Shell, Shell + Face, Face + Face: the result is a shell. Where faces intersect, they are split. Shells can be non-manifold. After fusion, faces can be united by [Refining](Part_RefineShape.md) the result.\n\n- Wire + Wire, Edge + Wire, Edge + Edge: the result is a wire. Edges are split where they intersect.\n\nCompounds are supported; however, it is assumed that shapes packed into a compound do not touch or intersect. If they actually do, Fusion will likely fail, or produce an incorrect result.\n\n## Options\n\nItems can be added and removed from a fusion, by dragging them in or out of the fusion feature in the tree view with the mouse. To drag items out of a fusion you have to drop them onto the document node (the filename) of your model. A manual recompute (press **F5** key or click on the \"\" [Refresh/Recompute](Std_Refresh.md) icon) is required to see the results.\n\n\n {{Part_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part Fuse\n"} {"id": "freecad-docs:wiki/Part_MakeCompound.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_MakeCompound.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_MakeCompound.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6efb6ef7ebdf523d4f2b05ad3706c9a1ab7eb8a1af5024728a4a6a36407c3ddc", "bytes": 162, "tokens": 62, "text": "# Part MakeCompound\n1. REDIRECT [Part Compound](Part_Compound.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part MakeCompound\n"} {"id": "freecad-docs:wiki/Part_Measure_Toggle_All.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_Measure_Toggle_All.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_Measure_Toggle_All.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "4a223bc23d2f06e1e8f7bbf11764e27bbe5eb1e1441ad540d88476b17fd3d245", "bytes": 810, "tokens": 293, "text": "---\n GuiCommand:\n Name: Part Measure Toggle All\n MenuLocation: Measure , Toggle All\n Workbenches: Part_Workbench\n SeeAlso: Part_Measure_Toggle_3D, Part_Measure_Toggle_Delta\n---\n\n# Part Measure Toggle All\n\n## Description\n\nThis command toggles the visibility of all measurements in the [3D view](3D_view.md).\n\n \"\" \n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Toggle All](Part_Measure_Toggle_All.md)** button.\n - Select the **Measure → Toggle All** option from the menu.\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part Measure Toggle All\n"} {"id": "freecad-docs:wiki/Part_Measure_Toggle_Delta.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_Measure_Toggle_Delta.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_Measure_Toggle_Delta.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e3bbf4b12a8d38d4abf44163aabc111fb0ff0ad0a62366217247fbb0e7aff9a6", "bytes": 756, "tokens": 267, "text": "---\n GuiCommand:\n Name: Part Measure Toggle Delta\n MenuLocation: Measure , Toggle Delta‏‎\n Workbenches: Part_Workbench\n SeeAlso: Part_Measure_Toggle_All, Part_Measure_Toggle_3D\n---\n\n# Part Measure Toggle Delta\n\n## Description\n\nThis command toggles the visibility of delta measurements in the [3D view](3D_view.md).\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Toggle Delta](Part_Measure_Toggle_Delta.md)** button.\n - Select the **Measure → Toggle Delta** option from the menu.\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part Measure Toggle Delta\n"} {"id": "freecad-docs:wiki/Part_ProjectionOnSurface.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_ProjectionOnSurface.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_ProjectionOnSurface.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f88f181fd1addca8eba616f6736c6dd64554e638c2239e6d51b9ad8c236f554b", "bytes": 6350, "tokens": 1742, "text": "---\n GuiCommand:\n Name: Part ProjectionOnSurface\n MenuLocation: Part , Create projection on surface...\n Workbenches: Part_Workbench\n Version: 0.19\n---\n\n# Part ProjectionOnSurface\n\n## Description\n\n\n**[ [Part ProjectionOnSurface](Part_ProjectionOnSurface.md)**\n\nis used to project a [Shape](Shape.md) on top of a face from another object; this can be used to project a logo or textual object (see **[ [Draft ShapeString](Draft_ShapeString.md)**) onto different surfaces to create interesting effects.\n\nGiven a source [Shape](Shape.md), this tool can project edges, wires (closed edges), or entire faces from it; the result can be new edges, new wires, new faces, or even new extruded solids which can be used in \"\" [boolean operations](Part_Boolean.md) for effects such as engraving or stamping.\n\n \"\" \"\" \n\n\n*Projection of a logo on a curved surface.*\n\n## Usage\n\n1. Make sure you have at least two objects in your document; the \\\"source\\\" object that you wish to project, and the \\\"target\\\" object where the projection will be made.\n2. Click on **[ [Projection on surface](Part_ProjectionOnSurface.md)** to launch a [task panel](task_panel.md) with various options.\n3. Click on **Select projection surface**, and then click on the \\\"target\\\" surface where the projection will be created.\n4. Then click on the specific button to choose the type of subelement that you want to add to your projection object.\n - \n **Add face**\n \n : select a source face.\n\n - \n **Add wire**\n \n : select a source edge. The tool will extract the entire wire to which the edge belongs. For example, by choosing a single edge of a polygon, it will project the entire polygon.\n\n - \n **Add edge**\n \n : select a source edge. The tool will only project the selected edge.\n\n - Once a button is depressed, pick a subelement in the [3D view](3D_view.md). If you wish to deselect it, pick the same element again.\n\n - When you are satisfied with your selection, press the same **Add...** button to leave the selection mode.\n5. Then click on the specific radiobutton to choose the type of projection shape to create.\n - \n {{RadioButton|TRUE|Show all}}\n \n : it will show all types of closed wires and edges on the target surface. If a \\\"face\\\" subelement was selected in the previous step, a preview of a solid object extruded from the projection will be shown, depending on the value of **Extrude height**.\n\n - \n {{RadioButton|TRUE|Show faces}}\n \n : it will show a preview of a filled face on the target surface. This will only work if you selected a \\\"face\\\" subelement in the previous step; if you selected a closed \\\"wire\\\", only the edges (no face) will be created as projection; if you selected \\\"edges\\\", only those edges will be created as projection.\n\n - \n {{RadioButton|TRUE|Show edges}}\n \n : it will show a preview of the edges on the target surface. This will work whether you added a \\\"face\\\", \\\"wire\\\", or \\\"edge\\\" subelement in the previous step; even if you added a filled \\\"face\\\", only the edges will be created as projection.\n6. Press the **OK** to complete the operation and produce the new projection object.\n\nNotes:\n\n- The projection direction is automatically taken from the camera direction in the [3D view](3D_view.md) at the moment the tool is launched.\n- To change the direction, move the camera, and press **Get current camera direction**.\n- Alternatively press the **X:**, **Y:**, or **Z:** buttons to set the projection direction to the main global axes, +X, -X, +Y, -Y, +Z, or -Z.\n- However, do notice that changing the projection direction won\\'t automatically update the projection preview; in order to do this, you must re-select the geometry by pressing the **Add...** buttons and picking the subelements again.\n\n## Options\n\n- **Extrude height**: it is the height of the solid shape that is created by extruding the projected face, from the target surface and along the negative of the projection direction. For example, if the projection direction is along +Y {{Value|(0, 1, 0)}}, the extrusion will be created in the direction -Y {{Value|(0, -1, 0)}}. This solid extrusion will only be created if the subelement selected was a closed face, by pressing the **Add face** button, and by choosing the {{RadioButton|TRUE|Show all}} option.\n\n- **Solid depth**: it is the distance that the projection object is moved along the projection direction. Negative values will displace the object in the opposite direction; this allows creating a projection that is offset from the target surface.\n\n## Limitations\n\nThe projection algorithm sometimes is not able to create a valid projection face. If this happens a solid extrusion won\\'t be able to be created either.\n\nIf this happens:\n\n- Check if your source face is valid; try running the **[ [CheckGeometry](Part_CheckGeometry.md)** tool for clues.\n- Check if the projection direction is valid. Can the source face be realistically projected onto the target surface? Would a straight projection hit the surface? Adjust the camera so that the source face is in front of the target surface, and try again.\n- Try to use the {{RadioButton|TRUE|Show edges}} option. Are the edges projected correctly? Try to create a face with the edges by hand.\n\nThe projection done in the Part workbench is not parametric. If you need a parametric workflow, please consult with the [Projection class](https://gist.github.com/CsatiZoltan/f4fd10bf20923143ba0e0678ea1d3d61), which is a Python scripted object, intended for programmatic use.\n\n## Links\n\n- Forum thread: [Project faces onto bent surface](https://forum.freecadweb.org/viewtopic.php?f=9&t=33700)\n\n\n {{Part_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part ProjectionOnSurface\n"} {"id": "freecad-docs:wiki/Part_Union.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Part_Union.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Part_Union.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7c92cbcfbb2cfbd83fb91ae8a7d534b94b4c06654002e98ae69acab1e9d6a6bd", "bytes": 140, "tokens": 59, "text": "# Part Union\n1. REDIRECT [Part_Fuse](Part_Fuse.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part Union\n"} {"id": "freecad-docs:wiki/Path_Development_Roadmap.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Path_Development_Roadmap.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Path_Development_Roadmap.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "80d87e29157af71f0ff73169ad48866e1a5025ff7221ac6caa4226cb774e558c", "bytes": 168, "tokens": 57, "text": "# Path Development Roadmap\n1. REDIRECT [CAM Development Roadmap](CAM_Development_Roadmap.md)\n\n\n---\n⏵ [documentation index](../README.md) > Path Development Roadmap\n"} {"id": "freecad-docs:wiki/Path_SelectLoop.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Path_SelectLoop.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Path_SelectLoop.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "affee0177089a20726a23ce6f0ffd4d0fb300d59f94d3d69532c4d125d825067", "bytes": 132, "tokens": 55, "text": "# Path SelectLoop\n1. REDIRECT [CAM_SelectLoop](CAM_SelectLoop.md)\n\n\n---\n⏵ [documentation index](../README.md) > Path SelectLoop\n"} {"id": "freecad-docs:wiki/Path_ToolBitDock.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Path_ToolBitDock.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Path_ToolBitDock.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "bf73084e0b25b9ef944313e98a011ef5e8c861060da52000b2a40ca0a7019c23", "bytes": 136, "tokens": 61, "text": "# Path ToolBitDock\n1. REDIRECT [CAM_ToolBitDock](CAM_ToolBitDock.md)\n\n\n---\n⏵ [documentation index](../README.md) > Path ToolBitDock\n"} {"id": "freecad-docs:wiki/Pivy.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Pivy.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Pivy.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a6ebab645fab0602307a3994044cf88d79a7b51f8cd736be988dfd0d5b567d60", "bytes": 6751, "tokens": 2102, "text": "# Pivy\n## Introduction\n\n[Pivy](Pivy.md) is a [Python](Python.md) binding library for [Coin](https://github.com/coin3d), the 3D-rendering library used in FreeCAD to display things in a [3D view](3D_view.md). Coin is an open source implementation of the \\\"Open Inventor\\\" specification to handle graphics. Therefore, in FreeCAD, the terms \\\"Pivy\\\", \\\"Coin\\\" or \\\"Open Inventor\\\" refer to the same thing essentially.\n\nWhen imported in a running Python interpreter, Pivy allows us to communicate directly with any running Coin [scenegraph](Scenegraph.md), such as the [3D view](3D_view.md), or even to create new ones. Pivy is not required to compile FreeCAD, but it is required at runtime when running Python-based workbenches that create shapes on screen, like [Draft](Draft_Workbench.md) and [BIM](BIM_Workbench.md). Because of this, Pivy is normally installed when installing a distribution of FreeCAD.\n\nThe Coin library is divided into several pieces, Coin itself for manipulating scenegraphs, and bindings for several GUI systems, such as Windows and Qt. If present on the system, those modules are available to Pivy as well. The Coin module is always present, and it is what we will use anyway, since we won\\'t need to care about anchoring our 3D display in any interface, that is already done by FreeCAD. All we need to do is this:\n\n \n```python\nfrom pivy import coin\n```\n\n## Scenegraph\n\nWe saw on the [Scenegraph](Scenegraph.md) page how a typical Coin scene is organized. Everything that appears in a [3D view](3D_view.md) is a Coin scenegraph, organized in the same way. We have one root node, and all objects on the screen are its children.\n\nFreeCAD has an easy way to access the root node of a 3D view scenegraph:\n\n \n```python\nsg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()\nprint(sg)\n```\n\nThis will return the root node:\n\n \n```python\n >\n```\n\nWe can inspect the immediate children of our scene:\n\n \n```python\nfor node in sg.getChildren():\n print(node)\n```\n\nSome of those nodes, such as `SoSeparator` or `SoGroup` nodes, can have children themselves. The complete list of the available Coin objects can be found in the official Coin documentation.\n\nLet\\'s try to add something to our scenegraph now. We\\'ll add a nice red cube:\n\n \n```python\ncol = coin.SoBaseColor()\ncol.rgb = (1, 0, 0)\ncub = coin.SoCube()\nmyCustomNode = coin.SoSeparator()\nmyCustomNode.addChild(col)\nmyCustomNode.addChild(cub)\nsg.addChild(myCustomNode)\n```\n\nNow, let\\'s try this:\n\n \n```python\ncol.rgb = (1, 1, 0)\n```\n\nAs you can see everything is still accessible and modifiable on-the-fly. No need to recompute or redraw anything, Coin takes care of everything. You can add stuff to your scenegraph, change properties, hide stuff, show temporary objects, anything. Of course, this only concerns the display in the 3D view. That display gets recomputed by FreeCAD on file open, and when an object needs recomputing. So, if you change the aspect of an existing FreeCAD object, those changes will be lost if the object gets recomputed or when you reopen the file.\n\nAs already mentioned, in an openInventor scenegraph the order is important. A node affects what comes next. For example, if we want to have the ability to move our cube we will need to add a `SoTranslation` node **before** the cube:\n\n \n```python\ncol = coin.SoBaseColor()\ncol.rgb = (1, 0, 0)\ntrans = coin.SoTranslation()\ntrans.translation.setValue([0, 0, 0])\ncub = coin.SoCube()\nmyCustomNode = coin.SoSeparator()\nmyCustomNode.addChild(col)\nmyCustomNode.addChild(trans)\nmyCustomNode.addChild(cub)\nsg.addChild(myCustomNode)\n```\n\nTo move our cube we can now do:\n\n \n```python\ntrans.translation.setValue([2, 0, 0])\n```\n\nFinally, removing something is done with:\n\n \n```python\nsg.removeChild(myCustomNode)\n```\n\n\n## Callbacks\n\nA [callback mechanism](http://en.wikipedia.org/wiki/Callback_%28computer_science%29) is a system that permits a library, such as our Coin library, to call you back, that is, to call a certain function from your currently running Python object. That way Coin can notify you that some specific event occurred in the scene. Coin can watch very different things, such as mouse position, mouse button clicks, keyboard keys being pressed, and many more.\n\nFreeCAD features an easy way to use such callbacks:\n\n \n```python\nfrom pivy import coin\n\nclass ButtonTest:\n def __init__(self):\n self.view = FreeCADGui.ActiveDocument.ActiveView\n self.callback = self.view.addEventCallbackPivy(coin.SoMouseButtonEvent.getClassTypeId(), self.getMouseClick) \n\n def getMouseClick(self, event_cb):\n event = event_cb.getEvent()\n if event.getState() == coin.SoMouseButtonEvent.DOWN:\n print(\"Alert!!! A mouse button has been improperly clicked!!!\")\n self.view.removeEventCallbackPivy(coin.SoMouseButtonEvent.getClassTypeId(), self.callback)\n\nButtonTest()\n```\n\nThe callback has to be initiated from an object, because that object must still be running when the callback occurs. See also a [complete list](Code_snippets#Observe_mouse_events_in_the_3D_viewer_via_Python.md) of possible events and their parameters, or the official Coin documentation.\n\n\n## Documentation\n\nUnfortunately, Pivy doesn\\'t have its own documentation. However, since it is an accurate wrapper of the Coin library, you can read the C++ reference for information. In this case, you need to translate the C++ class naming style to Python style.\n\nIn C++:\n\n \n```python\nSoFile::getClassTypeId()\n```\n\nIn Pivy:\n\n \n```python\nSoFile.getClassId()\n```\n\n- [Coin3D](https://github.com/coin3d) homepage.\n- [Pivy](https://github.com/coin3d/pivy) homepage.\n- [Coin3D wiki](https://github.com/coin3d/coin/wiki), at GitHub.\n- [Coin3D wiki documentation](https://github.com/coin3d/coin/wiki/Documentation), at GitHub.\n- [Coin3D Documentation](https://coin3d.github.io/Coin/html/), latest automatically generated Doxygen documentation.\n- [(Open)Inventor Mentor](https://webdocs.cs.ualberta.ca/~graphics/books/mentor.pdf) - recommended.\n\n### Older\n\nThese links provide reference documentation for Coin v3.x. The differences with v4.x are minimal, so they may still be useful.\n\n- [Coin3D Documentation](https://coin3d.bitbucket.io/Coin/index.html), at BitBucket.\n- [Coin3D Documentation](https://grey.colorado.edu/coin3d/index.html), at University of Colorado.\n- [Open Inventor Reference Documentation](https://mevislabdownloads.mevis.de/docs/current/MeVis/ThirdParty/Documentation/Publish/OpenInventorReference/index.html), by MeVisLab.\n\n\n---\n⏵ [documentation index](../README.md) > [Developer Documentation](Category_Developer%20Documentation.md) > [Python Code](Category_Python%20Code.md) > Pivy\n"} {"id": "freecad-docs:wiki/Points_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Points_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Points_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "50d72a88cddd3957e6ac55388b5775030f5936aebff863742b364cc2229397be", "bytes": 2807, "tokens": 972, "text": "# \"Points Points Workbench\n\n \n\n## Introduction\n\nThe \"\" [Points Workbench](Points_Workbench.md) offers specific tools for working with [point clouds](http://en.wikipedia.org/wiki/Point_cloud). The workbench is still in development.\n\nA point cloud is a collection of points in 3D space. A point cloud is generally produced by scanning the surface of a solid object. The cloud of points can then be used for many purposes including building a mesh for the object, reconstructing the surfaces and solid volumes, reverse engineering, as well as for visualization and quality inspection.\n\n## Tools\n\nAll Points Workbench tools can be accessed from the **Points** menu and the **Points tools** toolbar.\n\n- \"\" [Import points\\...](Points_Import.md): Imports a point cloud from a file.\n\n- \"\" [Export points\\...](Points_Export.md): Exports a point cloud to a file.\n\n- \"\" [Convert to points\\...](Points_Convert.md): Creates point clouds from shape objects.\n\n- \"\" [Structured point cloud](Points_Structure.md): Creates a structured point cloud from the points of an existing point cloud.\n\n- \"\" [Merge point clouds](Points_Merge.md): Creates a point cloud by combining the points of two or more point clouds.\n\n- \"\" [Cut point cloud](Points_PolyCut.md): Cuts points from point clouds.\n\n## Notes\n\n- [Draft](Draft_Workbench.md) commands such as \"\" [Draft Line](Draft_Line.md) and \"\" [Draft B-spline](Draft_BSpline.md) can be used to connect the points in a point cloud. Use \"\" [Draft Snap Endpoint](Draft_Snap_Endpoint.md) to snap to the points.\n- [Python](Python.md) can be used to analyze and process point clouds. See the following forum discussions:\n - [Inspecting Point cloud](http://forum.freecadweb.org/viewtopic.php?f=3&t=16098).\n - [Fläche aus Messwerten](http://forum.freecadweb.org/viewtopic.php?f=13&t=15988) (German)\n - [Schnitte durch Flächen aus Messwerten](http://forum.freecadweb.org/viewtopic.php?f=13&t=16103) (German)\n\n\n {{Points Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Workbenches](Category_Workbenches.md) > [Points](Category_Points.md) > Points Workbench\n"} {"id": "freecad-docs:wiki/Preference_Packs.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Preference_Packs.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Preference_Packs.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "690f9077b58cc80dafb7d513cc7d7e78120e45c034b8eca2ba24b6ec97b233e3", "bytes": 14708, "tokens": 4536, "text": "# Preference Packs\n## Introduction\n\nA **Preference Pack** is a distributable collection of user preferences ((v0.20) ) that can be installed as an add-on and applied as a single set. Any user parameter that can be set in the user.cfg file can be included in a Preference Pack. Applying a preference pack sets all of the variables in the supplied CFG file without modifying any other user settings. For example, these packs can be used to create \\\"Themes\\\" by bundling together a custom stylesheet along with a set of user preferences that sets the various colors and styles of items in FreeCAD that aren\\'t controlled by the stylesheet.\n\n## Main Preference Packs user interface \n\nMost user interaction with installed Preference Packs is via the **General** tab in the **General settings** section of the [Preferences editor](Preferences_Editor.md).\n\n\"\"\n\n## Applying an installed pack \n\nTo apply a Preference Pack, click the **Apply** button next to its name in the **General** tab of the [Preferences editor](Preferences_Editor.md). The core of a Preference Pack is a set of user preferences. When applying a pack each of these preferences is changed to the value defined in the pack. Optionally, the pack author may have included a pre- and/or post-application macro that may also be run. Because packs can potentially make large (and possibly undesirable) changes to your user preferences, a timestamped backup of your original preferences is taken, and stored in **FREECAD_USER_DATA/SavedPreferencePacks/Backups**. These backups are retained for one week.\n\n## Creating a new pack \n\nPacks can be created by hand, or jump-started by using the **Save new...** button in the **General** tab of the [Preferences editor](Preferences_Editor.md). Clicking the button shows a dialog requesting a name for the new pack, and displays a set of checkboxes allowing only a subset of preferences to be stored.\n\n\"\"\n\nBecause of the way FreeCAD uses preferences internally, only items contained in these template files can be saved automatically using this procedure. Items not included in the template files must be manually included in the pack\\'s \\*.cfg file. There is no built-in limit to which preferences items may be included in a preference pack, but authors are strongly discouraged from changing a user\\'s set language, or from modifying the recent files list, or from changing anything related to a temporary UI state (e.g. the saved size of a resizable window, etc.).\n\n### Template details \n\nThese sections list all preferences contained in the built-in templates. Right now they are focused on appearance-related items, but pull requests and forum suggestions for additional inclusions are welcome. Installed Addons may also provide their own templates (not documented here). Click \\\"Expand\\\" on the far right of each entry to see the list.\n\n\n
\n\n\n**Arch Colors**\n\n\n
\n\n- Preferences/Mod/Arch/WallColor\n- Preferences/Mod/Arch/StructureColor\n- Preferences/Mod/Arch/RebarColor\n- Preferences/Mod/Arch/WindowColor\n- Preferences/Mod/Arch/WindowGlassColor\n- Preferences/Mod/Arch/PanelColor\n- Preferences/Mod/Arch/ColorHelpers\n- Preferences/Mod/Arch/defaultSpaceColor\n\n\n
\n\n\n
\n\n\n
\n\n\n**Console Colors**\n\n\n
\n\n- Preferences/OutputWindow/colorText\n- Preferences/OutputWindow/colorLogging\n- Preferences/OutputWindow/colorWarning\n- Preferences/OutputWindow/colorError\n\n\n
\n\n\n
\n\n\n
\n\n\n**Draft Colors**\n\n\n
\n\n- Preferences/Mod/Draft/constructioncolor\n- Preferences/Mod/Draft/gridTransparency\n- Preferences/Mod/Draft/gridColor\n- Preferences/Mod/Draft/snapcolor\n\n\n
\n\n\n
\n\n\n
\n\n\n**Editor Colors**\n\n\n
\n\n- Preferences/Editor/Text\n- Preferences/Editor/Bookmark\n- Preferences/Editor/Breakpoint\n- Preferences/Editor/Keyword\n- Preferences/Editor/Comment\n- Preferences/Editor/Block comment\n- Preferences/Editor/Number\n- Preferences/Editor/String\n- Preferences/Editor/Character\n- Preferences/Editor/Class name\n- Preferences/Editor/Define name\n- Preferences/Editor/Operator\n- Preferences/Editor/Python output\n- Preferences/Editor/Python error\n- Preferences/Editor/Current line highlight\n\n\n
\n\n\n
\n\n\n
\n\n\n**Editor Font**\n\n\n
\n\n- Preferences/Editor/FontSize\n- Preferences/Editor/Font\n\n\n
\n\n\n
\n\n\n
\n\n\n**Main Window Layout**\n\n\n
\n\n- Preferences/MainWindow/DockWindows/Std_SelectionView\n- Preferences/MainWindow/DockWindows/Std_ComboView\n- Preferences/MainWindow/DockWindows/Std_ReportView\n- Preferences/MainWindow/DockWindows/Std_PythonView\n- Preferences/MainWindow/DockWindows/Std_TreeView\n- Preferences/MainWindow/DockWindows/Std_PropertyView\n- Preferences/MainWindow/DockWindows/Std_DAGView\n- Preferences/MainWindow/Toolbars/File\n- Preferences/MainWindow/Toolbars/Workbench\n- Preferences/MainWindow/Toolbars/Macro\n- Preferences/MainWindow/Toolbars/View\n- Preferences/MainWindow/Toolbars/Structure\n- Preferences/MainWindow/Toolbars/Navigation\n\n\n
\n\n\n
\n\n\n
\n\n\n**Path Colors**\n\n\n
\n\n- Preferences/Mod/Path/DefaultNormalPathColor\n- Preferences/Mod/Path/DefaultRapidPathColor\n- Preferences/Mod/Path/DefaultPathMarkerColor\n- Preferences/Mod/Path/DefaultExtentsColor\n- Preferences/Mod/Path/DefaultProbePathColor\n- Preferences/Mod/Path/DefaultHighlightPathColor\n- Preferences/Mod/Path/DefaultBBoxSelectionColor\n- Preferences/Mod/Path/DefaultBBoxNormalColor\n\n\n
\n\n\n
\n\n\n
\n\n\n**Sketcher Colors**\n\n\n
\n\n- Preferences/View/SketchEdgeColor\n- Preferences/View/SketchVertexColor\n- Preferences/View/EditedEdgeColor\n- Preferences/View/EditedVertexColor\n- Preferences/View/ConstructionColor\n- Preferences/View/ExternalColor\n- Preferences/View/InvalidSketchColor\n- Preferences/View/FullyConstrainedColor\n- Preferences/View/InternalAlignedGeoColor\n- Preferences/View/FullyConstraintElementColor\n- Preferences/View/FullyConstraintConstructionElementColor\n- Preferences/View/FullyConstraintInternalAlignmentColor\n- Preferences/View/FullyConstraintConstructionPointColor\n- Preferences/View/ConstrainedIcoColor\n- Preferences/View/NonDrivingConstrDimColor\n- Preferences/View/ConstrainedDimColor\n- Preferences/View/ExprBasedConstrDimColor\n- Preferences/View/DeactivatedConstrDimColor\n- Preferences/View/CursorTextColor\n- Preferences/View/CursorCrosshairColor\n- Preferences/View/CreateLineColor\n\n\n
\n\n\n
\n\n\n
\n\n\n**Start Colors**\n\n\n
\n\n- Preferences/Mod/Start/BackgroundColor1\n- Preferences/Mod/Start/BackgroundTextColor\n- Preferences/Mod/Start/PageColor\n- Preferences/Mod/Start/PageTextColor\n- Preferences/Mod/Start/BoxColor\n- Preferences/Mod/Start/LinkColor\n- Preferences/Mod/Start/BackgroundColor2\n\n\n
\n\n\n
\n\n\n
\n\n\n**TechDraw Colors**\n\n\n
\n\n- Preferences/Mod/TechDraw/Decorations/SectionColor\n- Preferences/Mod/TechDraw/Decorations/CenterColor\n- Preferences/Mod/TechDraw/Decorations/VertexColor\n- Preferences/Mod/TechDraw/Decorations/HighlightColor\n- Preferences/Mod/TechDraw/Colors/Hatch\n- Preferences/Mod/TechDraw/Colors/Background\n- Preferences/Mod/TechDraw/Colors/PreSelectColor\n- Preferences/Mod/TechDraw/Colors/HiddenColor\n- Preferences/Mod/TechDraw/Colors/SelectColor\n- Preferences/Mod/TechDraw/Colors/NormalColor\n- Preferences/Mod/TechDraw/Colors/CutSurfaceColor\n- Preferences/Mod/TechDraw/Colors/GeomHatch\n- Preferences/Mod/TechDraw/Colors/FaceColor\n- Preferences/Mod/TechDraw/Colors/ClearFace\n\n\n
\n\n\n
\n\n\n
\n\n\n**Window Colors**\n\n\n
\n\n- Preferences/View/BacklightColor\n- Preferences/View/BackgroundColor\n- Preferences/View/BackgroundColor2\n- Preferences/View/BackgroundColor3\n- Preferences/View/BackgroundColor4\n- Preferences/View/Simple\n- Preferences/View/Gradient\n- Preferences/View/UseBackgroundColorMid\n- Preferences/View/HighlightColor\n- Preferences/View/SelectionColor\n- Preferences/View/DefaultShapeColor\n- Preferences/View/RandomColor\n- Preferences/TreeView/TreeEditColor\n- Preferences/TreeView/TreeActiveColor\n- Preferences/MainWindow/TiledBackground\n- Preferences/MainWindow/StyleSheet\n\n\n
\n\n\n
\n\n\n### Preference Pack structure \n\nWhile the core of most Preference Packs is a single configuration file, because of their design for distribution, some auxiliary structure is also required. Four core files define a pack, laid out in the following directory structure (for a Preference Pack named \\\"SamplePreferencePack\\\"):\n- package.xml\n- SamplePreferencePack/\n - SamplePreferencePack.cfg\n - pre.FCMacro\n - post.FCMacro\n\n\nThe [Package Metadata](Package_Metadata.md) file, package.xml, defines the name of the Preference Pack, and allows you to assign other metadata items such as a version number, author information, and tags (which are displayed in the main UI as a comma-separated list). For a Preference Pack saved using the GUI as explained above, a single package.xml file is created in the **FREECAD_USER_DATA/SavedPreferencePacks/** directory. This file is used to describe the details such as the name and tags of all user-saved preference packs. To change a pack\\'s name or tags, that file must be manually edited with a text editor. It can also provide a template for distributed preference packs: the author of a distributed pack may choose to start by saving a pack locally, then copying the pack\\'s subdirectory and this global package.xml file as a starting point, modifying the copied package.xml file to only reference the pack being packaged for distribution.\n\nOther files may also be included in a distribution, depending on what\\'s required for the pack. A well-produced preference pack designed for distributing a visual theme called \\\"DarkSide\\\" for FreeCAD might look like:\n- package.xml\n- resources/\n - icons/\n - DarkSide.svg\n- DarkSide/\n - DarkSide.cfg\n - DarkSide.qss\n\n\nNote the omission of the *pre.FCMacro* and *post.FCMacro* files, which are often unnecessary, as well as the inclusion of an icon (for display by the \"\" [Addon Manager](Std_AddonMgr.md)), and the inclusion of a qss file (which will then be referenced in the *DarkSide.cfg* configuration data file).\n\nThe pre- and post- macro files are standard FreeCAD Python macros, and may contain any commands valid in such a macro. If the pre.FCMacro raises an exception (of any type), the application of the preference pack is cancelled. If the post.FCMacro raises an exception (of any type), the application of the pack is rolled back using the backup taken prior to its application. For example, these macros may be used to query the user for license acceptance, or to verify they are happy with the final state of their system after application.\n\nThe package.xml file for this example pack might be:\n\n\n \n \n DarkSide Theme Package\n A preference pack including a stylesheet and other GUI color information for a Dark mode.\n 1.0.0\n Chris Hennes\n GPLv3\n https://github.com/chennes/DarkSideThemePackage\n resources/icons/DarkSide.svg\n\n \n \n DarkSide\n Dark mode color scheme\n color\n stylesheet\n dark\n DarkSide.qss\n \n \n\n \n\n\n### Including templates in your add-on \n\nMany add-ons have user-specifiable preference information that is added to the user.cfg file. An add-on author may also choose to provide a Preference Pack Template file that lists the user configuration variables that can be automatically saved using the \\\"Save new pack\\\" method described above. To include these template files, add-on authors should create a subdirectory in their package called either \\\"PreferencePackTemplates\\\" or \\\"preference_pack_templates\\\". Within that folder should be one or more \\*.cfg files: each must be a valid, well-formed user.cfg XML file containing one or more configuration variables set to their default values. The name of the file should reflect its purpose, e.g. \\\"colors.cfg\\\", \\\"active_tabs.cfg\\\", etc. This set of files will be presented to the user when they save a new preference pack, with each file receiving a checkable entry in the list of items to save. The filename is used to generate the UI entry, with underscores replaced by spaces (and the extension omitted).\n\n## Distributing a pack \n\nPreference Packs are distributed identically to [External Workbenches](External_workbenches.md) through the \"\" [Addon Manager](Std_AddonMgr.md). To install a pack manually, use git to clone the package repository into your FreeCAD data directory (enter `App.getUserAppDataDir()` in the [Python console](Python_console.md) to get this path), in a subdirectory called \\\"Preference Packs\\\". Note that user-installed packs with the same name as an included pack take precedence.\n\nSee also [Private Preference Packs](Private_Preference_Packs.md).\n\n\n---\n⏵ [documentation index](../README.md) > [User Documentation](Category_User%20Documentation.md) > [Developer Documentation](Category_Developer%20Documentation.md) > Preference Packs\n"} {"id": "freecad-docs:wiki/Private_Preference_Packs.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Private_Preference_Packs.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Private_Preference_Packs.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "796745e92415e008bb6baee8a512250663d64819d2df99dcbfb1c40e2998f4bf", "bytes": 1588, "tokens": 478, "text": "---\n TutorialInfo:\n Topic: Custom Repositories\n Level: Intermediate/Advanced\n Author: drmacro\n FCVersion: 1.0 or above\n Files: TBD\n---\n\n# Private Preference Packs\n\n \n\n\n## Overview\n\nPrivate [preference packs](Preference_Packs.md) can be added by adding custom github repositories to the [Addon manager](Std_AddonMgr.md). This allows testing or simply private usage.\n\nSee also [Preference Packs](Preference_Packs.md).\n\n## Add custom repository \n\nBegin by adding a custom repository. Go to **Edit → Preferences → Addon manager options** and click the **+** button to open the **Custom repository** dialog.\n\n \"\" \n\n### Custom repository dialog \n\nEnter the URL of the github repository and the branch.\n\n ![](images/Preferences_AM_customrepo.png ) \n\nIn this example I have added:\n\n\n\nClick **OK** when complete.\n\n### Preferences with custom repository added \n\n \"\" \n\nClick **OK** when complete.\n\n## Custom preference pack in Addon manager \n\nThe custom pack can now be installed using **Tools → Addon manager**.\n\n \"\" \n\n## Apply the preference pack \n\nOnce installed go to **Edit → Preferences → General**, find the preference pack, and click **Apply**. Follow any instructions offered.\n\n \"\"\n\n\n---\n⏵ [documentation index](../README.md) > Private Preference Packs\n"} {"id": "freecad-docs:wiki/Qt_Example.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Qt_Example.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Qt_Example.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0aa26fc48a04f8eee74b8bd3b0bf7e611d2cada60948eb6cb0be8ee1cced12a4", "bytes": 57320, "tokens": 16075, "text": "# Qt Example\n{{Macro\n|Name=Macro Qt Example\n|Icon=MEPlan.png\n|Description=It describes Qt commands.\n|Author=Mario52\n|Version=0.4\n|Date=2019-06-19\n|FCVersion=All\n|Download=
\n[https://www.freecadweb.org/wiki/images/a/a7/MEpipe01.png MEpipe01]
\n[https://www.freecadweb.org/wiki/images/5/5b/MEpipe02.png MEpipe02]
\n[https://www.freecadweb.org/wiki/images/e/e4/MEPlan.png MEPlan]
\n[https://www.freecadweb.org/wiki/images/3/30/MEPlanD.png MEPlanD]
\n[https://www.freecadweb.org/wiki/images/d/d8/MEPlanF.png MEPlanF]
\n[https://www.freecadweb.org/wiki/images/9/9f/MEPlanT.png MEPlanT]
\n[https://www.freecadweb.org/wiki/images/f/f2/MEPlanI.png MEPlanI]
\n[https://www.freecadweb.org/wiki/images/e/e6/MEPlanFC.png MEPlanFC]
\n[https://www.freecadweb.org/wiki/images/d/d2/MEPlanPY.png MEPlanPY]\n|SeeAlso=[Dialog creation](Dialog_creation.md)\n}}\n\nThis macro is an example of using Qt commands their connections, extraction and data assignment.\n\nImage:Qt_Example_00.png\\|Qt example Image:Qt_Example_01.png\\|Qt example details\n\nAre treated:\n\n1. **icon for window** : The icon displayed on main window\n2. **horizontalSlider** : horizontal slider its connection and data extraction / assignment\n3. **progressBar horizontal** : progress bar horizontal its connection and data extraction / assignment\n4. **verticalSlider** : vertical slider its connection and data extraction / assignment\n5. **progressBar vertical** : progress bar vertical its connection and data extraction / assignment\n6. **lineEdit** : line edit its connection and data extraction / assignment\n7. **lineEdit** : line edit its connection and data extraction / assignment\n8. **doubleSpinBox** : double spinbox its connection and data extraction / assignment\n9. **doubleSpinBox** :\n10. **doubleSpinBox** :\n11. **button** : button its connection\n12. **button** :\n13. **radioButton** : radio button with icons its connection and checked\n14. **checkBox** : checkbox with icon its connection checked and unchecked\n15. **textEdit** : text edit its connection and data extraction / assignment\n16. **graphicsView** : graphic view with 2 graphs and method used for change image\n\nThe tools used are:\n\n [python-2.7.8](https://www.python.org/downloads/)\n\n[PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32](https://riverbankcomputing.com/software/pyqt/download) \n\nFor convert the file .ui in .py you must uses **pyuic.py** is located in \\\"C:\\\\Python27\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py\\\" (for Windows)\n\nyou can create a convertuitopy.bat file to automate the process:\n\n**1:** Create a new file in your Qt working directory and name it **convertuitopy.bat**\n\n**2:** Edit the file and paste this line there\n\n**@\\\"C:\\\\Python27\\\\python\\\" \\\"C:\\\\Python27\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py\\\" -x %1.ui \\> %1.py**\n\n**3:** then in a Dos console type **convertuitopy myproject** (Do not give extension the command automatically adds)\n\n**4:** monprojet.py your file is created\n\n### The icons used \n\n ![](images/MEpipe01.png ) ![](images/MEpipe02.png ) ![](images/MEPlan.png ) ![](images/MEPlanD.png ) ![](images/MEPlanF.png ) ![](images/MEPlanT.png ) ![](images/MEPlanI.png )\n\n![](images/MEPlanFC.png ) ![](images/MEPlanPY.png ) \n\nYou must copy and paste the images in the same directory as the macro, here:\n\n Linux : \\\"**home/user/.FreeCAD/Macro**\\\"\n\nWindows : \\\"**C:\\\\Users\\\\UserName\\\\AppData\\\\Roaming\\\\FreeCAD\\\\Macro**\\\" \n\n## Script\n\nThe contents of the file **Qt_Example.FCMacro** are given below:\n\n {{MacroCode|code=\n# -*- coding: utf-8 -*-\n\"\"\"\n***************************************************************************\n* Copyright (c) 2015 2017 2019 *\n* *\n* This file is a supplement to the FreeCAD CAx development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n* *\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n***************************************************************************\n* WARNING! All changes in this file will be lost and * \n* may cause malfunction of the program *\n***************************************************************************\n\"\"\"\n# this macro is made with Python 2.7 and Qt 4.8.7\n# \n# the modules used hare :\n# python-2.7.8.msi # https://www.python.org/downloads/\n# PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe # https://riverbankcomputing.com/software/pyqt/download\n#\n# FreeCAD\n##OS: Windows 8 # OS: Windows 10 # OS: Windows 10 (10.0)\n##Word size of OS: 64-bit # Word size of OS: 64-bit # Word size of OS: 64-bit\n##Word size of FreeCAD: 64-bit # Word size of FreeCAD: 64-bit # Word size of FreeCAD: 64-bit\n##Version: 0.15.4671 (Git) # Version: 0.16.6706 (Git) # Version: 0.19.16624 (Git)\n##\"Branch: releases/FreeCAD-0-15 # Build type: Release # Build type: Release\n##Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c # Branch: releases/FreeCAD-0-16 # Branch: master\n##Python version: 2.7.8 # Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0# Hash: 222ae7305fdf1097e4ef3d050f69dff47dbd8786\n##Qt version: 4.8.6 # Python version: 2.7.8 # Python version: 3.6.8\n##Coin version: 4.0.0a # Qt version: 4.8.7 # Qt version: 5.12.1\n##OCC version: 6.8.0.oce-0.17 # Coin version: 4.0.0a # Coin version: 4.0.0a\n# # OCC version: 6.8.0.oce-0.17 # OCC version: 7.3.0\n#\n# this macro is an example of use some buttons and connection :\n# ********** is a connection ** references lines **********\n# \n# horizontalScrollBar lines 151 to 161, 431, 432, 642\n# def on_horizontal_scrolling(self, val_X): #connection lines 161, 526, 531\n# verticalScrollBar lines 163 to 173, 393, 394, 433, 643\n# def on_vertical_scrolling(self, val_Y): #connection lines 173, 534, 539\n# horizontalSlider lines 174 to 181, 575, 577, 644\n# def on_horizontal_slider(self, val_X): #connection lines 181, 542, 553\n# verticalSlider lines 183 to 188, 593, 595, 645\n# def on_vertical_slider(self, val_Y): #connection lines 188, 556, 564\n# progressBar\n# progressBar_1_Red lines 190 to 199, 533, 548, 579\n# progressBar_1_Green lines 205 to 214, 552, 583\n# progressBar_1_Blue lines 217 to 228, 553, 584\n# progressBar_1_gradient lines 230 to 242, 554, 585\n# progressBar_2 lines 244 to 252, 540, 565, 600\n\n# lineEdit\n# lineEdit_1 lines 256 to 262, 455, 531, 550, 644\n# def on_lineEdit_1_Pressed(self): #connection lines 261, 262, 572\n# lineEdit_2 lines 264 to 270, 458, 539, 564, 645\n# def on_lineEdit_2_Pressed(self): #connection lines 269, 270, 590\n# doubleSpinBox\n# doubleSpinBox_1 lines 272 to 279, 461, 462, 641\n# def on_doubleSpinBox_1_valueChanged(self,echelle): #connection lines 279, 674\n# doubleSpinBox_2 lines 281 to 287, 464, 465, 642\n# def on_doubleSpinBox_2_valueChanged(self,angle): #connection lines 287, 681\n# doubleSpinBox_3 lines 289 to 295, 467, 468, 643 \n# def on_doubleSpinBox_3_valueChanged(self,epaisseur): #connection lines 295, 687\n# pushButton\n# pushButton_1 lines 297 to 301, 450, 451, 631, 663, 670\n# def on_pushButton_1_clicked(self): #connection lines 301, 636\n# pushButton_2 lines 303 to 307, 452, 453\n# def on_pushButton_2_clicked(self): #connection lines 307, 627\n# groupBox lines 309 to 312, 315, 326, 336, 346, 356, 439\n# radioButton\n# radioButton_1 lines 315 to 323, 440, 441, 486, 487, 651\n# def on_radioButton_1_clicked(self): #connection lines 323, 482\n# radioButton_2 lines 325 to 333, 442, 443, 494, 495\n# def on_radioButton_2_clicked(self): #connection lines 333, 490\n# radioButton_3 lines 335 to 343, 444, 445, 501, 502\n# def on_radioButton_3_clicked(self): #connection lines 343, 498\n# radioButton_4 lines 345 to 353, 446, 447, 509, 510\n# def on_radioButton_4_clicked(self): #connection lines 353, 505\n# checkBox\n# checkBox_1 lines 355 to 364, 448, 449, 610, 614, 615, 621, 622, 652, 655\n# def on_checkBox_1_clicked(self): #connection lines 360, 606\n# textEdit\n# textEdit lines 391 to 399, 534, 542, 556, 567, 650, 695\n# def on_textEdit_Changed(self): #connection lines 399, 694\n# graphicsView lines 401 to 410, 662, 669\n# \n# \n# \n# \n \n__title__ = \"Examples_QT \"\n__author__ = \"mario52\"\n__version__ = \"00.04\"\n__date__ = \"14/06/2019\"\n \n__url__ = \"http://www.freecadweb.org/index-fr.html\"\n__Comment__ = \"Example make and use buttom and . . . .\"\n__Communication__ = \"http://www.freecadweb.org/wiki/index.php?title=User:Mario52\"\n__IconL__ = \"home/user/.FreeCAD\"\n__IconW__ = \"C:/Users/Mario/AppData/Roaming/FreeCAD/Macro\"\n \nimport PySide\nfrom PySide import QtCore, QtGui\n#from PySide.QtGui import qApp, QApplication, QGridLayout, QLineEdit, QPushButton, QTextBrowser, QWidget, QProgressBar\n \nglobal switch ; switch = 0\n \nglobal path\n#path = FreeCAD.ConfigGet(\"AppHomePath\") # path FreeCAD installation\n#path = FreeCAD.ConfigGet(\"UserAppData\") # path FreeCAD User data\n#path = \"your path\" # your directory path\nparam = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macro\")# macro path\npath = param.GetString(\"MacroPath\",\"\") + \"/\" # macro path\npath = path.replace(\"\\\\\",\"/\") # convert the \"\\\" to \"/\"\nprint( \"Path for the icons : \" , path ) # \n \ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\n \ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n \nclass Ui_MainWindow(object):\n def setupUi(self, MainWindow):\n self.window = MainWindow\n global switch\n \n MainWindow.setObjectName(_fromUtf8(\"MainWindow\"))\n MainWindow.resize(400, 450)\n MainWindow.setMinimumSize(QtCore.QSize(400, 450))\n MainWindow.setMaximumSize(QtCore.QSize(400, 450))\n self.widget = QtGui.QWidget(MainWindow)\n self.widget.setObjectName(_fromUtf8(\"widget\"))\n \n## section horizontalScrollBar (same Slider)\n# self.horizontalScrollBar = QtGui.QScrollBar(self.widget) # create horizontalScrollBar\n# self.horizontalScrollBar.setGeometry(QtCore.QRect(64, 5, 302, 16)) # coordinates position\n# #self.horizontalScrollBar.setMinimum(-100) # minimum value\n# self.horizontalScrollBar.setMaximum(100) # maximum value\n# #self.horizontalScrollBar.setSingleStep(3) # here step 3 ..\n# self.horizontalScrollBar.setValue( 5) # value by default\n# self.horizontalScrollBar.setOrientation(QtCore.Qt.Horizontal) # orientation Horizontal\n# #self.horizontalScrollBar.setInvertedAppearance(True) # displacement rigth to left or left to rigth value \"True\" or \"False\"\n# self.horizontalScrollBar.setObjectName(_fromUtf8(\"horizontalScrollBar\")) # object Name\n# self.horizontalScrollBar.valueChanged.connect(self.on_horizontal_scrolling) # connect on \"def on_horizontal_scrolling:\" for execute action\n#\n## section verticalScrollBar\n# self.verticalScrollBar = QtGui.QScrollBar(self.widget) # create verticalScrollBar\n# self.verticalScrollBar.setGeometry(QtCore.QRect(20, 44, 20, 250)) # coordinates position\n# #self.verticalScrollBar.setMinimum(-100) # minimum value\n# self.verticalScrollBar.setMaximum(100) # maximum value\n# #self.verticalScrollBar.setSingleStep(3) # here step 3 .. degault 1\n# self.verticalScrollBar.setValue(5) # value by default\n# self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical) # orientation Vertical\n# self.verticalScrollBar.setInvertedAppearance(True) # displacement top to bottom or botton to top value \"True\" or \"False\" \n# self.verticalScrollBar.setObjectName(_fromUtf8(\"verticalScrollBar\")) # object Name\n# self.verticalScrollBar.valueChanged.connect(self.on_vertical_scrolling) # connect on \"def on_vertical_scrolling:\" for execute action\n \n# section horizontalSlider \n self.horizontalSlider = QtGui.QSlider(self.widget) # create horizontalSlider\n self.horizontalSlider.setGeometry(QtCore.QRect(64, 5, 302, 16)) # coordinates position\n self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal) # orientation Horizontal\n self.horizontalSlider.setInvertedAppearance(False) # displacement rigth to left or left to rigth value \"True\" or \"False\"\n self.horizontalSlider.setObjectName(_fromUtf8(\"horizontalSlider\")) # object Name\n self.horizontalSlider.valueChanged.connect(self.on_horizontal_slider) # connect on \"def on_horizontal_slider:\" for execute action\n \n# section verticalSlider \n self.verticalSlider = QtGui.QSlider(self.widget) # create verticalSlider\n self.verticalSlider.setGeometry(QtCore.QRect(20, 44, 20, 365)) # coordinates position\n self.verticalSlider.setOrientation(QtCore.Qt.Vertical) # orientation Vertical\n self.verticalSlider.setObjectName(_fromUtf8(\"verticalSlider\")) # object Name\n self.verticalSlider.valueChanged.connect(self.on_vertical_slider) # connect on \"def on_vertical_slider:\" for execute action\n \n# section progressBar 1 Red\n self.progressBar_1_Red = QtGui.QProgressBar(self.widget) # create object progressBar_1\n self.progressBar_1_Red.setGeometry(QtCore.QRect(60, 21, 315, 23)) # coordinates position\n self.progressBar_1_Red.setValue(0) # value by default\n self.progressBar_1_Red.setOrientation(QtCore.Qt.Horizontal) # orientation Horizontal\n self.progressBar_1_Red.setAlignment(QtCore.Qt.AlignCenter) # align text center\n self.progressBar_1_Red.setObjectName(_fromUtf8(\"progressBar_1_Red\")) # object Name\n self.progressBar_1_Red.setToolTip(_translate(\"MainWindow\", \"progressBar_1_Red for lineEdit 1 and horizontal ScrollBar\", None)) # tooltip for explanation\n # a tooltip can be set to all objects\n self.progressBar_1_Red.setStyleSheet(\"QProgressBar {color:black; }\"\n \"QProgressBar:chunk {background-color: #FF0000;}\") # modify the progressBar color \n\n# section progressBar 1 Green\n self.progressBar_1_Green = QtGui.QProgressBar(self.widget) # create object progressBar_1\n self.progressBar_1_Green.setGeometry(QtCore.QRect(60, 51, 315, 23)) # coordinates position\n self.progressBar_1_Green.setValue(0) # value by default\n self.progressBar_1_Green.setOrientation(QtCore.Qt.Horizontal) # orientation Horizontal\n self.progressBar_1_Green.setAlignment(QtCore.Qt.AlignCenter) # align text center\n self.progressBar_1_Green.setObjectName(_fromUtf8(\"progressBar_1_Green\")) # object Name\n self.progressBar_1_Green.setToolTip(_translate(\"MainWindow\", \"progressBar_1_Green for lineEdit 1 and horizontal ScrollBar\", None)) # tooltip for explanation\n # a tooltip can be set to all objects\n self.progressBar_1_Green.setStyleSheet(\"QProgressBar {color:black; }\"\n \"QProgressBar:chunk {background-color: #00FF00;}\") # modify the progressBar color \n\n# section progressBar 1 Blue\n self.progressBar_1_Blue = QtGui.QProgressBar(self.widget) # create object progressBar_1\n self.progressBar_1_Blue.setGeometry(QtCore.QRect(60, 81, 315, 23)) # coordinates position\n self.progressBar_1_Blue.setValue(0) # value by default\n self.progressBar_1_Blue.setOrientation(QtCore.Qt.Horizontal) # orientation Horizontal\n self.progressBar_1_Blue.setAlignment(QtCore.Qt.AlignCenter) # align text center\n self.progressBar_1_Blue.setObjectName(_fromUtf8(\"progressBar_1_Blue\")) # object Name\n self.progressBar_1_Blue.setToolTip(_translate(\"MainWindow\", \"progressBar_1_Blue for lineEdit 1 and horizontal ScrollBar\", None)) # tooltip for explanation\n # a tooltip can be set to all objects\n self.progressBar_1_Blue.setStyleSheet(\n \"QProgressBar {color:black; text-align:right; padding:2px; border-radius: 5px;}\" # modify the progressBar color and display\n \"QProgressBar:chunk {background-color: #0000FF; width: 10px; margin-left:2px;}\")\n\n# section progressBar 1 gradient\n self.progressBar_1_gradient = QtGui.QProgressBar(self.widget) # create object progressBar_1\n self.progressBar_1_gradient.setGeometry(QtCore.QRect(60, 110, 315, 23)) # coordinates position\n self.progressBar_1_gradient.setValue(0) # value by default\n self.progressBar_1_gradient.setOrientation(QtCore.Qt.Horizontal) # orientation Horizontal\n self.progressBar_1_gradient.setAlignment(QtCore.Qt.AlignCenter) # align text center\n self.progressBar_1_gradient.setObjectName(_fromUtf8(\"progressBar_1_gradient\")) # object Name\n self.progressBar_1_gradient.setToolTip(_translate(\"MainWindow\", \"progressBar_1_gradient for lineEdit 1 and horizontal ScrollBar\", None)) # tooltip for explanation\n # a tooltip can be set to all objects\n ##http://pyqt.sourceforge.net/Docs/PyQt4/qlineargradient.html\n self.progressBar_1_gradient.setStyleSheet(\n \"QProgressBar {color:red; text-align:right; padding:1px; }\" # modify the progressBar color and display\n \"QProgressBar:chunk {text-align: center; background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #FFFF00, stop: 1 #00FFFF);}\")\n\n# section progressBar 2\n self.progressBar_2 = QtGui.QProgressBar(self.widget) # create object progressBar_2\n self.progressBar_2.setGeometry(QtCore.QRect(40, 44, 20, 365)) # coordinates position\n self.progressBar_2.setValue(0) # value by default\n self.progressBar_2.setOrientation(QtCore.Qt.Vertical) # position Vertical\n self.progressBar_2.setAlignment(QtCore.Qt.AlignCenter) # align text center (not text displayed ?)\n self.progressBar_2.setOrientation(QtCore.Qt.Vertical) # orientation Vertical\n self.progressBar_2.setObjectName(_fromUtf8(\"progressBar_2\")) # progressBar 2 Y Vertical\n self.progressBar_2.setToolTip(_translate(\"MainWindow\", \"progressBar_2 for lineEdit 2 and vertical ScrollBar\", None)) # tooltip for explanation\n # a tooltip can be set to all objects\n \n# section lineEdit 1\n self.lineEdit_1 = QtGui.QLineEdit(self.widget) # create object lineEdit_1\n self.lineEdit_1.setGeometry(QtCore.QRect(70, 150, 60, 22)) # coordinates position\n self.lineEdit_1.setObjectName(_fromUtf8(\"lineEdit_1\")) # name of object\n self.lineEdit_1.setText(\"0\") # text by default\n #self.lineEdit_1.returnPressed.connect(self.on_lineEdit_1_Pressed) # connect on def \"on_lineEdit_1_Pressed\" for execute actionn # for validate the data with press on return touch\n self.lineEdit_1.textChanged.connect(self.on_lineEdit_1_Pressed) # connect on def \"on_lineEdit_1_Pressed\" for execute actionn # with tips key char by char\n # a tooltip can be set to all objects\n# section lineEdit 2\n self.lineEdit_2 = QtGui.QLineEdit(self.widget) # create object lineEdit_2\n self.lineEdit_2.setGeometry(QtCore.QRect(70, 180, 60, 22)) # coordinates position\n self.lineEdit_2.setObjectName(_fromUtf8(\"lineEdit_2\")) # name of object\n self.lineEdit_2.setText(\"0\") # text by default\n# self.lineEdit_2.returnPressed.connect(self.on_lineEdit_2_Pressed) # connect on def \"on_lineEdit_2_Pressed\" for execute actionn # for validate the data with press on return touch\n self.lineEdit_2.textChanged.connect(self.on_lineEdit_2_Pressed) # connect on def \"on_lineEdit_2_Pressed\" for execute actionn # with tips key char by char\n \n # accelerated minimum maximum singleStep prefix suffix\n self.doubleSpinBox_1 = QtGui.QDoubleSpinBox(self.widget) # create object doubleSpinBox_1\n self.doubleSpinBox_1.setGeometry(QtCore.QRect(70, 210, 62, 22)) # coordinates position\n self.doubleSpinBox_1.setMinimum(-10000.0) # minimum value\n self.doubleSpinBox_1.setMaximum(10000.0) # maximum value\n self.doubleSpinBox_1.setSingleStep(0.1) # step for increase or decrease value here 0.1\n self.doubleSpinBox_1.setObjectName(_fromUtf8(\"doubleSpinBox_1\")) # name of object\n self.doubleSpinBox_1.valueChanged.connect(self.on_doubleSpinBox_1_valueChanged) #connect on def \"on_doubleSpinBox_1_valueChanged\"\n \n self.doubleSpinBox_2 = QtGui.QDoubleSpinBox(self.widget) # create object doubleSpinBox_2\n self.doubleSpinBox_2.setGeometry(QtCore.QRect(70, 240, 62, 22)) # coordinates position\n self.doubleSpinBox_2.setMinimum(-361.0) # minimum value\n self.doubleSpinBox_2.setMaximum(361.0) # maximum value\n self.doubleSpinBox_2.setSingleStep(1) # step for increase or decrease value here 1\n self.doubleSpinBox_2.setObjectName(_fromUtf8(\"doubleSpinBox_2\")) # name of object\n self.doubleSpinBox_2.valueChanged.connect(self.on_doubleSpinBox_2_valueChanged) # connect on def \"on_doubleSpinBox_2_valueChanged\"\n \n self.doubleSpinBox_3 = QtGui.QDoubleSpinBox(self.widget) # create object doubleSpinBox_3\n self.doubleSpinBox_3.setGeometry(QtCore.QRect(70, 270, 62, 22)) # coordinates position\n self.doubleSpinBox_3.setMinimum(0) # minimum value\n self.doubleSpinBox_3.setMaximum(100.0) # maximum value\n self.doubleSpinBox_3.setSingleStep(0.05) # step for increase or decrease value here 0.05\n self.doubleSpinBox_3.setObjectName(_fromUtf8(\"doubleSpinBox_3\")) # name of object\n self.doubleSpinBox_3.valueChanged.connect(self.on_doubleSpinBox_3_valueChanged) # connect on def \"on_doubleSpinBox_3_valueChanged\"\n \n# section pushButton 1\n self.pushButton_1 = QtGui.QPushButton(self.widget) # create object PushButton_1\n self.pushButton_1.setGeometry(QtCore.QRect(70, 298, 65, 20)) # coordinates position\n self.pushButton_1.setObjectName(_fromUtf8(\"pushButton_1\")) # name of object\n self.pushButton_1.clicked.connect(self.on_pushButton_1_clicked) # connect on def \"on_pushButton_1_clicked\"\n \n# section pushButton 2\n self.pushButton_2 = QtGui.QPushButton(self.widget) # create object pushButton_2\n self.pushButton_2.setGeometry(QtCore.QRect(150, 298, 65, 20)) # coordinates position\n self.pushButton_2.setObjectName(_fromUtf8(\"pushButton_2\")) # name of object\n self.pushButton_2.clicked.connect(self.on_pushButton_2_clicked) # connect on def \"on_pushButton_2_clicked\"\n \n# section groupBox for the four radioButton\n self.groupBox = QtGui.QGroupBox(self.widget) # this is the group for associate the four radioButton\n self.groupBox.setGeometry(QtCore.QRect(250, 140, 125, 181)) # coordinates position\n self.groupBox.setObjectName(_fromUtf8(\"groupBox\")) # name of window groupBox\n \n# section radioButton 1\n self.radioButton_1 = QtGui.QRadioButton(self.groupBox) # create object QRadioButton in groupBox\n self.radioButton_1.setGeometry(QtCore.QRect(10, 30, 110, 20)) # coordinates position\n self.radioButton_1.setObjectName(_fromUtf8(\"radioButton_1\")) # name of object\n self.radioButton_1.setChecked(True) # by default True or False (one in the group))\n self.image_01 = path+\"MEPlanT.png\" # image dedicate of the button\n icon01 = QtGui.QIcon() # create image name\n icon01.addPixmap(QtGui.QPixmap(self.image_01),QtGui.QIcon.Normal, QtGui.QIcon.Off) #\n self.radioButton_1.setIcon(icon01) # associate button and image\n self.radioButton_1.clicked.connect(self.on_radioButton_1_clicked) # connect radioButton_1 on \"def on_radioButton_1_clicked:\"\n \n# section radioButton 2\n self.radioButton_2 = QtGui.QRadioButton(self.groupBox) # create object QRadioButton in groupBox\n self.radioButton_2.setGeometry(QtCore.QRect(10, 60, 110, 20)) # coordinates position\n self.radioButton_2.setObjectName(_fromUtf8(\"radioButton_2\")) # name of object\n self.image_02 = path+\"MEPlanF.png\" # image dedicate of the button\n icon02 = QtGui.QIcon() # create image name\n icon02.addPixmap(QtGui.QPixmap(self.image_02),QtGui.QIcon.Normal, QtGui.QIcon.Off) #\n self.radioButton_2.setIcon(icon02) # associate button and image\n self.radioButton_2.clicked.connect(self.on_radioButton_2_clicked) # connect radioButton_2 on \"def on_radioButton_2_clicked:\"\n \n# section radioButton 3\n self.radioButton_3 = QtGui.QRadioButton(self.groupBox) # create object QRadioButton in groupBox\n self.radioButton_3.setGeometry(QtCore.QRect(10, 90, 110, 20)) # coordinates position\n self.radioButton_3.setObjectName(_fromUtf8(\"radioButton_3\")) # name of object\n self.image_03 = path+\"MEPlanD.png\" # image dedicate of the button\n icon03 = QtGui.QIcon() # create image name\n icon03.addPixmap(QtGui.QPixmap(self.image_03),QtGui.QIcon.Normal, QtGui.QIcon.Off) #\n self.radioButton_3.setIcon(icon03) # associate button and image\n self.radioButton_3.clicked.connect(self.on_radioButton_3_clicked) # connect radioButton_3 on \"def on_radioButton_3_clicked:\"\n \n# section radioButton 4\n self.radioButton_4 = QtGui.QRadioButton(self.groupBox) # create object QRadioButton in groupBox\n self.radioButton_4.setGeometry(QtCore.QRect(10, 150, 110, 20)) # coordinates position\n self.radioButton_4.setObjectName(_fromUtf8(\"radioButton_4\")) # name of object\n self.image_04 = path+\"MEPlanI.png\" # image dedicate of the button\n icon04 = QtGui.QIcon() # create image name\n icon04.addPixmap(QtGui.QPixmap(self.image_04),QtGui.QIcon.Normal, QtGui.QIcon.Off) #\n self.radioButton_4.setIcon(icon04) # associate button and image\n self.radioButton_4.clicked.connect(self.on_radioButton_4_clicked) # connect radioButton_4 on \"def on_radioButton_4_clicked:\"\n \n# section checkBox 1\n self.checkBox_1 = QtGui.QCheckBox(self.groupBox) # create object QRadioButton in groupBox\n self.checkBox_1.setGeometry(QtCore.QRect(20, 120, 110, 20)) # coordinates position\n self.checkBox_1.setObjectName(_fromUtf8(\"checkBox_1\")) # name of object\n self.checkBox_1.setChecked(True) # Check by default True or False\n self.checkBox_1.clicked.connect(self.on_checkBox_1_clicked) # connect on def \"on_checkBox_1_clicked\"\n self.image_1 = path+\"MEpipe01.png\" # image dedicate of the button\n icon1 = QtGui.QIcon() # create image name\n icon1.addPixmap(QtGui.QPixmap(self.image_1),QtGui.QIcon.Normal, QtGui.QIcon.Off) # \n self.checkBox_1.setIcon(icon1) # associate button and image\n \n \n self.label_1 = QtGui.QLabel(self.widget) # labels displayed on widget\n self.label_1.setGeometry(QtCore.QRect(140, 150, 110, 16)) # label coordinates \n self.label_1.setObjectName(_fromUtf8(\"label_1\")) # label name\n \n self.label_2 = QtGui.QLabel(self.widget)\n self.label_2.setGeometry(QtCore.QRect(140, 180, 110, 16))\n self.label_2.setObjectName(_fromUtf8(\"label_2\"))\n \n self.label_3 = QtGui.QLabel(self.widget)\n self.label_3.setGeometry(QtCore.QRect(140, 210, 100, 16))\n self.label_3.setObjectName(_fromUtf8(\"label_3\"))\n \n self.label_4 = QtGui.QLabel(self.widget)\n self.label_4.setGeometry(QtCore.QRect(140, 240, 100, 16))\n self.label_4.setObjectName(_fromUtf8(\"label_4\"))\n \n self.label_5 = QtGui.QLabel(self.widget)\n self.label_5.setGeometry(QtCore.QRect(140, 270, 100, 16))\n self.label_5.setObjectName(_fromUtf8(\"label_5\"))\n \n self.label_6 = QtGui.QLabel(self.widget)\n self.label_6.setGeometry(QtCore.QRect(70, 315, 159, 25))\n self.label_6.setObjectName(_fromUtf8(\"label_6\"))\n \n self.textEdit = QtGui.QTextEdit(self.widget)\n self.textEdit.setGeometry(QtCore.QRect(251, 350, 124, 58))\n self.textEdit.setObjectName(_fromUtf8(\"textEdit\"))\n #self.textEdit.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) #\n self.textEdit.setText(\"TexEdit \")\n self.textEdit.setToolTip(_translate(\"MainWindow\", \"textEdit\", None))\n #self.textEdit.verticalScrollBar().setValue(0) # verticalScrollBar Position\n #self.textEdit.verticalScrollBar().setSliderPosition(0) # Slider Position\n self.textEdit.textChanged.connect(self.on_textEdit_Changed) #connection on_textEdit_Changed\n \n ### ---graphicsView---\n self.graphicsView = QtGui.QGraphicsView(self.widget) # graphic view declaration\n self.graphicsView.setGeometry(QtCore.QRect(70, 350, 168, 60)) # coordinates position\n self.graphicsView.setFrameShape(QtGui.QFrame.StyledPanel) # Frame for the gaphic view\n self.graphicsView.setObjectName(_fromUtf8(\"graphicsView\")) # name gaphicView\n pic = QtGui.QPixmap(path+\"MEPlanFC.png\") # image displayed in the graphicView\n self.scene = QtGui.QGraphicsScene() #\n self.scene.addPixmap(QtGui.QPixmap(pic)) # adding image in the graphicView\n self.graphicsView.setScene(ui.scene) # display image in the graphicView\n ### ---graphicsView---\n \n MainWindow.setCentralWidget(self.widget)\n self.menuBar = QtGui.QMenuBar(MainWindow)\n self.menuBar.setGeometry(QtCore.QRect(0, 0, 400, 26))\n self.menuBar.setObjectName(_fromUtf8(\"menuBar\"))\n MainWindow.setMenuBar(self.menuBar)\n self.mainToolBar = QtGui.QToolBar(MainWindow)\n self.mainToolBar.setObjectName(_fromUtf8(\"mainToolBar\"))\n MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.mainToolBar)\n self.statusBar = QtGui.QStatusBar(MainWindow)\n self.statusBar.setObjectName(_fromUtf8(\"statusBar\"))\n MainWindow.setStatusBar(self.statusBar)\n self.statusbar = QtGui.QStatusBar(MainWindow)\n self.statusbar.setObjectName(_fromUtf8(\"statusbar\"))\n MainWindow.setStatusBar(self.statusbar)\n \n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n \n def retranslateUi(self, MainWindow):\n MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # this function turns the front window (stay to hint)\n MainWindow.setWindowTitle(_translate(\"MainWindow\", \"Qt_Example\", None)) # title main window\n MainWindow.setWindowIcon(QtGui.QIcon(path+'MEPlan.png')) # change the icon of the main window\n \n# for horizontalScrollBar\n# self.horizontalScrollBar.setToolTip(_translate(\"MainWindow\", \"horizontalScrollBar\", None))\n# self.verticalScrollBar.setToolTip(_translate(\"MainWindow\", \"verticalScrollBar\", None))\n \n self.groupBox.setTitle(_translate(\"MainWindow\", \"View\", None))\n self.radioButton_1.setToolTip(_translate(\"MainWindow\", \"radioButton_1\", None))\n self.radioButton_1.setText(_translate(\"MainWindow\", \"radioButton_1\", None))\n self.radioButton_2.setToolTip(_translate(\"MainWindow\", \"radioButton_2\", None))\n self.radioButton_2.setText(_translate(\"MainWindow\", \"radioButton_2\", None))\n self.radioButton_3.setToolTip(_translate(\"MainWindow\", \"radioButton_3\" , None))\n self.radioButton_3.setText(_translate(\"MainWindow\", \"radioButton_3\", None))\n self.radioButton_4.setToolTip(_translate(\"MainWindow\", \"radioButton_4\", None))\n self.radioButton_4.setText(_translate(\"MainWindow\", \"radioButton_4\", None))\n self.checkBox_1.setToolTip(_translate(\"MainWindow\", \"checkBox_1\", None))\n self.checkBox_1.setText(_translate(\"MainWindow\", \"checkBox_1\", None))\n self.pushButton_1.setToolTip(_translate(\"MainWindow\", \"pushButton_1\", None))\n self.pushButton_1.setText(_translate(\"MainWindow\", \"Reset\", None))\n self.pushButton_2.setToolTip(_translate(\"MainWindow\", \"pushButton_2\", None))\n self.pushButton_2.setText(_translate(\"MainWindow\", \"Quit\", None))\n \n self.lineEdit_1.setToolTip(_translate(\"MainWindow\", \"LineEdit 1\", None))\n self.label_1.setText(_translate(\"MainWindow\", \"LineEdit 1\", None))\n \n self.lineEdit_2.setToolTip(_translate(\"MainWindow\", \"LineEdit_2\", None))\n self.label_2.setText(_translate(\"MainWindow\", \"LineEdit 2\", None))\n \n self.label_3.setText(_translate(\"MainWindow\", \"doubleSpinBox_1\", None))\n self.doubleSpinBox_1.setToolTip(_translate(\"MainWindow\", \"doubleSpinBox_1\", None))\n \n self.label_4.setText(_translate(\"MainWindow\", \"doubleSpinBox_2\", None))\n self.doubleSpinBox_2.setToolTip(_translate(\"MainWindow\", \"doubleSpinBox_2\", None))\n \n self.label_5.setText(_translate(\"MainWindow\", \"doubleSpinBox_3\", None))\n self.doubleSpinBox_3.setToolTip(_translate(\"MainWindow\", \"doubleSpinBox_3\", None))\n \n font = QtGui.QFont() # see http://doc.qt.io/qt-4.8/qfont.html # label text displayed and colored in red\n font.setFamily(\"Times New Roman\") # font used (Windows)\n font.setPointSize(10) # font PointSize\n font.setWeight(10) # font Weight\n font.setBold(True) # Bolt True or False \n self.label_6.setFont(font) # associate label_6 and font\n self.label_6.setObjectName(\"label_6\") # name of object\n self.label_6.setStyleSheet(\"color : #ff0000\") # Color text\n self.label_6.setText(_translate(\"MainWindow\", \"Hello world\", None)) # same resultt with \"Hello world\"\n \n ########### section connections on def #############################\n # radioboutons\n def on_radioButton_1_clicked(self): # connection on_radioButton_1_clicked\n #\n #here your code\n #\n self.label_6.setText(_translate(\"MainWindow\", \"radioButton_1 \", None)) # display in the label_6 (red)\n print( \"radioButton_1\")\n #\n \n def on_radioButton_2_clicked(self): # connection on_radioButton_2_clicked\n #\n #here your code\n #\n self.label_6.setText(_translate(\"MainWindow\", \"radioButton_2 \", None)) # display in the label_6 (red)\n print( \"radioButton_2\")\n #\n \n def on_radioButton_3_clicked(self): # connection on_radioButton_3_clicked\n #\n #here your code\n self.label_6.setText(_translate(\"MainWindow\", \"radioButton_3 \", None)) # display in the label_6 (red)\n print( \"radioButton_3\")\n #\n \n def on_radioButton_4_clicked(self): # connection on_radioButton_4_clicked\n #\n #here your code\n #\n self.label_6.setText(_translate(\"MainWindow\", \"radioButton_4 \", None)) # display in the label_6 (red)\n print( \"radioButton_4\")\n #\n \n def affectation_X (self,val_X0): # connection affectation_X\n #val_X = float(val_X0) # extract the value and transform it in float\n #\n #here your code\n #\n print( val_X0)\n #\n \n def affectation_Y (self,val_Y0): # connection affectation_Y\n #val_Y = float(val_Y0) # extract the value and transform it in float\n #\n #here your code\n #\n print( val_Y0)\n #\n \n# # scroll bar barres coulissantes\n# def on_horizontal_scrolling(self, val_X): # connection on_horizontal_scrolling\n# self.lineEdit_1.setText(str(val_X))\n# self.affectation_X(val_X)\n# self.progressBar_1_Red.setValue(val_X)\n# self.textEdit.setText(str(val_X))\n# print( \"on_horizontal_scrolling\")\n#\n#\n# def on_vertical_scrolling(self, val_Y): # connection on_vertical_scrolling\n# self.lineEdit_2.setText(str(val_Y))\n# self.affectation_Y(val_Y)\n# self.progressBar_2.setValue(val_Y)\n# self.textEdit.setText(str(val_Y))\n# print( \"on_vertical_scrolling\")\n \n # slider barres coulissantes\n def on_horizontal_slider(self, val_X): # connection on_horizontal_slider\n #\n #here your code\n #\n self.lineEdit_1.setText(str(val_X)) # affect the value \"val_X\" and displayed in lineEdit_1\n self.affectation_X(val_X)\n self.progressBar_1_Red.setValue(val_X) # affect the value \"val_X\" in progressbar_1\n self.progressBar_1_Green.setValue(val_X) # affect the value \"val_X\" in progressbar_1\n self.progressBar_1_Blue.setValue(val_X) # affect the value \"val_X\" in progressbar_1\n self.progressBar_1_gradient.setValue(int(val_X)) # affect the value \"val_X\" on progressBar_1 and modify this\n self.textEdit.setText(str(val_X)) # affect the value \"val_X\" in textEdit \n print( \"on_horizontal_slider\" ) # displayed on View repport\n #\n \n def on_vertical_slider(self, val_Y): # connection on_vertical_slider\n #\n #here your code\n #\n self.lineEdit_2.setText(str(val_Y)) # affect the value \"val_Y\" and displayed in lineEdit_2\n self.affectation_Y(val_Y)\n self.progressBar_2.setValue(val_Y) # affect the value \"val_Y\" in progressbar_2\n self.textEdit.setText(str(val_Y)) # affect the value \"val_Y\" in textEdit \n print( \"on_vertical_slider\" ) # displayed on View repport\n #\n \n # lineEdit\n def on_lineEdit_1_Pressed(self): # connection on_lineEdit_1_Pressed\n val_X = self.lineEdit_1.text() # extract the string in the lineEdit\n #\n #here your code\n #\n self.affectation_X(val_X)\n try:\n self.horizontalSlider.setValue(int(val_X)) # affect the value \"val_X\" on horizontalSlider and modify this\n except Exception: # if error\n self.horizontalSlider.setValue(int(0)) # affect the value \"0\" on horizontalSlider and modify this\n val_X = \"0\"\n self.progressBar_1_Red.setValue(int(val_X)) # affect the value \"val_X\" on progressBar_1 and modify this\n self.progressBar_1_Green.setValue(int(val_X)) # affect the value \"val_X\" on progressBar_1 and modify this\n self.progressBar_1_Blue.setValue(int(val_X)) # affect the value \"val_X\" on progressBar_1 and modify this\n self.progressBar_1_gradient.setValue(int(val_X)) # affect the value \"val_X\" on progressBar_1 and modify this\n print( val_X)\n #\n \n def on_lineEdit_2_Pressed(self): # connection on_lineEdit_2_Pressed\n val_Y = self.lineEdit_2.text() # extract the string in the lineEdit\n #\n #here your code\n #\n self.affectation_Y(val_Y)\n try:\n self.verticalSlider.setValue(int(val_Y)) # affect the value \"val_Y\" on verticalSlider and modify this\n except Exception: # if error\n self.verticalSlider.setValue(int(0)) # affect the value \"0\" on verticalSlider and modify this\n val_Y = \"0\"\n self.progressBar_2.setValue(int(val_Y)) # affect the value \"val_Y\" on progressBar_2 and modify this\n print( val_Y)\n #\n \n # checkbox_01\n def on_checkBox_1_clicked(self): # connection on_checkBox_1_clicked\n #\n #here your code\n #\n if self.checkBox_1.isChecked(): # if checkbox_01 is checked then ....\n self.image_1 = path+\"MEpipe01.png\" # configure image_1\n icon1 = QtGui.QIcon()\n icon1.addPixmap(QtGui.QPixmap(self.image_1),QtGui.QIcon.Normal, QtGui.QIcon.Off)\n self.checkBox_1.setIcon(icon1) # affect image_1 to checkBox_1\n self.checkBox_1.setText(_translate(\"MainWindow\", \"Attached\", None)) # text for checkBox_1\n print( \"Mode attached\") # diplayed on View Repport\n else: # if checkbox_01 is not checked then ....\n self.image_2 = path+\"MEpipe02.png\" # configure image_2\n icon2 = QtGui.QIcon() \n icon2.addPixmap(QtGui.QPixmap(self.image_2),QtGui.QIcon.Normal, QtGui.QIcon.Off)\n self.checkBox_1.setIcon(icon2) # affect image_2 to checkBox_1\n self.checkBox_1.setText(_translate(\"MainWindow\", \"Free\", None)) # text for checkBox_1\n print( \"Mode free\" ) # diplayed on View Repport\n #\n \n # Buttons\n def on_pushButton_2_clicked(self): # Button Quit # connection on_pushButton_2_clicked\n #\n #here your code\n #\n self.pushButton_1.setStyleSheet(\"background-color: QPalette.Base\") # origin system color pushButton_1\n App.Console.PrintMessage(\"End\\r\\n\")\n self.window.hide() # hide the window and close the macro\n #\n \n def on_pushButton_1_clicked(self): # Button Reset # connection on_pushButton_1_clicked\n #\n #here your code\n #\n global switch\n self.doubleSpinBox_1.setValue(0) # gives the value \"0\" to the doubleSpinBox_1\n self.doubleSpinBox_2.setValue(0) # gives the value \"0\" to the doubleSpinBox_2\n self.doubleSpinBox_3.setValue(0) # gives the value \"0\" to the doubleSpinBox_3\n self.lineEdit_1.setText(\"0\") # gives the value \"0\" to the lineEdit_1\n self.lineEdit_2.setText(\"0\") # gives the value \"0\" to the lineEdit_2\n #self.horizontalScrollBar.setValue(0) # gives the value \"0\" to the horizontalScrollBar\n #self.verticalScrollBar.setValue(0) # gives the value \"0\" to the verticalScrollBar\n self.horizontalSlider.setValue(0) # gives the value \"0\" to the horizontalSlider\n self.verticalSlider.setValue(0) # gives the value \"0\" to the verticalSlider\n self.textEdit.clear() # cleans the textEdit\n self.radioButton_1.setChecked(True) # by default True or False (one in the group))\n self.checkBox_1.setChecked(True) # Check by default True or False\n icon1 = QtGui.QIcon() # create image name\n icon1.addPixmap(QtGui.QPixmap(self.image_1),QtGui.QIcon.Normal, QtGui.QIcon.Off) # \n self.checkBox_1.setIcon(icon1) # associate button and image\n \n if switch == 0: # switch for image in the graphic view Py or FC\n switch = 1\n pic = QtGui.QPixmap(path+\"MEPlanPY.png\") # image (Python)\n self.scene = QtGui.QGraphicsScene() # name of image\n self.scene.addPixmap(QtGui.QPixmap(pic)) # add image \"pic\" (MEPlanPY.png)\n self.graphicsView.setScene(ui.scene) # display the image in graphicview\n self.pushButton_1.setStyleSheet(\"color : #ff0000; background-color : #0000ff;\") # text color; background color pushButton_1\n else:\n switch = 0\n pic = QtGui.QPixmap(path+\"MEPlanFC.png\") # image (FreeCAD)\n self.scene = QtGui.QGraphicsScene() # name of image\n self.scene.addPixmap(QtGui.QPixmap(pic)) # add image \"pic\" (MEPlanFC.png)\n self.graphicsView.setScene(ui.scene) # display the image in graphicview\n self.pushButton_1.setStyleSheet(\"color : #0000ff; background-color : #ff0000;\") # text color; background color pushButton_1\n print( \"Reset\")\n #\n \n def on_doubleSpinBox_1_valueChanged(self,echelle): # connection on_doubleSpinBox_1_valueChanged\n #\n #here your code\n #\n print( \"SpinBox 1 \", echelle)\n #\n \n def on_doubleSpinBox_2_valueChanged(self,angle): # connection on_doubleSpinBox_2_valueChanged\n #\n #here your code\n #\n print( \"SpinBox 2 \", angle)\n \n def on_doubleSpinBox_3_valueChanged(self,epaisseur): # connection on_doubleSpinBox_3_valueChanged\n #\n #here your code\n #\n print( \"SpinBox 3 \", epaisseur)\n #\n \n def on_textEdit_Changed(self): # conection on_textEdit_Changed\n texte = str(self.textEdit.toPlainText()) # extract the string of textEdit\n #\n #here your code\n #\n print( texte)\n #\n \n#######################################\n \nMainWindow = QtGui.QMainWindow()\nui = Ui_MainWindow()\nui.setupUi(MainWindow)\nMainWindow.show()\n}}\n\nEnjoy\n\n\n---\n⏵ [documentation index](../README.md) > [Poweruser Documentation](Category_Poweruser%20Documentation.md) > [Python Code](Category_Python%20Code.md) > Qt Example\n"} {"id": "freecad-docs:wiki/Raytracing_Module.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Raytracing_Module.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Raytracing_Module.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "92a0740fc10f02b5a1c6ac224b8dbb3d89a3a6dad6fbe3d9d2dab1e7bbbca5ab", "bytes": 148, "tokens": 65, "text": "# Raytracing Module\n1. REDIRECT [Raytracing_Workbench](Raytracing_Workbench.md)\n\n\n---\n⏵ [documentation index](../README.md) > Raytracing Module\n"} {"id": "freecad-docs:wiki/Raytracing_ResetCamera.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Raytracing_ResetCamera.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Raytracing_ResetCamera.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "681dfaa9ab0eefa4d8873a82fb01415314ee9499f742a37abba3e37e2cf96490", "bytes": 1055, "tokens": 383, "text": "---\n GuiCommand:\n Name: Raytracing ResetCamera\n MenuLocation: Raytracing , ResetCamera\n Workbenches: Raytracing_Workbench\n Shortcut: \n SeeAlso: \n---\n\n# Raytracing ResetCamera\n\n## Description\n\nSets the camera of the selected raytracing project to match the current view.\n\n## Usage\n\n1. Select raytracing project in the [tree view](Tree_view.md)\n2. Make sure that the view is set to \"\" [perspective view](Std_PerspectiveCamera.md)\n3. Click on \"\" or choose ** Raytracing** → ** Reset Camera** from the top menu\n4. Selecting a raytracing project in the [tree view](Tree_view.md) and looking at the data-tab in the property view will show the current camera-properties\n\n## Limitations\n\n## Properties\n\n## Notes\n\n\n {{Raytracing_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Raytracing](Category_Raytracing.md) > Raytracing ResetCamera\n"} {"id": "freecad-docs:wiki/Raytracing_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Raytracing_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Raytracing_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f1919cc4e840d6ec5ffeacefe58519bbdb8877398bd0c5f47f8d1b85100b1420", "bytes": 7944, "tokens": 2620, "text": "# Raytracing Workbench\n**The '''Raytracing Workbench''' is no longer included after version 0.20.
\n The external [https://github.com/FreeCAD/FreeCAD-render Render Workbench] should be used instead.**\n\n\"Raytracing\n\n## Introduction\n\n \n\nThe \"\" [Raytracing Workbench](Raytracing_Workbench.md) is used to generate photorealistic images of your models by processing them with an external renderer.\n\nThe Raytracing Workbench works with [templates](Raytracing_templates.md), which are project files that define a scene for your 3D model. You can place lights and geometry such as ground planes, and it also contains placeholders for the position of the camera, and for the material information of the objects in the scene. The project can then be exported to a ready-to-render file, or be rendered directly within FreeCAD.\n\nCurrently, two renderers are supported: [POV-Ray](POV-Ray.md) and [LuxRender](LuxRender.md). To be able to render from within FreeCAD, at least one of these programs must be installed and configured in your system. However, if no renderer is installed, you will still be able to export a project file to be rendered at another time.\n\nThe Raytracing workbench is obsolete, the external [Render Workbench](https://github.com/FreeCAD/FreeCAD-render) is its replacement. Nevertheless, the information on this page is generally useful for the new workbench, as both basically work in the same way.\n\n \"\" \n\n## Typical workflow \n\n1. Create or open a FreeCAD project, add some solid objects ([Part-based](Part_Workbench.md) or [PartDesign-based](PartDesign_Workbench.md)); meshes are currently not supported.\n2. Create a Raytracing project (povray or luxrender).\n3. Select the objects that you wish to add to the Raytracing project and add them.\n4. Export the project file or render it directly.\n\n\"\"\n\n\n*Workflow of the Raytracing Workbench; the workbench prepares a project file from a given template, and then calls an external program to produce the actual rendering of the scene. The external renderer can be used independently of FreeCAD.*\n\n## Tools\n\n### Project tools \n\nThese are the main tools for exporting your 3D work to external renderers.\n\n- \"\" [New PovRay project](Raytracing_New.md): Insert new PovRay project in the document\n- \"\" [New LuxRender project](Raytracing_Lux.md): Insert new LuxRender project in the document\n- \"\" [Insert part](Raytracing_InsertPart.md): Insert a view of a Part in a raytracing project\n- \"\" [Reset camera](Raytracing_ResetCamera.md): Matches the camera position of a raytracing project to the current view\n- \"\" [Export project](Raytracing_ExportProject.md): Exports a raytracing project to a scene file for rendering in an external renderer\n- \"\" [Render](Raytracing_Render.md): Renders a raytracing project with an external renderer\n\n### Utilities\n\nThese are helper tools to perform specific tasks manually.\n\n- \"\" [Export view to povray](Raytracing_WriteView.md): Write the active 3D view with camera and all its content to a povray file\n- \"\" [Export camera to povray](Raytracing_WriteCamera.md): Export the camera position of the active 3D view in POV-Ray format to a file\n- \"\" [Export part to povray](Raytracing_WritePart.md): Write the selected Part (object) as a povray file\n\n## Preferences\n\n- \"\" [Preferences](Raytracing_Preferences.md): Preferences available in for the Raytracing tools.\n\n## Tutorials\n\n- [Basic Raytracing tutorial](Raytracing_tutorial.md)\n- [Intermediate Raytracing tutorial](Tutorial_FreeCAD_POV_ray.md)\n\n## Creating a povray file manually \n\nThe utility tools described above allow you to export the current 3D view and all of its content to a [Povray](http://www.povray.org/) file. First, you must load or create your CAD data and position the 3D View orientation as you wish. Then choose \\\"Utilities → Export View\\...\\\" from the raytracing menu.\n\n ![](images/FreeCAD_Raytracing.jpg ) \n\nYou will be asked for a location to save the resulting \\*.pov file. After that you can open it in [Povray](http://www.povray.org/) and render: ![](images/Povray.jpg ) \n\nAs usual in a renderer you can make big and nice pictures: \"\" \n\n## Scripting\n\nSee the [Raytracing API example](Raytracing_API_example.md) for information on writing scenes programmatically.\n\n## Links\n\n### POV-Ray \n\n- [POV-Ray page on this wiki](POV-Ray.md)\n- \n- \n- \n\n### LuxRender\n\n- [LuxRender page on this wiki](LuxRender.md)\n- \n\n### Future possible renderers to implement \n\n- \n- \n- \n- \n\n## Exporting to Kerkythea \n\nAlthough direct export to the Kerkythea XML-File-Format is not supported yet, you can export your Objects as Mesh-Files (.obj) and then import them in Kerkythea.\n\n- if using Kerkythea for Linux, remember to install the WINE-Package (needed by Kerkythea for Linux to run)\n- you can convert your models with the help of the mesh workbench to meshes and then export these meshes as .obj-files\n- If your mesh-export resulted in errors (flip of normals, holes \\...) you may try your luck with [netfabb studio basic](http://www.netfabb.com/downloadcenter.php?basic=1)\n\n: Free for personal use, available for Windows, Linux and Mac OSX.\n: It has standard repair tools which will repair you model in most cases.\n\n- another good program for mesh analysing/repairing is [Meshlab](http://sourceforge.net/projects/meshlab/)\n\n: Open Source, available for Windows, Linux and Mac OSX.\n: It has standard repair tools which will repair you model in most cases (fill holes, re-orient normals, etc.)\n\n- you can use \\\"make compound\\\" and then \\\"make single copy\\\" or you can fuse solids to group them before converting to meshes\n- remember to set in Kerkythea an import-factor of 0.001 for obj-modeler, since Kerkythea expects the obj-file to be in m (but standard units-scheme in FreeCAD is mm)\n\n: Within WIndows 7 64-bit Kerkythea does not seem to be able to save these settings.\n: So remember to do that each time you start Kerkythea\n\n- if importing multiple objects in Kerkythea you can use the \\\"File → Merge\\\" command in Kerkythea\n\n## Development\n\nThese pages refer to the new workbench, programmed in Python, meant to replace the current Raytracing Workbench.\n\n- [Render Workbench](https://github.com/FreeCAD/FreeCAD-render)\n- [Render Workbench](https://forum.freecadweb.org/viewtopic.php?f=9&t=25933) (announcement only, no discussion)\n- [FreeCAD Renderer Workbench improvements](https://forum.freecadweb.org/viewtopic.php?t=39168)\n\n\n {{Raytracing Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Obsolete Workbenches](Category_Obsolete%20Workbenches.md) > [Raytracing](Category_Raytracing.md) > Raytracing Workbench\n"} {"id": "freecad-docs:wiki/Reinforcement_BentShapeRebar.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Reinforcement_BentShapeRebar.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Reinforcement_BentShapeRebar.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "9b621a4ce51676c96baaab39ec8d477e891c80953ffe8e7f4b17d68f4b23ed05", "bytes": 6410, "tokens": 2104, "text": "---\n GuiCommand:\n Name: Reinforcement BentShapeRebar\n MenuLocation: 3D/BIM , Reinforcement tools , Bent-Shape Rebar\n Workbenches: Reinforcement_Workbench, BIM_Workbench\n Version: 0.17\n SeeAlso: \n---\n\n# Reinforcement BentShapeRebar\n\n## Description\n\nThe [Reinforcement BentShapeRebar](Reinforcement_BentShapeRebar.md) tool allows the user to create a set of bent reinforcing bars inside an [Arch Structure](Arch_Structure.md) object.\n\nThis tool is part of the [Reinforcement Workbench](Reinforcement_Workbench.md), an [external workbench](External_workbenches.md) that can be installed with the \"\" [Addon Manager](Std_AddonMgr.md).\n\n \"\" \n*Two sets of bent reinforcement bars inside an [Arch Structure](Arch_Structure.md)*\n\n## Usage\n\n1. Select any face of a previously created ** [Arch Structure](Arch_Structure.md)** object.\n\n2. Then select ** [Bent-Shape Rebar](Reinforcement_BentShapeRebar.md)** from the rebar tools.\n\n3. A [task panel](Task_panel.md) will pop-out on the left side of the screen as shown below.\n\n4. Select the desired orientation.\n\n5. Populate the inputs like \\'Left Cover\\', \\'Right Cover\\', \\'Top Cover\\', \\'Bottom Cover\\', \\'Front Cover\\', \\'Bent Angle\\', \\'Bent Factor\\', \\'Rounding\\' and \\'Diameter\\' of the rebar.\n\n6. Select the mode of distribution either \\'Amount\\' or \\'Spacing\\'.\n - If \\'Spacing\\' is selected, a user can also opt for [custom spacing](Reinforcement_Custom_Spacing.md).\n\n7. \n **Pick Selected Face**is used to verify or change the face for rebar distribution.\n\n8. Click **OK** or **Apply** to generate the rebars.\n\n9. Click **Cancel** to exit the task panel.\n\n \"\" \n*Task panel for the tool*\n\n## Properties\n\n- **Orientation**: It decides the orientation of the rebar (like a bottom, top, right and left).\n\n- **Front Cover**: The distance between rebar and selected face.\n\n- **Left Cover**: The distance between the left end of the rebar to the left face of the structure.\n\n- **Right Cover**: The distance between the right end of the rebar to right face of the structure.\n\n- **Bottom Cover**: The distance between rebar from the bottom face of the structure.\n\n- **Top Cover**: The distance between rebar from the top face of the structure.\n\n- **Anchor Length**: It is the arm\\'s length of bent shape rebar.\n\n- **Bent Angle**: It decides angle in bent shape rebar.\n\n- **Amount**: The amount of rebars.\n\n- **Spacing**: The distance between the axes of each bar.\n\n## Scripting\n\n\n**See also:**\n\n[Arch API](Arch_API.md), [Reinforcement API](Reinforcement_API.md) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe Reinforcement BentShapeRebar tool can be used in [macros](Macros.md) and from the [Python](Python.md) console by using the following function: \n```python\nRebar = makeBentShapeRebar(f_cover, b_cover, l_cover, r_cover,\n diameter, t_cover, bentLength, bentAngle, rounding, amount_spacing_check, amount_spacing_value, orientation=\"Bottom\",\n structure=None, facename=None)\n```\n\n- Creates a `Rebar` object from the given `structure`, which is an [Arch Structure](Arch_Structure.md), and `facename`, which is a face of that structure.\n - If no `structure` nor `facename` are given, it will take the user selected face as input.\n\n- `f_cover`, `b_cover`, `l_cover`, `r_cover`, and `t_cover` are inner offset distances for the rebar elements with respect to the faces of the structure. They are respectively the front, bottom, left, right, and top offsets.\n\n- `diameter`is the diameter of the reinforcement bars inside the structure.\n\n- `rounding`is the parameter that determines the bending radius of the center reinforcement bars.\n\n- `bentLength`and `bentAngle` define the length of the tip of the reinforcement bars, and the bending angle from the center bars.\n\n- `amount_spacing_check`if it is `True` it will create as many reinforcement bars as given by `amount_spacing_value`; if it is `False` it will create reinforcement bars separated by the numerical value of `amount_spacing_value`.\n\n- `amount_spacing_value`specifies the number of reinforcement bars, or the value of the separation between them, depending on `amount_spacing_check`.\n\n- `orientation`specifies the orientation of the rebar; it can be `\"Bottom\"`, `\"Top\"`, `\"Left\"`, or `\"Right\"`.\n\n### Example\n\n \n```python\nimport FreeCAD, Arch, BentShapeRebar\n\nStructure = Arch.makeStructure(length=1000, width=1000, height=100)\nStructure.ViewObject.Transparency = 80\nFreeCAD.ActiveDocument.recompute()\n\nRebar = BentShapeRebar.makeBentShapeRebar(50, 20, 20, 20,\n 8, 40, 100, 135, 2, True, 4, \"Bottom\", Structure, \"Face4\")\nRebar.ViewObject.ShapeColor = (0.9, 0.0, 0.0)\n\nRebar2 = BentShapeRebar.makeBentShapeRebar(50, 40, 20, 20,\n 8, 20, 100, 135, 2, True, 4, \"Bottom\", Structure, \"Face6\")\nRebar2.ViewObject.ShapeColor = (0.0, 0.0, 0.9) \n```\n\n### Edition of the rebar \n\nYou can change the properties of the rebar with the following function:\n\n \n```python\neditBentShapeRebar(Rebar, f_cover, b_cover, l_cover, r_cover,\n diameter, t_cover, bentLength, bentAngle, rounding, amount_spacing_check, amount_spacing_value, orientation,\n structure=None, facename=None)\n```\n\n- `Rebar`is a previously created `BentShapeRebar` object.\n\n- The other parameters are the same as required by the `makeBentShapeRebar()` function.\n\n- `structure`and `facename` may be omitted so that the rebar stays in the original structure.\n\n \n```python\nimport BentShapeRebar\n\nBentShapeRebar.editBentShapeRebar(Rebar, 50, 20, 20, 20,\n 12, 20, 100, 155, 2, True, 6, \"Top\")\n\nBentShapeRebar.editBentShapeRebar(Rebar2, 50, 35, 20, 20,\n 12, 35, 100, 155, 2, True, 6, \"Top\")\n```\n\n\n---\n⏵ [documentation index](../README.md) > [External_Command_Reference](Category_External_Command_Reference.md) > [Reinforcement](Category_Reinforcement.md) > [BIM](Category_BIM.md) > Reinforcement BentShapeRebar\n"} {"id": "freecad-docs:wiki/Reinforcement_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Reinforcement_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Reinforcement_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5bd25a4c83a3eb93bcadf4bd622d8c38229819cb89749806910034d1af6f9d26", "bytes": 5910, "tokens": 2037, "text": "# \"Reinforcement Reinforcement Workbench\n\n \n\n## Introduction\n\nThe [Reinforcement workbench](Reinforcement_Workbench.md) is an [external workbench](External_workbenches.md) that provides tools for Reinforcement Generation and Detailing. This workbench provides an interface and presets for the creation of common rebar types. And tools to generate rebars bill of material, rebar shape cut list, bar bending schedule, and rebars drawing and dimension.\n\n\n Image:Arch_Rebar_Straight_example.png\\|[Straight Rebar](Reinforcement_StraightRebar.md) Image:Arch_Rebar_UShape_example.png\\|[U-Shape Rebar](Reinforcement_UShapeRebar.md) Image:Arch_Rebar_LShape_example.png\\|[L-Shape Rebar](Reinforcement_LShapeRebar.md) Image:Arch_Rebar_Stirrup_example.png\\|[Stirrup](Reinforcement_StirrupRebar.md) Image:Arch_Rebar_BentShape_example.png\\|[Bent-Shape Rebar](Reinforcement_BentShapeRebar.md) Image:Arch_Rebar_Helical_example.png\\|[Helical Rebar](Reinforcement_HelicalRebar.md) Image:Arch_Rebar_ColumnReinforcement_example.png\\|[Single Tie Rectangular Column Reinforcement](Reinforcement_ColumnRebars.md) Image:Arch_Rebar_ColumnReinforcement_TwoTies_example.png\\|[Two Ties Six Rebars Rectangular Column Reinforcement](Reinforcement_ColumnRebars_TwoTiesSixRebars.md) Image:Arch_Rebar_Circular_ColumnReinforcement_example.png\\|[Circular Column Reinforcement](Reinforcement_ColumnRebars_Circular.md) Image:Arch_Rebar_BeamReinforcement_example.png\\|[Beam Reinforcement](Reinforcement_BeamRebars.md) Image:Isometric_view_of_Bent_Shape_rebars_in_parallel_and_cross_direction_with_distribution_rebars.png\\|[Slab Reinforcement](Reinforcement_SlabRebars.md) Image:Isometric_view_of_Columns_footing.png\\|[Footing Reinforcement](Reinforcement_FootingRebars.md) Image:Arch_Rebar_BOM_example.png\\|[Rebar Bill Of Material](Reinforcement_BillOfMaterial.md) Image:Reinforcement_Bar_Shape_Cut_List_example.svg\\|[Rebar Shape Cut List](Reinforcement_BarShapeCutList.md) Image:Reinforcement_Bar_Bending_Schedule_example.svg\\|[Bar Bending Schedule](Reinforcement_BarBendingSchedule.md) Image:Arch_Rebar_Drawing_Dimensioning_example.svg\\|[Reinforcement Drawing Dimensioning](Reinforcement_DrawingDimensioning.md) \n\n\n## Installing\n\nThe Reinforcement workbench is not bundled with the default FreeCAD package, but can easily be installed via the \"\" [Addon Manager](Std_AddonMgr.md). Install it from **Tools → Addon manager → Reinforcement**. The Reinforcement workbench code is [hosted and developed on github](https://github.com/amrit3701/FreeCAD-Reinforcement) and can also be installed manually by copying it into FreeCAD\\'s **MOD** directory.\n\n## Tools\n\n### Reinforcement Generation \n\n- \"\" [Custom Rebar](Arch_Rebar.md): Creates a custom reinforcement bar in a selected structural element using a sketch.\n\n- \"\" [Straight Rebar](Reinforcement_StraightRebar.md): Creates a straight reinforcement bar in a selected structural element.\n\n- \"\" [U-Shape Rebar](Reinforcement_UShapeRebar.md): Creates a U-shape reinforcement bar in a selected structural element.\n\n- \"\" [L-Shape Rebar](Reinforcement_LShapeRebar.md): Creates an L-shape reinforcement bar in a selected structural element.\n\n- \"\" [Stirrup](Reinforcement_StirrupRebar.md): Creates a stirrup reinforcement bar in a selected structural element.\n\n- \"\" [Bent-Shape Rebar](Reinforcement_BentShapeRebar.md): Creates a bent-shape reinforcement bar in a selected structural element.\n\n- \"\" [Helical Rebar](Reinforcement_HelicalRebar.md): Creates a helical reinforcement bar in a selected structural element.\n\n- \"\" [Column Reinforcement](Reinforcement_ColumnRebars.md): Creates reinforcement bars in a selected column.\n\n- \"\" [Beam Reinforcement](Reinforcement_BeamRebars.md): Creates reinforcement bars in a selected beam.\n\n- \"\" [Slab Reinforcement](Reinforcement_SlabRebars.md): Creates reinforcement bars in a selected slab.\n\n- \"\" [Footing Reinforcement](Reinforcement_FootingRebars.md): Creates reinforcement bars in a selected footing.\n\n### Reinforcement Detailing \n\n- \"\" [Rebar Bill Of Material](Reinforcement_BillOfMaterial.md): Creates bill of material of reinforcing bars.\n\n- \"\" [Rebar Shape Cut List](Reinforcement_BarShapeCutList.md): Creates rebar shape cut list of reinforcing bars.\n\n- \"\" [Bar Bending Schedule](Reinforcement_BarBendingSchedule.md): Creates bar bending schedule of reinforcing bars.\n\n- \"\" [Reinforcement Drawing Dimensioning](Reinforcement_DrawingDimensioning.md): Creates drawing and dimensioning of reinforcing bars.\n\n\n---\n⏵ [documentation index](../README.md) > [External_Workbenches](Category_External_Workbenches.md) > [Reinforcement](Category_Reinforcement.md) > Reinforcement Workbench\n"} {"id": "freecad-docs:wiki/Release_notes_0.22.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Release_notes_0.22.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Release_notes_0.22.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b4e905d3a0cd964f2cbc411be4029a322c0cd9f1eaa052248236b4bf7501817d", "bytes": 144, "tokens": 67, "text": "# Release notes 0.22\n1. REDIRECT [Release_notes_1.0](Release_notes_1.0.md)\n\n\n---\n⏵ [documentation index](../README.md) > Release notes 0.22\n"} {"id": "freecad-docs:wiki/Robot_SetDefaultValues.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Robot_SetDefaultValues.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Robot_SetDefaultValues.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ae80e6bb70efee55f6a1e76d21b3ba7e95875457d5d3572c72bee473954a650c", "bytes": 667, "tokens": 232, "text": "---\n GuiCommand:\n Name: Robot SetDefaultValues\n MenuLocation: Robot , Set default values\n Workbenches: Robot_Workbench\n---\n\n# Robot SetDefaultValues\n\n## Description\n\nSet the default values for way-point creation.\n\n## Usage\n\n1. Choose **Robot** → ** Set default values** from the top menu, to define:\n\n: - speed\n\n: - continuous (mode)\n\n: - acceleration\n\n## Notes\n\nThe program\\'s default values are for\n\n- speed = 1 m/s\n- continuous = false\n- acceleration = 1 m/s\\^2\n\n\n {{Robot_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Robot](Robot_Workbench.md) > Robot SetDefaultValues\n"} {"id": "freecad-docs:wiki/Robot_Simulate.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Robot_Simulate.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Robot_Simulate.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "25e28bbc024dc29801a40654cdfa6347e9440c8bbe76055282b191b293e90193", "bytes": 1004, "tokens": 335, "text": "---\n GuiCommand:\n Name: Robot Simulate\n MenuLocation: Robot , Simulate a trajectory\n Workbenches: Robot_Workbench\n---\n\n# Robot Simulate\n\n## Description\n\nOpens the simulation dialog and lets you simulate robot movement along a trajectory.\n\n## Usage\n\n1. Select a robot and a trajectory in the [Tree view](Tree_view.md).\n2. Click on \"\" or choose **Robot** → ** Simulate a trajectory** from the top menu.\n\nResult: This will open up a player dialog menu in the [Tree view](Tree_view.md).\n\n![](images/Robot_Simulation_Player.jpg )\n\nThe buttons from left to right.\n\n- Move to the first waypoint of the chosen trajectory\n- Move to previous waypoint\n- Stop Movement\n- Start Movement\n- Move to next waypoint\n- Move to last waypoint of chosen trajectory\n\n## Notes\n\n\n {{Robot_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Robot](Robot_Workbench.md) > Robot Simulate\n"} {"id": "freecad-docs:wiki/Rocket_FinCan.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Rocket_FinCan.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Rocket_FinCan.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5f8a61597b7c634b1b4e8133208bf4763aa49ea036809d7b8378005f752e2832", "bytes": 3841, "tokens": 1149, "text": "---\n GuiCommand:\n Name: Rocket FinCan\n MenuLocation: Rocket , Fin Can\n Workbenches: Rocket_Workbench\n Version: 0.19\n---\n\n# Rocket FinCan\n\n## Description\n\nFins are used to aerodynamically control the direction of flight. A fin can is a complete assembly including fins and body tube, often fitted over the outside of the main rocket body tube. Optionally, a fin can may include a launch lug.\n\n \"\" \n*A fin can with launch lug*\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Fin Can](Rocket_FinCan.md)** button.\n - Select the **Rocket → Fin Can** option from the menu.\n - Double click on a Fin Can object in the [Tree view](Tree_view.md).\n2. Set options and press **OK**.\n\n## Options\n\n### Fin Options \n\nFin options for the fin can are the same as for individual fins. See \"\" [Fin](Rocket_Fin.md) for more details\n\nHowever due to the one piece nature of fin cans, they do not have the option to include Through The Wall (TTW) tabs.\n\n### Fin Can Options \n\n### Launch Lug Options \n\n## Properties\n\n\n{{TitleProperty|Fin Can}}\n\n- **Fin Type**: Defines the shape of the fins.\n\n- **Height**: The fin height.\n\n- **Profile**: The sketch associated with the custom fin type.\n\n- **Root Chord**: The distance between the fin leading and trailing edges at the root\n\n- **Root Cross Section**: The cross section shape of the fin at the root, see [Options](#Options.md)\n\n- **Root Length 1**: Usage depends on the **Fin Root Cross Section** and will apply to a taper length or similar, see [Options](#Options.md)\n\n- **Root Length 2**: Usage depends on the **Fin Root Cross Section** and will apply to a taper length or similar when multiple values are required, see [Options](#Options.md)\n\n- **Root Per Cent**: Expresses the **Fin Root Length 1** and **Fin Root Length 2** properties as a percentage of the **Fin Root Chord**\n\n- **Root Thickness**: Maximum thickness at the root of the fin\n\n- **Sweep Angle**: The angle of the front of the fin, with a vertical front being 0 degrees. This may be negative. Setting this value will cause the **Sweep Length** to be adjusted.\n\n- **Sweep Length**: The distance from the front of the fin root to the front of the fin tip along the x axis. This may be negative. Setting this value will cause the **Sweep Angle** to be adjusted.\n\n- **Tip Chord**: The distance between the fin leading and trailing edges at the tip\n\n- **Tip Cross Section**: The cross section shape of the fin at the tip, see [Options](#Options.md)\n\n- **Tip Length 1**: Usage depends on the **Fin Tip Cross Section** and will apply to a taper length or similar, see [Options](#Options.md)\n\n- **Tip Length 2**: Usage depends on the **Fin Tip Cross Section** and will apply to a taper length or similar when multiple values are required, see [Options](#Options.md)\n\n- **Tip Per Cent**: Expresses the **Fin Tip Length 1** and **Fin Tip Length 2** properties as a percentage of the **Fin Tip Chord**\n\n- **Tip Thickness**: Maximum thickness at the tip of the fin\n\n\n{{TitleProperty|Rocket Component}}\n\nThese parameters are provided for information and have no effect on the design of the component.\n\n- **Description**: Description of the component\n\n- **Manufacturer**: Manufacturer when known\n\n- **Material**: Material when known\n\n- **Part Number**: Manufacturer part number\n\n## Tutorials and Learning \n\n[Rocket Workbench Fins](https://youtu.be/8MmEVyGkA0I) Tutorial on YouTube\n\n\n---\n⏵ [documentation index](../README.md) > [Addons](Category_Addons.md) > [External Workbenches](Category_External%20Workbenches.md) > Rocket FinCan\n"} {"id": "freecad-docs:wiki/Sandbox_DeinName.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sandbox_DeinName.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sandbox_DeinName.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "3cccb94489e770d0bb43cd998a9505eb38c2f3e84e52dda64bb76aa3e77cd82a", "bytes": 116, "tokens": 45, "text": "# Sandbox:DeinName\n{{Delete}}\n\nCreated by mistake\n\n\n---\n⏵ [documentation index](../README.md) > Sandbox:DeinName\n"} {"id": "freecad-docs:wiki/Sandbox_Mario52_Macro_Cartouche.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sandbox_Mario52_Macro_Cartouche.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sandbox_Mario52_Macro_Cartouche.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a359cf8a196af39fc140157d13c527f6ba968ff6147100b5e8c1263f721cd408", "bytes": 287224, "tokens": 103384, "text": "# Sandbox:Mario52 Macro Cartouche\nSandbox page to store the obsolete \\'Cartouche\\' macros created by Mario52.\n\n\n
\n\n# Macro CartoucheFC \n\n\n
\n\n\n{{Macro\n|Name=Macro CartoucheFC\n|Icon=Macro_CartoucheFC.png\n|Description=This macro is a complete application, it allows to fill the cartridge of the drawing sheet delivered with FreeCAD (Only For [Drawing Workbench](Drawing_Workbench.md)).\n|Author=Mario52\n|Version=0.3\n|Date=2014-07-02\n|FCVersion=All version using Drawing Workbench\n|Download=[https://www.freecadweb.org/wiki/images/0/0a/Macro_CartoucheFC.png ToolBar Icon]\n}}\n\n## Description\n\nThis macro is a complete application, it allows to fill simply all the fields of the cartridge of the drawing sheet delivered with FreeCAD.\n\nThe date and time fields are separated by a \\\"space negative space\\\" \\\" - \\\" and constitute a single line textedit.\n\n\"CartoucheFC\"\n\nFields in red are the **\\\"freecad:editable\\\"** fields, fields in green are annotations inserted in the template.\nHere the version for the new sheet with all the editable text fields.\n\n## Usage\n\n**Changing the map in Inkscape can at the moment cause operation problems in the program (where you remove the symbol on the worksheet, same problem with FreeCAD), work on a copy of A3_Landscape.svg.**\n**PS: Some characters such as & \\$ are not accepted (and possibly other special characters).**\n\nIf you have any questions or want to add a function, you can address you on the french forum [Remplir cartouche](http://forum.freecadweb.org/viewtopic.php?f=12&t=2049)\n\\*The window remains above other Windows, thereby controlling the cartridge without leaving the program.\n\n- Copy the code into a file named **Macro_CartoucheFC.FCMacro** and place it in your usual macros directory.\n- After you have created your drawing sheet using the Drawing of FreeCAD module, run the macro **Macro_CartoucheFC**.\n- At the opening, the program will register in memory all data already present in the cartridge of the sheet (if they are filled), all these data will be automatically returned to using the button ** Memo** and kept in memory until the closure of the programme.\n- Date button ** D.** and time ** H.** displayed the date and time of the system.\n\n -The date format depends on the selected symbol **EU** or **US** which determines the regional format. Change does not happen automatically (for the case or you have entered a date manually) you must again click buttons dates if you change the symbol (check before printing).\n\n- The field **A3** is not functional (this program is based on the the A3 of FreeCAD sheet cartridge).\n- Button **Symbole EU** or US change the meaning of the symbol of projection \\\"Select your Symbol\\\" is displayed by default, and then the active symbol appears. Click on the button and check the leaf symbol, click a second time to modify the symbol.\n\n -The choice of this symbol, affects the date format **EU = dd/MM/yyyy** and **US = MM/dd/yyyy**.\n\n -**Attention**: this command does not pass through the button **Apply** and immediately changes the symbol to each presses on the key, always check if you have the appropriate symbol on your worksheet.\n\n- Button **Clean** Clears all fields in the cartridge. You can revert to the original data using the button **Memo**.\n- Button **Apply** saves all fields of the cartridge in the sheet. You can revert to the original data using the button **Memo** (except for the regional symbol that works in independent and is effective immediately).\n\n## Code\n\nToolBar Icon ![](images/Macro_CartoucheFC.png )\n\n**Macro_CartoucheFC.FCMacro**\n\n\n{{MacroCode|code=\n\n# -*- coding: utf-8 -*-\n# Macro_CartoucheFC.py\n# Remplir les zones du cartouche de la feuille originale de FreeCAD\n# http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC/fr\n# il faut que la page (drawing viewer) s'appelle \" Page \" qui est le nom par défaut du module Drawing\n# Fill the area of the cartridge\n# http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC\n# It is necessary that the page (drawing viewer) is called \"Page\", which is the default name of the Drawing module\n# ver 0.3\n# Created: 02/07/2014\n# Created: by mario52\n# PyQt and PySide \n\n#OS: Windows Vista\n#Word size: 32-bit\n#Version: 0.14.3700 (Git)\n#Branch: releases/FreeCAD-0-14\n#Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1\n#Python version: 2.6.2\n#Qt version: 4.5.2\n#Coin version: 3.1.0\n#SoQt version: 1.4.1\n\ntry:\n import PyQt4\n from PyQt4 import QtCore, QtGui\nexcept Exception:\n import PySide\n from PySide import QtCore, QtGui\n\nimport Draft, Part, FreeCAD, math, PartGui, FreeCADGui\nfrom math import sqrt, pi, sin, cos, asin\nfrom FreeCAD import Base\n\nglobal path\n\npath = FreeCAD.ConfigGet(\"AppHomePath\")\n\ndef heure():\n return QtCore.QTime().currentTime().toString('hh:mm:ss')\ndef dateEu():\n return QtCore.QDate().currentDate().toString('dd/MM/yyyy') # forme euro\ndef dateUs():\n return QtCore.QDate().currentDate().toString('MM/dd/yyyy') # forme us\ndef dateComp():\n return QtCore.QDate().currentDate().toString('dddd d MMMM yyyy') # Retourne \"dimanche 20 Juillet 69\"\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\ndef errorDialog(msg):\n # Create a simple dialog QMessageBox\n # The first argument indicates the icon used: one of QtGui.QMessageBox.{NoIcon, Information, Warning, Critical, Question} \n diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u\"Error Message\",msg)\n try:\n diag.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) #PyQt4 cette fonction met la fenêtre en avant\n except Exception:\n diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) #PySide cette fonction met la fenêtre en avant\n #diag.setWindowModality(QtCore.Qt.ApplicationModal) # la fonction a été désactivée pour favoriser \"WindowStaysOnTopHint\"\n diag.exec_()\n\ndef symbol_EU(depx,depy): #symbol_EU\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolUS\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolEU\")\n except:\n None\n App.activeDocument().addObject('Sketcher::SketchObject','Symbol_EU')\n App.activeDocument().Symbol_EU.Placement = App.Placement(App.Vector(0.0,0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(-7.5,0.0,0.0),App.Vector(20.0,0.0,0.0)))\n\n App.ActiveDocument.Symbol_EU.Placement = App.Placement(App.Vector(0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(12.50,-7.5,0),App.Vector(12.50,7.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Circle(App.Vector(12.50,0.0,0),App.Vector(0,0,1),2.5))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Circle(App.Vector(12.50,0.0,0),App.Vector(0,0,1),5.0))\n\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,5.0,0.0),App.Vector(-5.0,2.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(-5.0,-2.5,0.0),App.Vector(-5.0,2.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,-5.0,0.0),App.Vector(-5.0,-2.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,-5.0,0.0),App.Vector(5.0,5.0,0.0)))\n Gui.getDocument(App.ActiveDocument.Name).resetEdit()\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").LineColor = (0.00,0.00,0.00)\n App.ActiveDocument.recompute()\n\n App.activeDocument().addObject('Drawing::FeatureViewPart','SymbolEU')\n App.activeDocument().SymbolEU.Source = App.activeDocument().Symbol_EU\n App.activeDocument().SymbolEU.Direction = (0.0,0.0,1.0)\n App.activeDocument().SymbolEU.X = depx\n App.activeDocument().SymbolEU.Y = depy\n App.activeDocument().SymbolEU.Scale = 0.8\n App.activeDocument().Page.addObject(App.activeDocument().SymbolEU)\n App.ActiveDocument.recompute()\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").Visibility = False\n\ndef symbol_US(depx,depy): #symbol_US\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolUS\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolEU\")\n except:\n None\n App.activeDocument().addObject('Sketcher::SketchObject','Symbol_US')\n App.activeDocument().Symbol_US.Placement = App.Placement(App.Vector(0.0,0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(-7.5,0.0,0.0),App.Vector(20.0,0.0,0.0)))\n\n App.ActiveDocument.Symbol_US.Placement = App.Placement(App.Vector(0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(0.0,-7.5,0.0),App.Vector(0.0,7.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Circle(App.Vector(0.0,0.0,0.0),App.Vector(0,0,1),2.5))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Circle(App.Vector(0.0,0.0,0.0),App.Vector(0,0,1),5.0))\n\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,5.0,0.0),App.Vector(7.5,2.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(7.5,-2.5,0.0),App.Vector(7.5,2.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,-5.0,0.0),App.Vector(7.5,-2.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,-5.0,0.0),App.Vector(17.5,5.0,0.0)))\n Gui.getDocument(App.ActiveDocument.Name).resetEdit()\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").LineColor = (0.00,0.00,0.00)\n App.ActiveDocument.recompute()\n\n App.activeDocument().addObject('Drawing::FeatureViewPart','SymbolUS')\n App.activeDocument().SymbolUS.Source = App.activeDocument().Symbol_US\n App.activeDocument().SymbolUS.Direction = (0.0,0.0,1.0)\n App.activeDocument().SymbolUS.X = depx\n App.activeDocument().SymbolUS.Y = depy\n App.activeDocument().SymbolUS.Scale = 0.8\n App.activeDocument().Page.addObject(App.activeDocument().SymbolUS)\n App.ActiveDocument.recompute()\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").Visibility = False\n\ntry:\n DESIGNED_BY = App.activeDocument().getObject(\"Page\").EditableTexts[0] #lineEdit01 DESIGNED_BY\n CREATION_DATE = App.activeDocument().getObject(\"Page\").EditableTexts[1] #lineEdit02 CREATION_DATE date\n CREA_DATE = CREATION_DATE[0:10] # lineEdit02h date\n CREA_TIME = CREATION_DATE[13:21] # lineEdit02h heure\n CHECKED_BY = App.activeDocument().getObject(\"Page\").EditableTexts[2] # lineEdit03\n CHECK_DATE = App.activeDocument().getObject(\"Page\").EditableTexts[3] # lineEdit04 date\n CHEC_DATE = CHECK_DATE[0:10] # lineEdit04 date\n CHEC_TIME = CHECK_DATE[13:21] # lineEdit04h heure\n SIZE = \"A3\" # lineEdit05\n SCALE = App.activeDocument().getObject(\"Page\").EditableTexts[4] # lineEdit06\n WEIGHT = App.activeDocument().getObject(\"Page\").EditableTexts[5] # lineEdit07\n DRAWING_NUMBER = App.activeDocument().getObject(\"Page\").EditableTexts[6] # lineEdit08\n SHEET = App.activeDocument().getObject(\"Page\").EditableTexts[7] # lineEdit09\n TITLE = App.activeDocument().getObject(\"Page\").EditableTexts[8] # textEdit_01\n DESCRIPTION = App.activeDocument().getObject(\"Page\").EditableTexts[9] # textEdit_02\n\nexcept:\n errorDialog(\"erreur cartouche\")\ntry:\n try:\n lineEdit18 = App.activeDocument().getObject(\"Note_I\").Text[0] \n except:\n lineEdit18 = \"\"\n try:\n lineEdit17 = App.activeDocument().getObject(\"Note_H\").Text[0] \n except:\n lineEdit17 = \"\"\n try:\n lineEdit16 = App.activeDocument().getObject(\"Note_G\").Text[0] \n except:\n lineEdit16 = \"\"\n try:\n lineEdit15 = App.activeDocument().getObject(\"Note_F\").Text[0] \n except:\n lineEdit15 = \"\"\n try:\n lineEdit14 = App.activeDocument().getObject(\"Note_E\").Text[0] \n except:\n lineEdit14 = \"\"\n try:\n lineEdit13 = App.activeDocument().getObject(\"Note_D\").Text[0] \n except:\n lineEdit13 = \"\"\n try:\n lineEdit12 = App.activeDocument().getObject(\"Note_C\").Text[0] \n except:\n lineEdit12 = \"\"\n try:\n lineEdit11 = App.activeDocument().getObject(\"Note_B\").Text[0] \n except:\n lineEdit11 = \"\"\n try:\n lineEdit10 = App.activeDocument().getObject(\"Note_A\").Text[0] \n except:\n lineEdit10 = \"\"\n try:\n lineEdit20 = App.activeDocument().getObject(\"CopyRight\").Text[0] \n except:\n lineEdit20 = \"\"\nexcept:\n errorDialog(\"erreur note\")\n\nclass Ui_MainWindow(object):\n\n def __init__(self, MainWindow):\n self.window = MainWindow\n#___________________________________________________________________________________\n\n MainWindow.setObjectName(_fromUtf8(\"MainWindow\"))\n MainWindow.resize(810, 440)\n MainWindow.setMaximumSize(QtCore.QSize(810, 480))\n self.centralWidget = QtGui.QWidget(MainWindow)\n self.centralWidget.setObjectName(_fromUtf8(\"centralWidget\"))\n\n# self.pushButton01 = QtGui.QPushButton(self.centralWidget)\n# self.pushButton01.setGeometry(QtCore.QRect(115, 360, 93, 28))\n# self.pushButton01.setObjectName(_fromUtf8(\"pushButton01\"))\n# self.pushButton01.clicked.connect(self.on_pushButton01_clicked) #connection pushButton01\n\n self.pushButton02 = QtGui.QPushButton(self.centralWidget)\n self.pushButton02.setGeometry(QtCore.QRect(225, 360, 93, 28))\n self.pushButton02.setObjectName(_fromUtf8(\"pushButton02\"))\n self.pushButton02.clicked.connect(self.on_pushButton02_clicked) #connection pushButton02\n\n self.pushButton03 = QtGui.QPushButton(self.centralWidget)\n self.pushButton03.setGeometry(QtCore.QRect(335, 360, 93, 28))\n self.pushButton03.setObjectName(_fromUtf8(\"pushButton03\"))\n self.pushButton03.clicked.connect(self.on_pushButton03_clicked) #connection pushButton03\n\n self.pushButton04 = QtGui.QPushButton(self.centralWidget)\n self.pushButton04.setGeometry(QtCore.QRect(445, 360, 93, 28))\n self.pushButton04.setObjectName(_fromUtf8(\"pushButton04\"))\n self.pushButton04.clicked.connect(self.on_pushButton04_clicked) #connection pushButton04\n\n self.pushButton05 = QtGui.QPushButton(self.centralWidget)\n self.pushButton05.setGeometry(QtCore.QRect(555, 360, 93, 28))\n self.pushButton05.setObjectName(_fromUtf8(\"pushButton05\"))\n self.pushButton05.clicked.connect(self.on_pushButton05_clicked) #connection pushButton05\n\n self.pushButton06 = QtGui.QPushButton(self.centralWidget)\n self.pushButton06.setGeometry(QtCore.QRect(170, 56, 20, 20))\n self.pushButton06.setObjectName(_fromUtf8(\"pushButton06\"))\n self.pushButton06.clicked.connect(self.on_pushButton06_clicked) #connection pushButton06\n\n self.pushButton07 = QtGui.QPushButton(self.centralWidget)\n self.pushButton07.setGeometry(QtCore.QRect(190, 56, 20, 20))\n self.pushButton07.setObjectName(_fromUtf8(\"pushButton07\"))\n self.pushButton07.clicked.connect(self.on_pushButton07_clicked) #connection pushButton07\n\n self.pushButton08 = QtGui.QPushButton(self.centralWidget)\n self.pushButton08.setGeometry(QtCore.QRect(170, 136, 20, 20))\n self.pushButton08.setObjectName(_fromUtf8(\"pushButton08\"))\n self.pushButton08.clicked.connect(self.on_pushButton08_clicked) #connection pushButton08\n\n self.pushButton09 = QtGui.QPushButton(self.centralWidget)\n self.pushButton09.setGeometry(QtCore.QRect(190, 136, 20, 20))\n self.pushButton09.setObjectName(_fromUtf8(\"pushButton09\"))\n self.pushButton09.clicked.connect(self.on_pushButton09_clicked) #connection pushButton09\n\n self.pushButton10 = QtGui.QPushButton(self.centralWidget)\n self.pushButton10.setGeometry(QtCore.QRect(100, 220, 101, 20))\n self.pushButton10.setObjectName(_fromUtf8(\"pushButton10\"))\n self.pushButton10.clicked.connect(self.on_pushButton10_clicked) #connection pushButton10\n\n self.lineEdit_01 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_01.setGeometry(QtCore.QRect(20, 20, 181, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_01.setFont(font)\n self.lineEdit_01.setObjectName(_fromUtf8(\"lineEdit_01\"))\n self.lineEdit_01.setText(DESIGNED_BY)\n\n self.lineEdit_02 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02.setGeometry(QtCore.QRect(20, 60, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02.setFont(font)\n self.lineEdit_02.setObjectName(_fromUtf8(\"lineEdit_02\"))\n self.lineEdit_02.setText(CREA_DATE)\n\n self.lineEdit_02h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02h.setGeometry(QtCore.QRect(98, 60, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02h.setFont(font)\n self.lineEdit_02h.setObjectName(_fromUtf8(\"lineEdit_02h\"))\n self.lineEdit_02h.setText(CREA_TIME)\n\n self.lineEdit_03 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_03.setGeometry(QtCore.QRect(20, 100, 181, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_03.setFont(font)\n self.lineEdit_03.setObjectName(_fromUtf8(\"lineEdit_03\"))\n self.lineEdit_03.setText(CHECKED_BY)\n\n self.lineEdit_04 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04.setGeometry(QtCore.QRect(20, 140, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04.setFont(font)\n self.lineEdit_04.setObjectName(_fromUtf8(\"lineEdit_04\"))\n self.lineEdit_04.setText(CHEC_DATE)\n\n self.lineEdit_04h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04h.setGeometry(QtCore.QRect(98, 140, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04h.setFont(font)\n self.lineEdit_04h.setObjectName(_fromUtf8(\"lineEdit_04h\"))\n self.lineEdit_04h.setText(CHEC_TIME)\n\n self.lineEdit_05 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_05.setGeometry(QtCore.QRect(20, 180, 61, 61))\n font = QtGui.QFont()\n font.setPointSize(17)\n font.setBold(False)\n font.setWeight(50)\n self.lineEdit_05.setFont(font)\n self.lineEdit_05.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_05.setObjectName(_fromUtf8(\"lineEdit_05\"))\n self.lineEdit_05.setText(SIZE)\n\n self.lineEdit_06 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_06.setGeometry(QtCore.QRect(20, 280, 61, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_06.setFont(font)\n self.lineEdit_06.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_06.setObjectName(_fromUtf8(\"lineEdit_06\"))\n self.lineEdit_06.setText(SCALE)\n\n self.lineEdit_07 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_07.setGeometry(QtCore.QRect(100, 280, 101, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_07.setFont(font)\n self.lineEdit_07.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_07.setObjectName(_fromUtf8(\"lineEdit_07\"))\n self.lineEdit_07.setText(WEIGHT)\n\n self.lineEdit_08 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_08.setGeometry(QtCore.QRect(220, 280, 341, 41))\n self.lineEdit_08.setObjectName(_fromUtf8(\"lineEdit_08\"))\n self.lineEdit_08.setText(DRAWING_NUMBER)\n\n self.lineEdit_09 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_09.setGeometry(QtCore.QRect(570, 280, 81, 41))\n self.lineEdit_09.setObjectName(_fromUtf8(\"lineEdit_09\"))\n self.lineEdit_09.setText(SHEET)\n\n self.lineEdit_10 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_10.setGeometry(QtCore.QRect(690, 290, 101, 30))\n self.lineEdit_10.setObjectName(_fromUtf8(\"lineEdit_10\"))\n self.lineEdit_10.setText(lineEdit10)\n\n self.lineEdit_11 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_11.setGeometry(QtCore.QRect(690, 260, 101, 30))\n self.lineEdit_11.setObjectName(_fromUtf8(\"lineEdit_11\"))\n self.lineEdit_11.setText(lineEdit11)\n\n self.lineEdit_12 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_12.setGeometry(QtCore.QRect(690, 230, 101, 30))\n self.lineEdit_12.setObjectName(_fromUtf8(\"lineEdit_12\"))\n self.lineEdit_12.setText(lineEdit12)\n\n self.lineEdit_13 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_13.setGeometry(QtCore.QRect(690, 200, 101, 30))\n self.lineEdit_13.setObjectName(_fromUtf8(\"lineEdit_13\"))\n self.lineEdit_13.setText(lineEdit13)\n\n self.lineEdit_14 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_14.setGeometry(QtCore.QRect(690, 170, 101, 30))\n self.lineEdit_14.setObjectName(_fromUtf8(\"lineEdit_14\"))\n self.lineEdit_14.setText(lineEdit14)\n\n self.lineEdit_15 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_15.setGeometry(QtCore.QRect(690, 140, 101, 30))\n self.lineEdit_15.setObjectName(_fromUtf8(\"lineEdit_15\"))\n self.lineEdit_15.setText(lineEdit15)\n\n self.lineEdit_16 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_16.setGeometry(QtCore.QRect(690, 110, 101, 30))\n self.lineEdit_16.setObjectName(_fromUtf8(\"lineEdit_16\"))\n self.lineEdit_16.setText(lineEdit16)\n\n self.lineEdit_17 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_17.setGeometry(QtCore.QRect(690, 80, 101, 30))\n self.lineEdit_17.setObjectName(_fromUtf8(\"lineEdit_17\"))\n self.lineEdit_17.setText(lineEdit17)\n\n self.lineEdit_18 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_18.setGeometry(QtCore.QRect(690, 50, 101, 30))\n self.lineEdit_18.setObjectName(_fromUtf8(\"lineEdit_18\"))\n self.lineEdit_18.setText(lineEdit18)\n\n self.lineEdit_20 = QtGui.QLineEdit(self.centralWidget) # Copyright\n self.lineEdit_20.setGeometry(QtCore.QRect(20, 330, 771, 22))\n self.lineEdit_20.setObjectName(_fromUtf8(\"lineEdit_20\"))\n self.lineEdit_20.setText(lineEdit20)\n\n self.textEdit_01 = QtGui.QTextEdit(self.centralWidget)\n self.textEdit_01.setGeometry(QtCore.QRect(220, 20, 431,60 ))\n font = QtGui.QFont()\n font.setPointSize(15)\n font.setBold(True)\n font.setWeight(75)\n self.textEdit_01.setFont(font)\n self.textEdit_01.setObjectName(_fromUtf8(\"textEdit_01\"))\n self.textEdit_01.setText(TITLE)\n\n self.textEdit_02 = QtGui.QTextEdit(self.centralWidget)\n self.textEdit_02.setGeometry(QtCore.QRect(220, 90, 431, 60))\n self.textEdit_02.setObjectName(_fromUtf8(\"textEdit_02\"))\n self.textEdit_02.setText(DESCRIPTION)\n\n# self.graphicsView_01 = QtGui.QGraphicsView(self.centralWidget)\n# self.graphicsView_01.setGeometry(QtCore.QRect(100, 160, 101, 81))\n# brush = QtGui.QBrush(QtGui.QColor(0, 170, 255))\n# brush.setStyle(QtCore.Qt.NoBrush)\n# self.graphicsView_01.setBackgroundBrush(brush)\n# self.graphicsView_01.setObjectName(_fromUtf8(\"graphicsView_01\"))\n\n self.textEdit_03 = QtGui.QTextEdit(self.centralWidget)\n self.textEdit_03.setGeometry(QtCore.QRect(100, 160, 101, 55))\n self.textEdit_03.setAlignment(QtCore.Qt.AlignCenter)\n self.textEdit_03.setObjectName(_fromUtf8(\"textEdit_03\"))\n self.textEdit_03.setText(\"Select your Symbol\")\n\n self.graphicsView_02 = QtGui.QGraphicsView(self.centralWidget)\n self.graphicsView_02.setGeometry(QtCore.QRect(220, 160, 431, 81))#570, 160, 81, 81\n self.graphicsView_02.setObjectName(_fromUtf8(\"graphicsView_02\"))\n\n self.label_01 = QtGui.QLabel(self.centralWidget)\n self.label_01.setGeometry(QtCore.QRect(20, 0, 91, 16))\n self.label_01.setObjectName(_fromUtf8(\"label_01\"))\n\n self.label_02 = QtGui.QLabel(self.centralWidget)\n self.label_02.setGeometry(QtCore.QRect(20, 40, 53, 16))\n self.label_02.setObjectName(_fromUtf8(\"label_02\"))\n\n self.label_03 = QtGui.QLabel(self.centralWidget)\n self.label_03.setGeometry(QtCore.QRect(20, 80, 101, 16))\n self.label_03.setObjectName(_fromUtf8(\"label_03\"))\n\n self.label_04 = QtGui.QLabel(self.centralWidget)\n self.label_04.setGeometry(QtCore.QRect(20, 120, 91, 16))\n self.label_04.setObjectName(_fromUtf8(\"label_04\"))\n\n self.label_05 = QtGui.QLabel(self.centralWidget)\n self.label_05.setGeometry(QtCore.QRect(20, 160, 53, 16))\n self.label_05.setObjectName(_fromUtf8(\"label_05\"))\n\n self.label_06 = QtGui.QLabel(self.centralWidget)\n self.label_06.setGeometry(QtCore.QRect(20, 260, 53, 16))\n self.label_06.setObjectName(_fromUtf8(\"label_06\"))\n\n self.label_07 = QtGui.QLabel(self.centralWidget)\n self.label_07.setGeometry(QtCore.QRect(100, 260, 101, 16))\n self.label_07.setObjectName(_fromUtf8(\"label_07\"))\n\n self.label_08 = QtGui.QLabel(self.centralWidget)\n self.label_08.setGeometry(QtCore.QRect(220, 260, 121, 16))\n self.label_08.setObjectName(_fromUtf8(\"label_08\"))\n\n self.label_09 = QtGui.QLabel(self.centralWidget)\n self.label_09.setGeometry(QtCore.QRect(570, 260, 53, 16))\n self.label_09.setObjectName(_fromUtf8(\"label_09\"))\n\n self.label_10 = QtGui.QLabel(self.centralWidget)\n self.label_10.setGeometry(QtCore.QRect(670, 290, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_10.setFont(font)\n self.label_10.setObjectName(_fromUtf8(\"label_10\"))\n\n self.label_11 = QtGui.QLabel(self.centralWidget)\n self.label_11.setGeometry(QtCore.QRect(670, 260, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_11.setFont(font)\n self.label_11.setObjectName(_fromUtf8(\"label_11\"))\n\n self.label_12 = QtGui.QLabel(self.centralWidget)\n self.label_12.setGeometry(QtCore.QRect(670, 230, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_12.setFont(font)\n self.label_12.setObjectName(_fromUtf8(\"label_12\"))\n\n self.label_13 = QtGui.QLabel(self.centralWidget)\n self.label_13.setGeometry(QtCore.QRect(670, 200, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_13.setFont(font)\n self.label_13.setObjectName(_fromUtf8(\"label_13\"))\n\n self.label_14 = QtGui.QLabel(self.centralWidget)\n self.label_14.setGeometry(QtCore.QRect(670, 170, 15, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_14.setFont(font)\n self.label_14.setObjectName(_fromUtf8(\"label_14\"))\n\n self.label_15 = QtGui.QLabel(self.centralWidget)\n self.label_15.setGeometry(QtCore.QRect(670, 140, 14, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_15.setFont(font)\n self.label_15.setObjectName(_fromUtf8(\"label_15\"))\n\n self.label_16 = QtGui.QLabel(self.centralWidget)\n self.label_16.setGeometry(QtCore.QRect(670, 110, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_16.setFont(font)\n self.label_16.setObjectName(_fromUtf8(\"label_16\"))\n\n self.label_17 = QtGui.QLabel(self.centralWidget)\n self.label_17.setGeometry(QtCore.QRect(670, 80, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_17.setFont(font)\n self.label_17.setObjectName(_fromUtf8(\"label_17\"))\n\n self.label_18 = QtGui.QLabel(self.centralWidget)\n self.label_18.setGeometry(QtCore.QRect(670, 50, 10, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_18.setFont(font)\n self.label_18.setObjectName(_fromUtf8(\"label_18\"))\n\n self.label_19 = QtGui.QLabel(self.centralWidget)\n self.label_19.setGeometry(QtCore.QRect(720, 15, 100, 33))\n self.label_19.setObjectName(_fromUtf8(\"label_19\"))\n\n MainWindow.setCentralWidget(self.centralWidget)\n self.menuBar = QtGui.QMenuBar(MainWindow)\n self.menuBar.setGeometry(QtCore.QRect(0, 0, 810, 26))\n self.menuBar.setObjectName(_fromUtf8(\"menuBar\"))\n MainWindow.setMenuBar(self.menuBar)\n self.statusBar = QtGui.QStatusBar(MainWindow)\n self.statusBar.setObjectName(_fromUtf8(\"statusBar\"))\n MainWindow.setStatusBar(self.statusBar)\n\n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n\n def retranslateUi(self, MainWindow):\n try:\n MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4 cette fonction met la fenêtre en avant\n except Exception:\n MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenêtre en avant\n\n MainWindow.setWindowTitle(_translate(\"MainWindow\", \"Cartouche\", None))\n# self.pushButton01.setText(_translate(\"MainWindow\", \"Position\", None))\n self.pushButton02.setText(_translate(\"MainWindow\", \"Quitter\", None))\n self.pushButton03.setText(_translate(\"MainWindow\", \"Memo\", None))\n self.pushButton04.setText(_translate(\"MainWindow\", \"Nettoyer\", None))\n self.pushButton05.setText(_translate(\"MainWindow\", \"Appliquer\", None))\n self.pushButton06.setText(_translate(\"MainWindow\", \"D.\", None))\n self.pushButton07.setText(_translate(\"MainWindow\", \"H.\", None))\n self.pushButton08.setText(_translate(\"MainWindow\", \"D.\", None))\n self.pushButton09.setText(_translate(\"MainWindow\", \"H.\", None))\n self.pushButton10.setText(_translate(\"MainWindow\", \"Symbole EU\", None))\n\n\n self.label_01.setText(_translate(\"MainWindow\", \"Designed by :\", None))\n self.label_02.setText(_translate(\"MainWindow\", \"Date :\", None))\n self.label_03.setText(_translate(\"MainWindow\", \"Checked by :\", None))\n self.label_04.setText(_translate(\"MainWindow\", \"Date :\", None))\n self.label_05.setText(_translate(\"MainWindow\", \"Size :\", None))\n self.label_06.setText(_translate(\"MainWindow\", \"Scale :\", None))\n self.label_07.setText(_translate(\"MainWindow\", \"Weight (Kg) :\", None))\n self.label_08.setText(_translate(\"MainWindow\", \"Drawing number :\", None))\n self.label_09.setText(_translate(\"MainWindow\", \"Sheet :\", None))\n self.label_10.setText(_translate(\"MainWindow\", \"A\", None))\n self.label_11.setText(_translate(\"MainWindow\", \"B\", None))\n self.label_12.setText(_translate(\"MainWindow\", \"C\", None))\n self.label_13.setText(_translate(\"MainWindow\", \"D\", None))\n self.label_14.setText(_translate(\"MainWindow\", \"E\", None))\n self.label_15.setText(_translate(\"MainWindow\", \"F\", None))\n self.label_16.setText(_translate(\"MainWindow\", \"G\", None))\n self.label_17.setText(_translate(\"MainWindow\", \"H\", None))\n self.label_18.setText(_translate(\"MainWindow\", \"I\", None))\n self.label_19.setText(_translate(\"MainWindow\", \"Notes\", None))\n#______________________________________________________________________________________\n # Boutons\n def on_pushButton10_clicked(self): # Bouton /Symbole\n if self.textEdit_03.toPlainText()==\"Symbole US\":\n self.pushButton10.setText(_translate(\"MainWindow\", \"Symbole US\", None))\n self.textEdit_03.setText(\"Symbole EU\")\n symbol_EU(247.5,263.5) #(247.5,263.5)\n else:\n self.pushButton10.setText(_translate(\"MainWindow\", \"Symbole EU\", None))\n self.textEdit_03.setText(\"Symbole US\")\n symbol_US(247.5,263.5) #(247.5,263.5)\n def on_pushButton09_clicked(self): # Bouton /heure document\n self.lineEdit_04h.setText(str(heure()))\n def on_pushButton08_clicked(self): # Bouton date/ document\n if self.textEdit_03.toPlainText()==\"Symbole US\":\n self.lineEdit_04.setText(str(dateUs()))\n else:\n self.lineEdit_04.setText(str(dateEu()))\n def on_pushButton07_clicked(self): # Bouton /heure checked\n self.lineEdit_02h.setText(str(heure()))\n def on_pushButton06_clicked(self): # Bouton date/ checked\n if self.textEdit_03.toPlainText()==\"Symbole US\":\n self.lineEdit_02.setText(str(dateUs()))\n else:\n self.lineEdit_02.setText(str(dateEu()))\n def on_pushButton05_clicked(self): # Bouton Appliquer\n DESIGNED_BY = self.lineEdit_01.text() \n CREATION_DATE = self.lineEdit_02.text()+\" - \"+self.lineEdit_02h.text()\n CHECKED_BY = self.lineEdit_03.text()\n CHECK_DATE = self.lineEdit_04.text()+\" - \"+self.lineEdit_04h.text()\n SIZE = \"A3\" # self.lineEdit_05.text()\n SCALE = self.lineEdit_06.text()\n WEIGHT = self.lineEdit_07.text()\n DRAWING_NUMBER = self.lineEdit_08.text()\n SHEET = self.lineEdit_09.text()\n TITLE = self.textEdit_01.toPlainText()\n DESCRIPTION = self.textEdit_02.toPlainText()\n SYMBOL = self.textEdit_03.toPlainText()\n try:\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts = [unicode(DESIGNED_BY, 'utf-8'), unicode(CREATION_DATE, 'utf-8'), unicode(CHECKED_BY, 'utf-8'), unicode(CHECK_DATE, 'utf-8'), unicode(SCALE, 'utf-8'), unicode(WEIGHT, 'utf-8'), unicode(DRAWING_NUMBER, 'utf-8'), unicode(SHEET, 'utf-8'), unicode(TITLE, 'utf-8'), unicode(DESCRIPTION, 'utf-8'),]\n except Exception:\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts = [DESIGNED_BY.encode('utf-8'), CREATION_DATE.encode('utf-8'), CHECKED_BY.encode('utf-8'), CHECK_DATE.encode('utf-8'), SCALE.encode('utf-8'), WEIGHT.encode('utf-8'), DRAWING_NUMBER.encode('utf-8'), SHEET.encode('utf-8'), TITLE.encode('utf-8'), DESCRIPTION.encode('utf-8'),]\n\n #print App.ActiveDocument.Name\n try:\n App.activeDocument().removeObject('Note_I')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_H')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_G')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_F')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_E')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_D')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_C')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_B')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_A')\n except:\n None\n try:\n App.activeDocument().removeObject('CopyRight')\n except:\n None\n if self.lineEdit_18.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_I')\n App.activeDocument().Note_I.X = 391.0\n App.activeDocument().Note_I.Y = 232\n App.activeDocument().Note_I.Scale = 3.0\n App.activeDocument().Note_I.Text = str(self.lineEdit_18.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_I)\n if self.lineEdit_17.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_H')\n App.activeDocument().Note_H.X = 391.0\n App.activeDocument().Note_H.Y = 238.8\n App.activeDocument().Note_H.Scale = 3.0\n App.activeDocument().Note_H.Text = str(self.lineEdit_17.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_H)\n if self.lineEdit_16.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_G')\n App.activeDocument().Note_G.X = 391.0\n App.activeDocument().Note_G.Y = 245.4\n App.activeDocument().Note_G.Scale = 3.0\n App.activeDocument().Note_G.Text = str(self.lineEdit_16.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_G)\n if self.lineEdit_15.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_F')\n App.activeDocument().Note_F.X = 391.0\n App.activeDocument().Note_F.Y = 252\n App.activeDocument().Note_F.Scale = 3.0\n App.activeDocument().Note_F.Text = str(self.lineEdit_15.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_F)\n if self.lineEdit_14.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_E')\n App.activeDocument().Note_E.X = 391.0\n App.activeDocument().Note_E.Y = 258.6\n App.activeDocument().Note_E.Scale = 3.0\n App.activeDocument().Note_E.Text = str(self.lineEdit_14.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_E)\n if self.lineEdit_13.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_D')\n App.activeDocument().Note_D.X = 391.0\n App.activeDocument().Note_D.Y = 265.2\n App.activeDocument().Note_D.Scale = 3.0\n App.activeDocument().Note_D.Text = str(self.lineEdit_13.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_D)\n if self.lineEdit_12.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_C')\n App.activeDocument().Note_C.X = 391.0\n App.activeDocument().Note_C.Y = 271.8\n App.activeDocument().Note_C.Scale = 3.0\n App.activeDocument().Note_C.Text = str(self.lineEdit_12.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_C)\n if self.lineEdit_11.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_B')\n App.activeDocument().Note_B.X = 391.0\n App.activeDocument().Note_B.Y = 278.4\n App.activeDocument().Note_B.Scale = 3.0\n App.activeDocument().Note_B.Text = str(self.lineEdit_11.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_B)\n if self.lineEdit_10.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_A')\n App.activeDocument().Note_A.X = 391.0\n App.activeDocument().Note_A.Y = 285.0\n App.activeDocument().Note_A.Scale = 3.0\n App.activeDocument().Note_A.Text = str(self.lineEdit_10.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_A)\n if self.lineEdit_20.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','CopyRight')\n App.activeDocument().CopyRight.X = 221\n App.activeDocument().CopyRight.Y = 286\n App.activeDocument().CopyRight.Scale = 3.0\n App.activeDocument().CopyRight.Text = str(self.lineEdit_20.text())\n App.activeDocument().Page.addObject(App.activeDocument().CopyRight)\n\n App.ActiveDocument.recompute()\n\n def on_pushButton04_clicked(self): # Bouton nettoyer\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolUS\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolEU\")\n except:\n None\n DESIGNED_BY = \"\" ;self.lineEdit_01.setText(\"\")\n CREATION_DATE = \"\" ;self.lineEdit_02.setText(\"\")\n self.lineEdit_02h.setText(\"\")\n CHECKED_BY = \"\" ;self.lineEdit_03.setText(\"\")\n CHECK_DATE = \"\" ;self.lineEdit_04.setText(\"\")\n self.lineEdit_04h.setText(\"\")\n SIZE = \"A3\" ;self.lineEdit_05.setText(\"A3\")\n SCALE = \"\" ;self.lineEdit_06.setText(\"\")\n WEIGHT = \"\" ;self.lineEdit_07.setText(\"\")\n DRAWING_NUMBER = \"\" ;self.lineEdit_08.setText(\"\")\n SHEET = \"\" ;self.lineEdit_09.setText(\"\")\n TITLE = \"\" ;self.textEdit_01.setText(\"\")\n DESCRIPTION = \"\" ;self.textEdit_02.setText(\"\")\n \n self.lineEdit_10.setText(\"\")\n self.lineEdit_11.setText(\"\")\n self.lineEdit_12.setText(\"\")\n self.lineEdit_13.setText(\"\")\n self.lineEdit_14.setText(\"\")\n self.lineEdit_15.setText(\"\")\n self.lineEdit_16.setText(\"\")\n self.lineEdit_17.setText(\"\")\n self.lineEdit_18.setText(\"\")\n self.lineEdit_20.setText(\"\")\n\n def on_pushButton03_clicked(self): # Bouton Memo\n self.lineEdit_01.setText(DESIGNED_BY)\n self.lineEdit_02.setText(CREA_DATE)\n self.lineEdit_02h.setText(CREA_TIME)\n self.lineEdit_03.setText(CHECKED_BY)\n self.lineEdit_04.setText(CHEC_DATE)\n self.lineEdit_04h.setText(CHEC_TIME)\n self.lineEdit_05.setText(SIZE)\n self.lineEdit_06.setText(SCALE)\n self.lineEdit_07.setText(WEIGHT)\n self.lineEdit_08.setText(DRAWING_NUMBER)\n self.lineEdit_09.setText(SHEET)\n self.textEdit_01.setText(TITLE)\n self.textEdit_02.setText(DESCRIPTION)\n\n self.lineEdit_18.setText(lineEdit18)\n self.lineEdit_17.setText(lineEdit17)\n self.lineEdit_16.setText(lineEdit16)\n self.lineEdit_15.setText(lineEdit15)\n self.lineEdit_14.setText(lineEdit14)\n self.lineEdit_13.setText(lineEdit13)\n self.lineEdit_12.setText(lineEdit12)\n self.lineEdit_11.setText(lineEdit11)\n self.lineEdit_10.setText(lineEdit10)\n self.lineEdit_20.setText(lineEdit20)\n\n def on_pushButton02_clicked(self): # Bouton Quitter\n App.Console.PrintMessage(\"Terminé\\r\\n\")\n self.window.hide()\n# def on_pushButton01_clicked(self): # Bouton appel de Position\n# MainWindow.resize(210, 480)\n# executer()\n# MainWindow.resize(810, 480)\n#______________________________________________________________________________________\n\nMainWindow = QtGui.QMainWindow()\nui = Ui_MainWindow(MainWindow)\nMainWindow.show()\n\n}}\n\n## Other\n\nThe fields have no length limit, check your cartouche.\nThis program creates a drawing representing the regional projection symbol on your project, do not touch it is registered therefore hidden form invisible.\nIf you want it to be cleared uncomment the commented lines and vice versa\n\n\n```python\n\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").Visibility = False\net\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").Visibility = False\n```\n\n(I had some times an error in execution when the symbol was erased)\nThis module works with the drawing sheet included in FreeCAD this sheet is called **Page**, do not change the name of this sheet!\n\n## Revision\n\nver 0.3 02/07/2014 converted to PyQt4 and PySide\n\n\n
\n\n\n
\n\n\n
\n\n# Macro CartoucheFC/fr \n\n\n
\n\n\n{{Macro/fr\n|Name=Macro CartoucheFC\n|Icon=Macro_CartoucheFC.png\n|Description=Cette macro est une application complète, elle permet de remplir le cartouche de la feuille de dessin livrée avec FreeCAD (Seulement pour l'[atelier Drawing](Drawing_Workbench/fr.md)).\n|Author=Mario52\n|Version=0.3\n|Date=2014-07-02\n|FCVersion=Toutes versions utilisant l'atelier Drawing\n|Download=[https://www.freecadweb.org/wiki/images/0/0a/Macro_CartoucheFC.png ToolBar Icon]\n}}\n\n## Description \n\nCette macro est une application complète, elle permet de remplir simplement tous les champs du cartouche de la feuille de dessin livrée avec FreeCAD.\n\nLa date et l\\'heure sont séparés par un \\\"espace tiret espace\\\" et constitue une seule ligne dans le textéditable de FreeCAD.\n\n\"CartoucheFC\"\n\nLes champs en rouge sont les champs **\\\"FreeCAD: modifiable\\\"**., les champs en vert sont des annotations insérées dans le modèle\nIci une version de Macro_CartoucheFC_Full pour les nouvelles feuilles avec textéditable à tous les champs.\n\n## Utilisation\n\n**La modification de la feuille dans Inkscape peut pour le moment poser des problèmes de fonctionnement au programme (dans le cas ou vous enlevez le symbole sur la feuille, même problème avec FreeCAD), travaillez sur une copie de A3_Landscape.svg.**\n**PS: certains caractères comme & \\$ ne sont pas acceptés (et peut être d\\'autres caractères spéciaux)!**\n\nSi vous avez des questions ou désirez ajouter une fonction, vous pouvez vous adresse sur le forum [Remplir cartouche](http://forum.freecadweb.org/viewtopic.php?f=12&t=2049)\n\n- La fenêtre reste au dessus des autres fenêtres et permet ainsi de contrôler le cartouche sans quitter le programme.\n\n- Copiez le code dans un fichier nommé **Macro_CartoucheFC.py** et placez le dans votre répertoire de macros habituelle.\n\n- Après avoir créé votre feuille de dessin à l\\'aide du module Drawing de FreeCAD, lancez la macro **Macro_CartoucheFC**.\n\n- A l\\'ouverture, le programme enregistrera en mémoire toutes les données déjà présente dans le cartouche de la feuille (s\\'ils sont remplis), toutes ces données seront automatiquement restituées à l\\'aide du bouton **Memo** et tenus en mémoire jusqu'à la fermeture du programme.\n\n- Les boutons de date ** D.** et heure ** H.** affichent la date et heure du système.\n\n -Le format de la date est tributaire du symbole sélectionné **EU** ou **US** qui détermine le format régional. Le changement ne se fait pas automatiquement (pour le cas ou vous avez entré une date manuellement) il faut cliquer à nouveau sur les boutons dates si vous changez le symbole (vérifiez avant d\\'imprimer).\n\n- Le champ **A3** n\\'est pas fonctionnel (ce programme est basé sur le cartouche de la feuille A3 de FreeCAD).\n\n- Le bouton **Symbole EU** ou US change le sens du symbole de projection \\\"Select your Symbol\\\" est affiché par défaut, puis le symbole actif s\\'affiche. Cliquez sur le bouton et vérifiez sur la feuille le symbole, cliquez une seconde fois pour modifier le symbole.\n\n -Le choix de ce symbole, influe le format de la date **EU = dd/MM/yyyy** et **US = MM/dd/yyyy**.\n\n -**Attention** : Cette commande ne passe pas par le bouton **Appliquer** et modifie immédiatement le symbole à chaque appuis sur la touche, vérifiez toujours si vous avez sur votre feuille le symbole approprié.\n\n- Le bouton **Nettoyer** efface tous les champs du cartouche. Vous pouvez revenir aux données d\\'origine à l\\'aide du bouton **Memo**.\n\n- Le bouton **Appliquer** enregistre tous les champs du cartouche dans la feuille. Vous pouvez revenir aux données d\\'origine à l\\'aide du bouton **Memo** (sauf pour le symbole régional qui travaille en indépendant et est effectif immédiatement).\n\n## Code \n\nToolBar Icon ![](images/Macro_CartoucheFC.png )\n\n**Macro_CartoucheFC.FCMacro**\n\n\n{{MacroCode|code=\n\n# -*- coding: utf-8 -*-\n# Macro_CartoucheFC.py\n# Remplir les zones du cartouche de la feuille originale de FreeCAD\n# http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC/fr\n# il faut que la page (drawing viewer) s'appelle \" Page \" qui est le nom par défaut du module Drawing\n# Fill the area of the cartridge\n# http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC\n# It is necessary that the page (drawing viewer) is called \"Page\", which is the default name of the Drawing module\n# ver 0.3\n# Created: 02/07/2014\n# Created: by mario52\n# PyQt and PySide \n\n#OS: Windows Vista\n#Word size: 32-bit\n#Version: 0.14.3700 (Git)\n#Branch: releases/FreeCAD-0-14\n#Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1\n#Python version: 2.6.2\n#Qt version: 4.5.2\n#Coin version: 3.1.0\n#SoQt version: 1.4.1\n\ntry:\n import PyQt4\n from PyQt4 import QtCore, QtGui\nexcept Exception:\n import PySide\n from PySide import QtCore, QtGui\n\nimport Draft, Part, FreeCAD, math, PartGui, FreeCADGui\nfrom math import sqrt, pi, sin, cos, asin\nfrom FreeCAD import Base\n\nglobal path\n\npath = FreeCAD.ConfigGet(\"AppHomePath\")\n\ndef heure():\n return QtCore.QTime().currentTime().toString('hh:mm:ss')\ndef dateEu():\n return QtCore.QDate().currentDate().toString('dd/MM/yyyy') # forme euro\ndef dateUs():\n return QtCore.QDate().currentDate().toString('MM/dd/yyyy') # forme us\ndef dateComp():\n return QtCore.QDate().currentDate().toString('dddd d MMMM yyyy') # Retourne \"dimanche 20 Juillet 69\"\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\ndef errorDialog(msg):\n # Create a simple dialog QMessageBox\n # The first argument indicates the icon used: one of QtGui.QMessageBox.{NoIcon, Information, Warning, Critical, Question} \n diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u\"Error Message\",msg)\n try:\n diag.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) #PyQt4 cette fonction met la fenêtre en avant\n except Exception:\n diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) #PySide cette fonction met la fenêtre en avant\n #diag.setWindowModality(QtCore.Qt.ApplicationModal) # la fonction a été désactivée pour favoriser \"WindowStaysOnTopHint\"\n diag.exec_()\n\ndef symbol_EU(depx,depy): #symbol_EU\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolUS\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolEU\")\n except:\n None\n App.activeDocument().addObject('Sketcher::SketchObject','Symbol_EU')\n App.activeDocument().Symbol_EU.Placement = App.Placement(App.Vector(0.0,0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(-7.5,0.0,0.0),App.Vector(20.0,0.0,0.0)))\n\n App.ActiveDocument.Symbol_EU.Placement = App.Placement(App.Vector(0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(12.50,-7.5,0),App.Vector(12.50,7.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Circle(App.Vector(12.50,0.0,0),App.Vector(0,0,1),2.5))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Circle(App.Vector(12.50,0.0,0),App.Vector(0,0,1),5.0))\n\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,5.0,0.0),App.Vector(-5.0,2.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(-5.0,-2.5,0.0),App.Vector(-5.0,2.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,-5.0,0.0),App.Vector(-5.0,-2.5,0.0)))\n App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,-5.0,0.0),App.Vector(5.0,5.0,0.0)))\n Gui.getDocument(App.ActiveDocument.Name).resetEdit()\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").LineColor = (0.00,0.00,0.00)\n App.ActiveDocument.recompute()\n\n App.activeDocument().addObject('Drawing::FeatureViewPart','SymbolEU')\n App.activeDocument().SymbolEU.Source = App.activeDocument().Symbol_EU\n App.activeDocument().SymbolEU.Direction = (0.0,0.0,1.0)\n App.activeDocument().SymbolEU.X = depx\n App.activeDocument().SymbolEU.Y = depy\n App.activeDocument().SymbolEU.Scale = 0.8\n App.activeDocument().Page.addObject(App.activeDocument().SymbolEU)\n App.ActiveDocument.recompute()\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").Visibility = False\n\ndef symbol_US(depx,depy): #symbol_US\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolUS\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolEU\")\n except:\n None\n App.activeDocument().addObject('Sketcher::SketchObject','Symbol_US')\n App.activeDocument().Symbol_US.Placement = App.Placement(App.Vector(0.0,0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(-7.5,0.0,0.0),App.Vector(20.0,0.0,0.0)))\n\n App.ActiveDocument.Symbol_US.Placement = App.Placement(App.Vector(0.0,0.0),App.Rotation(0.000000,0.000000,0.000000,1.000000))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(0.0,-7.5,0.0),App.Vector(0.0,7.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Circle(App.Vector(0.0,0.0,0.0),App.Vector(0,0,1),2.5))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Circle(App.Vector(0.0,0.0,0.0),App.Vector(0,0,1),5.0))\n\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,5.0,0.0),App.Vector(7.5,2.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(7.5,-2.5,0.0),App.Vector(7.5,2.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,-5.0,0.0),App.Vector(7.5,-2.5,0.0)))\n App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,-5.0,0.0),App.Vector(17.5,5.0,0.0)))\n Gui.getDocument(App.ActiveDocument.Name).resetEdit()\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").LineColor = (0.00,0.00,0.00)\n App.ActiveDocument.recompute()\n\n App.activeDocument().addObject('Drawing::FeatureViewPart','SymbolUS')\n App.activeDocument().SymbolUS.Source = App.activeDocument().Symbol_US\n App.activeDocument().SymbolUS.Direction = (0.0,0.0,1.0)\n App.activeDocument().SymbolUS.X = depx\n App.activeDocument().SymbolUS.Y = depy\n App.activeDocument().SymbolUS.Scale = 0.8\n App.activeDocument().Page.addObject(App.activeDocument().SymbolUS)\n App.ActiveDocument.recompute()\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").Visibility = False\n\ntry:\n DESIGNED_BY = App.activeDocument().getObject(\"Page\").EditableTexts[0] #lineEdit01 DESIGNED_BY\n CREATION_DATE = App.activeDocument().getObject(\"Page\").EditableTexts[1] #lineEdit02 CREATION_DATE date\n CREA_DATE = CREATION_DATE[0:10] # lineEdit02h date\n CREA_TIME = CREATION_DATE[13:21] # lineEdit02h heure\n CHECKED_BY = App.activeDocument().getObject(\"Page\").EditableTexts[2] # lineEdit03\n CHECK_DATE = App.activeDocument().getObject(\"Page\").EditableTexts[3] # lineEdit04 date\n CHEC_DATE = CHECK_DATE[0:10] # lineEdit04 date\n CHEC_TIME = CHECK_DATE[13:21] # lineEdit04h heure\n SIZE = \"A3\" # lineEdit05\n SCALE = App.activeDocument().getObject(\"Page\").EditableTexts[4] # lineEdit06\n WEIGHT = App.activeDocument().getObject(\"Page\").EditableTexts[5] # lineEdit07\n DRAWING_NUMBER = App.activeDocument().getObject(\"Page\").EditableTexts[6] # lineEdit08\n SHEET = App.activeDocument().getObject(\"Page\").EditableTexts[7] # lineEdit09\n TITLE = App.activeDocument().getObject(\"Page\").EditableTexts[8] # textEdit_01\n DESCRIPTION = App.activeDocument().getObject(\"Page\").EditableTexts[9] # textEdit_02\n\nexcept:\n errorDialog(\"erreur cartouche\")\ntry:\n try:\n lineEdit18 = App.activeDocument().getObject(\"Note_I\").Text[0] \n except:\n lineEdit18 = \"\"\n try:\n lineEdit17 = App.activeDocument().getObject(\"Note_H\").Text[0] \n except:\n lineEdit17 = \"\"\n try:\n lineEdit16 = App.activeDocument().getObject(\"Note_G\").Text[0] \n except:\n lineEdit16 = \"\"\n try:\n lineEdit15 = App.activeDocument().getObject(\"Note_F\").Text[0] \n except:\n lineEdit15 = \"\"\n try:\n lineEdit14 = App.activeDocument().getObject(\"Note_E\").Text[0] \n except:\n lineEdit14 = \"\"\n try:\n lineEdit13 = App.activeDocument().getObject(\"Note_D\").Text[0] \n except:\n lineEdit13 = \"\"\n try:\n lineEdit12 = App.activeDocument().getObject(\"Note_C\").Text[0] \n except:\n lineEdit12 = \"\"\n try:\n lineEdit11 = App.activeDocument().getObject(\"Note_B\").Text[0] \n except:\n lineEdit11 = \"\"\n try:\n lineEdit10 = App.activeDocument().getObject(\"Note_A\").Text[0] \n except:\n lineEdit10 = \"\"\n try:\n lineEdit20 = App.activeDocument().getObject(\"CopyRight\").Text[0] \n except:\n lineEdit20 = \"\"\nexcept:\n errorDialog(\"erreur note\")\n\nclass Ui_MainWindow(object):\n\n def __init__(self, MainWindow):\n self.window = MainWindow\n#___________________________________________________________________________________\n\n MainWindow.setObjectName(_fromUtf8(\"MainWindow\"))\n MainWindow.resize(810, 440)\n MainWindow.setMaximumSize(QtCore.QSize(810, 480))\n self.centralWidget = QtGui.QWidget(MainWindow)\n self.centralWidget.setObjectName(_fromUtf8(\"centralWidget\"))\n\n# self.pushButton01 = QtGui.QPushButton(self.centralWidget)\n# self.pushButton01.setGeometry(QtCore.QRect(115, 360, 93, 28))\n# self.pushButton01.setObjectName(_fromUtf8(\"pushButton01\"))\n# self.pushButton01.clicked.connect(self.on_pushButton01_clicked) #connection pushButton01\n\n self.pushButton02 = QtGui.QPushButton(self.centralWidget)\n self.pushButton02.setGeometry(QtCore.QRect(225, 360, 93, 28))\n self.pushButton02.setObjectName(_fromUtf8(\"pushButton02\"))\n self.pushButton02.clicked.connect(self.on_pushButton02_clicked) #connection pushButton02\n\n self.pushButton03 = QtGui.QPushButton(self.centralWidget)\n self.pushButton03.setGeometry(QtCore.QRect(335, 360, 93, 28))\n self.pushButton03.setObjectName(_fromUtf8(\"pushButton03\"))\n self.pushButton03.clicked.connect(self.on_pushButton03_clicked) #connection pushButton03\n\n self.pushButton04 = QtGui.QPushButton(self.centralWidget)\n self.pushButton04.setGeometry(QtCore.QRect(445, 360, 93, 28))\n self.pushButton04.setObjectName(_fromUtf8(\"pushButton04\"))\n self.pushButton04.clicked.connect(self.on_pushButton04_clicked) #connection pushButton04\n\n self.pushButton05 = QtGui.QPushButton(self.centralWidget)\n self.pushButton05.setGeometry(QtCore.QRect(555, 360, 93, 28))\n self.pushButton05.setObjectName(_fromUtf8(\"pushButton05\"))\n self.pushButton05.clicked.connect(self.on_pushButton05_clicked) #connection pushButton05\n\n self.pushButton06 = QtGui.QPushButton(self.centralWidget)\n self.pushButton06.setGeometry(QtCore.QRect(170, 56, 20, 20))\n self.pushButton06.setObjectName(_fromUtf8(\"pushButton06\"))\n self.pushButton06.clicked.connect(self.on_pushButton06_clicked) #connection pushButton06\n\n self.pushButton07 = QtGui.QPushButton(self.centralWidget)\n self.pushButton07.setGeometry(QtCore.QRect(190, 56, 20, 20))\n self.pushButton07.setObjectName(_fromUtf8(\"pushButton07\"))\n self.pushButton07.clicked.connect(self.on_pushButton07_clicked) #connection pushButton07\n\n self.pushButton08 = QtGui.QPushButton(self.centralWidget)\n self.pushButton08.setGeometry(QtCore.QRect(170, 136, 20, 20))\n self.pushButton08.setObjectName(_fromUtf8(\"pushButton08\"))\n self.pushButton08.clicked.connect(self.on_pushButton08_clicked) #connection pushButton08\n\n self.pushButton09 = QtGui.QPushButton(self.centralWidget)\n self.pushButton09.setGeometry(QtCore.QRect(190, 136, 20, 20))\n self.pushButton09.setObjectName(_fromUtf8(\"pushButton09\"))\n self.pushButton09.clicked.connect(self.on_pushButton09_clicked) #connection pushButton09\n\n self.pushButton10 = QtGui.QPushButton(self.centralWidget)\n self.pushButton10.setGeometry(QtCore.QRect(100, 220, 101, 20))\n self.pushButton10.setObjectName(_fromUtf8(\"pushButton10\"))\n self.pushButton10.clicked.connect(self.on_pushButton10_clicked) #connection pushButton10\n\n self.lineEdit_01 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_01.setGeometry(QtCore.QRect(20, 20, 181, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_01.setFont(font)\n self.lineEdit_01.setObjectName(_fromUtf8(\"lineEdit_01\"))\n self.lineEdit_01.setText(DESIGNED_BY)\n\n self.lineEdit_02 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02.setGeometry(QtCore.QRect(20, 60, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02.setFont(font)\n self.lineEdit_02.setObjectName(_fromUtf8(\"lineEdit_02\"))\n self.lineEdit_02.setText(CREA_DATE)\n\n self.lineEdit_02h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02h.setGeometry(QtCore.QRect(98, 60, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02h.setFont(font)\n self.lineEdit_02h.setObjectName(_fromUtf8(\"lineEdit_02h\"))\n self.lineEdit_02h.setText(CREA_TIME)\n\n self.lineEdit_03 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_03.setGeometry(QtCore.QRect(20, 100, 181, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_03.setFont(font)\n self.lineEdit_03.setObjectName(_fromUtf8(\"lineEdit_03\"))\n self.lineEdit_03.setText(CHECKED_BY)\n\n self.lineEdit_04 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04.setGeometry(QtCore.QRect(20, 140, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04.setFont(font)\n self.lineEdit_04.setObjectName(_fromUtf8(\"lineEdit_04\"))\n self.lineEdit_04.setText(CHEC_DATE)\n\n self.lineEdit_04h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04h.setGeometry(QtCore.QRect(98, 140, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04h.setFont(font)\n self.lineEdit_04h.setObjectName(_fromUtf8(\"lineEdit_04h\"))\n self.lineEdit_04h.setText(CHEC_TIME)\n\n self.lineEdit_05 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_05.setGeometry(QtCore.QRect(20, 180, 61, 61))\n font = QtGui.QFont()\n font.setPointSize(17)\n font.setBold(False)\n font.setWeight(50)\n self.lineEdit_05.setFont(font)\n self.lineEdit_05.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_05.setObjectName(_fromUtf8(\"lineEdit_05\"))\n self.lineEdit_05.setText(SIZE)\n\n self.lineEdit_06 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_06.setGeometry(QtCore.QRect(20, 280, 61, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_06.setFont(font)\n self.lineEdit_06.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_06.setObjectName(_fromUtf8(\"lineEdit_06\"))\n self.lineEdit_06.setText(SCALE)\n\n self.lineEdit_07 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_07.setGeometry(QtCore.QRect(100, 280, 101, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_07.setFont(font)\n self.lineEdit_07.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_07.setObjectName(_fromUtf8(\"lineEdit_07\"))\n self.lineEdit_07.setText(WEIGHT)\n\n self.lineEdit_08 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_08.setGeometry(QtCore.QRect(220, 280, 341, 41))\n self.lineEdit_08.setObjectName(_fromUtf8(\"lineEdit_08\"))\n self.lineEdit_08.setText(DRAWING_NUMBER)\n\n self.lineEdit_09 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_09.setGeometry(QtCore.QRect(570, 280, 81, 41))\n self.lineEdit_09.setObjectName(_fromUtf8(\"lineEdit_09\"))\n self.lineEdit_09.setText(SHEET)\n\n self.lineEdit_10 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_10.setGeometry(QtCore.QRect(690, 290, 101, 30))\n self.lineEdit_10.setObjectName(_fromUtf8(\"lineEdit_10\"))\n self.lineEdit_10.setText(lineEdit10)\n\n self.lineEdit_11 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_11.setGeometry(QtCore.QRect(690, 260, 101, 30))\n self.lineEdit_11.setObjectName(_fromUtf8(\"lineEdit_11\"))\n self.lineEdit_11.setText(lineEdit11)\n\n self.lineEdit_12 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_12.setGeometry(QtCore.QRect(690, 230, 101, 30))\n self.lineEdit_12.setObjectName(_fromUtf8(\"lineEdit_12\"))\n self.lineEdit_12.setText(lineEdit12)\n\n self.lineEdit_13 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_13.setGeometry(QtCore.QRect(690, 200, 101, 30))\n self.lineEdit_13.setObjectName(_fromUtf8(\"lineEdit_13\"))\n self.lineEdit_13.setText(lineEdit13)\n\n self.lineEdit_14 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_14.setGeometry(QtCore.QRect(690, 170, 101, 30))\n self.lineEdit_14.setObjectName(_fromUtf8(\"lineEdit_14\"))\n self.lineEdit_14.setText(lineEdit14)\n\n self.lineEdit_15 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_15.setGeometry(QtCore.QRect(690, 140, 101, 30))\n self.lineEdit_15.setObjectName(_fromUtf8(\"lineEdit_15\"))\n self.lineEdit_15.setText(lineEdit15)\n\n self.lineEdit_16 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_16.setGeometry(QtCore.QRect(690, 110, 101, 30))\n self.lineEdit_16.setObjectName(_fromUtf8(\"lineEdit_16\"))\n self.lineEdit_16.setText(lineEdit16)\n\n self.lineEdit_17 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_17.setGeometry(QtCore.QRect(690, 80, 101, 30))\n self.lineEdit_17.setObjectName(_fromUtf8(\"lineEdit_17\"))\n self.lineEdit_17.setText(lineEdit17)\n\n self.lineEdit_18 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_18.setGeometry(QtCore.QRect(690, 50, 101, 30))\n self.lineEdit_18.setObjectName(_fromUtf8(\"lineEdit_18\"))\n self.lineEdit_18.setText(lineEdit18)\n\n self.lineEdit_20 = QtGui.QLineEdit(self.centralWidget) # Copyright\n self.lineEdit_20.setGeometry(QtCore.QRect(20, 330, 771, 22))\n self.lineEdit_20.setObjectName(_fromUtf8(\"lineEdit_20\"))\n self.lineEdit_20.setText(lineEdit20)\n\n self.textEdit_01 = QtGui.QTextEdit(self.centralWidget)\n self.textEdit_01.setGeometry(QtCore.QRect(220, 20, 431,60 ))\n font = QtGui.QFont()\n font.setPointSize(15)\n font.setBold(True)\n font.setWeight(75)\n self.textEdit_01.setFont(font)\n self.textEdit_01.setObjectName(_fromUtf8(\"textEdit_01\"))\n self.textEdit_01.setText(TITLE)\n\n self.textEdit_02 = QtGui.QTextEdit(self.centralWidget)\n self.textEdit_02.setGeometry(QtCore.QRect(220, 90, 431, 60))\n self.textEdit_02.setObjectName(_fromUtf8(\"textEdit_02\"))\n self.textEdit_02.setText(DESCRIPTION)\n\n# self.graphicsView_01 = QtGui.QGraphicsView(self.centralWidget)\n# self.graphicsView_01.setGeometry(QtCore.QRect(100, 160, 101, 81))\n# brush = QtGui.QBrush(QtGui.QColor(0, 170, 255))\n# brush.setStyle(QtCore.Qt.NoBrush)\n# self.graphicsView_01.setBackgroundBrush(brush)\n# self.graphicsView_01.setObjectName(_fromUtf8(\"graphicsView_01\"))\n\n self.textEdit_03 = QtGui.QTextEdit(self.centralWidget)\n self.textEdit_03.setGeometry(QtCore.QRect(100, 160, 101, 55))\n self.textEdit_03.setAlignment(QtCore.Qt.AlignCenter)\n self.textEdit_03.setObjectName(_fromUtf8(\"textEdit_03\"))\n self.textEdit_03.setText(\"Select your Symbol\")\n\n self.graphicsView_02 = QtGui.QGraphicsView(self.centralWidget)\n self.graphicsView_02.setGeometry(QtCore.QRect(220, 160, 431, 81))#570, 160, 81, 81\n self.graphicsView_02.setObjectName(_fromUtf8(\"graphicsView_02\"))\n\n self.label_01 = QtGui.QLabel(self.centralWidget)\n self.label_01.setGeometry(QtCore.QRect(20, 0, 91, 16))\n self.label_01.setObjectName(_fromUtf8(\"label_01\"))\n\n self.label_02 = QtGui.QLabel(self.centralWidget)\n self.label_02.setGeometry(QtCore.QRect(20, 40, 53, 16))\n self.label_02.setObjectName(_fromUtf8(\"label_02\"))\n\n self.label_03 = QtGui.QLabel(self.centralWidget)\n self.label_03.setGeometry(QtCore.QRect(20, 80, 101, 16))\n self.label_03.setObjectName(_fromUtf8(\"label_03\"))\n\n self.label_04 = QtGui.QLabel(self.centralWidget)\n self.label_04.setGeometry(QtCore.QRect(20, 120, 91, 16))\n self.label_04.setObjectName(_fromUtf8(\"label_04\"))\n\n self.label_05 = QtGui.QLabel(self.centralWidget)\n self.label_05.setGeometry(QtCore.QRect(20, 160, 53, 16))\n self.label_05.setObjectName(_fromUtf8(\"label_05\"))\n\n self.label_06 = QtGui.QLabel(self.centralWidget)\n self.label_06.setGeometry(QtCore.QRect(20, 260, 53, 16))\n self.label_06.setObjectName(_fromUtf8(\"label_06\"))\n\n self.label_07 = QtGui.QLabel(self.centralWidget)\n self.label_07.setGeometry(QtCore.QRect(100, 260, 101, 16))\n self.label_07.setObjectName(_fromUtf8(\"label_07\"))\n\n self.label_08 = QtGui.QLabel(self.centralWidget)\n self.label_08.setGeometry(QtCore.QRect(220, 260, 121, 16))\n self.label_08.setObjectName(_fromUtf8(\"label_08\"))\n\n self.label_09 = QtGui.QLabel(self.centralWidget)\n self.label_09.setGeometry(QtCore.QRect(570, 260, 53, 16))\n self.label_09.setObjectName(_fromUtf8(\"label_09\"))\n\n self.label_10 = QtGui.QLabel(self.centralWidget)\n self.label_10.setGeometry(QtCore.QRect(670, 290, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_10.setFont(font)\n self.label_10.setObjectName(_fromUtf8(\"label_10\"))\n\n self.label_11 = QtGui.QLabel(self.centralWidget)\n self.label_11.setGeometry(QtCore.QRect(670, 260, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_11.setFont(font)\n self.label_11.setObjectName(_fromUtf8(\"label_11\"))\n\n self.label_12 = QtGui.QLabel(self.centralWidget)\n self.label_12.setGeometry(QtCore.QRect(670, 230, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_12.setFont(font)\n self.label_12.setObjectName(_fromUtf8(\"label_12\"))\n\n self.label_13 = QtGui.QLabel(self.centralWidget)\n self.label_13.setGeometry(QtCore.QRect(670, 200, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_13.setFont(font)\n self.label_13.setObjectName(_fromUtf8(\"label_13\"))\n\n self.label_14 = QtGui.QLabel(self.centralWidget)\n self.label_14.setGeometry(QtCore.QRect(670, 170, 15, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_14.setFont(font)\n self.label_14.setObjectName(_fromUtf8(\"label_14\"))\n\n self.label_15 = QtGui.QLabel(self.centralWidget)\n self.label_15.setGeometry(QtCore.QRect(670, 140, 14, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_15.setFont(font)\n self.label_15.setObjectName(_fromUtf8(\"label_15\"))\n\n self.label_16 = QtGui.QLabel(self.centralWidget)\n self.label_16.setGeometry(QtCore.QRect(670, 110, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_16.setFont(font)\n self.label_16.setObjectName(_fromUtf8(\"label_16\"))\n\n self.label_17 = QtGui.QLabel(self.centralWidget)\n self.label_17.setGeometry(QtCore.QRect(670, 80, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_17.setFont(font)\n self.label_17.setObjectName(_fromUtf8(\"label_17\"))\n\n self.label_18 = QtGui.QLabel(self.centralWidget)\n self.label_18.setGeometry(QtCore.QRect(670, 50, 10, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_18.setFont(font)\n self.label_18.setObjectName(_fromUtf8(\"label_18\"))\n\n self.label_19 = QtGui.QLabel(self.centralWidget)\n self.label_19.setGeometry(QtCore.QRect(720, 15, 100, 33))\n self.label_19.setObjectName(_fromUtf8(\"label_19\"))\n\n MainWindow.setCentralWidget(self.centralWidget)\n self.menuBar = QtGui.QMenuBar(MainWindow)\n self.menuBar.setGeometry(QtCore.QRect(0, 0, 810, 26))\n self.menuBar.setObjectName(_fromUtf8(\"menuBar\"))\n MainWindow.setMenuBar(self.menuBar)\n self.statusBar = QtGui.QStatusBar(MainWindow)\n self.statusBar.setObjectName(_fromUtf8(\"statusBar\"))\n MainWindow.setStatusBar(self.statusBar)\n\n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n\n def retranslateUi(self, MainWindow):\n try:\n MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4 cette fonction met la fenêtre en avant\n except Exception:\n MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenêtre en avant\n\n MainWindow.setWindowTitle(_translate(\"MainWindow\", \"Cartouche\", None))\n# self.pushButton01.setText(_translate(\"MainWindow\", \"Position\", None))\n self.pushButton02.setText(_translate(\"MainWindow\", \"Quitter\", None))\n self.pushButton03.setText(_translate(\"MainWindow\", \"Memo\", None))\n self.pushButton04.setText(_translate(\"MainWindow\", \"Nettoyer\", None))\n self.pushButton05.setText(_translate(\"MainWindow\", \"Appliquer\", None))\n self.pushButton06.setText(_translate(\"MainWindow\", \"D.\", None))\n self.pushButton07.setText(_translate(\"MainWindow\", \"H.\", None))\n self.pushButton08.setText(_translate(\"MainWindow\", \"D.\", None))\n self.pushButton09.setText(_translate(\"MainWindow\", \"H.\", None))\n self.pushButton10.setText(_translate(\"MainWindow\", \"Symbole EU\", None))\n\n\n self.label_01.setText(_translate(\"MainWindow\", \"Designed by :\", None))\n self.label_02.setText(_translate(\"MainWindow\", \"Date :\", None))\n self.label_03.setText(_translate(\"MainWindow\", \"Checked by :\", None))\n self.label_04.setText(_translate(\"MainWindow\", \"Date :\", None))\n self.label_05.setText(_translate(\"MainWindow\", \"Size :\", None))\n self.label_06.setText(_translate(\"MainWindow\", \"Scale :\", None))\n self.label_07.setText(_translate(\"MainWindow\", \"Weight (Kg) :\", None))\n self.label_08.setText(_translate(\"MainWindow\", \"Drawing number :\", None))\n self.label_09.setText(_translate(\"MainWindow\", \"Sheet :\", None))\n self.label_10.setText(_translate(\"MainWindow\", \"A\", None))\n self.label_11.setText(_translate(\"MainWindow\", \"B\", None))\n self.label_12.setText(_translate(\"MainWindow\", \"C\", None))\n self.label_13.setText(_translate(\"MainWindow\", \"D\", None))\n self.label_14.setText(_translate(\"MainWindow\", \"E\", None))\n self.label_15.setText(_translate(\"MainWindow\", \"F\", None))\n self.label_16.setText(_translate(\"MainWindow\", \"G\", None))\n self.label_17.setText(_translate(\"MainWindow\", \"H\", None))\n self.label_18.setText(_translate(\"MainWindow\", \"I\", None))\n self.label_19.setText(_translate(\"MainWindow\", \"Notes\", None))\n#______________________________________________________________________________________\n # Boutons\n def on_pushButton10_clicked(self): # Bouton /Symbole\n if self.textEdit_03.toPlainText()==\"Symbole US\":\n self.pushButton10.setText(_translate(\"MainWindow\", \"Symbole US\", None))\n self.textEdit_03.setText(\"Symbole EU\")\n symbol_EU(247.5,263.5) #(247.5,263.5)\n else:\n self.pushButton10.setText(_translate(\"MainWindow\", \"Symbole EU\", None))\n self.textEdit_03.setText(\"Symbole US\")\n symbol_US(247.5,263.5) #(247.5,263.5)\n def on_pushButton09_clicked(self): # Bouton /heure document\n self.lineEdit_04h.setText(str(heure()))\n def on_pushButton08_clicked(self): # Bouton date/ document\n if self.textEdit_03.toPlainText()==\"Symbole US\":\n self.lineEdit_04.setText(str(dateUs()))\n else:\n self.lineEdit_04.setText(str(dateEu()))\n def on_pushButton07_clicked(self): # Bouton /heure checked\n self.lineEdit_02h.setText(str(heure()))\n def on_pushButton06_clicked(self): # Bouton date/ checked\n if self.textEdit_03.toPlainText()==\"Symbole US\":\n self.lineEdit_02.setText(str(dateUs()))\n else:\n self.lineEdit_02.setText(str(dateEu()))\n def on_pushButton05_clicked(self): # Bouton Appliquer\n DESIGNED_BY = self.lineEdit_01.text() \n CREATION_DATE = self.lineEdit_02.text()+\" - \"+self.lineEdit_02h.text()\n CHECKED_BY = self.lineEdit_03.text()\n CHECK_DATE = self.lineEdit_04.text()+\" - \"+self.lineEdit_04h.text()\n SIZE = \"A3\" # self.lineEdit_05.text()\n SCALE = self.lineEdit_06.text()\n WEIGHT = self.lineEdit_07.text()\n DRAWING_NUMBER = self.lineEdit_08.text()\n SHEET = self.lineEdit_09.text()\n TITLE = self.textEdit_01.toPlainText()\n DESCRIPTION = self.textEdit_02.toPlainText()\n SYMBOL = self.textEdit_03.toPlainText()\n try:\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts = [unicode(DESIGNED_BY, 'utf-8'), unicode(CREATION_DATE, 'utf-8'), unicode(CHECKED_BY, 'utf-8'), unicode(CHECK_DATE, 'utf-8'), unicode(SCALE, 'utf-8'), unicode(WEIGHT, 'utf-8'), unicode(DRAWING_NUMBER, 'utf-8'), unicode(SHEET, 'utf-8'), unicode(TITLE, 'utf-8'), unicode(DESCRIPTION, 'utf-8'),]\n except Exception:\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts = [DESIGNED_BY.encode('utf-8'), CREATION_DATE.encode('utf-8'), CHECKED_BY.encode('utf-8'), CHECK_DATE.encode('utf-8'), SCALE.encode('utf-8'), WEIGHT.encode('utf-8'), DRAWING_NUMBER.encode('utf-8'), SHEET.encode('utf-8'), TITLE.encode('utf-8'), DESCRIPTION.encode('utf-8'),]\n\n #print App.ActiveDocument.Name\n try:\n App.activeDocument().removeObject('Note_I')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_H')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_G')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_F')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_E')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_D')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_C')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_B')\n except:\n None\n try:\n App.activeDocument().removeObject('Note_A')\n except:\n None\n try:\n App.activeDocument().removeObject('CopyRight')\n except:\n None\n if self.lineEdit_18.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_I')\n App.activeDocument().Note_I.X = 391.0\n App.activeDocument().Note_I.Y = 232\n App.activeDocument().Note_I.Scale = 3.0\n App.activeDocument().Note_I.Text = str(self.lineEdit_18.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_I)\n if self.lineEdit_17.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_H')\n App.activeDocument().Note_H.X = 391.0\n App.activeDocument().Note_H.Y = 238.8\n App.activeDocument().Note_H.Scale = 3.0\n App.activeDocument().Note_H.Text = str(self.lineEdit_17.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_H)\n if self.lineEdit_16.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_G')\n App.activeDocument().Note_G.X = 391.0\n App.activeDocument().Note_G.Y = 245.4\n App.activeDocument().Note_G.Scale = 3.0\n App.activeDocument().Note_G.Text = str(self.lineEdit_16.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_G)\n if self.lineEdit_15.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_F')\n App.activeDocument().Note_F.X = 391.0\n App.activeDocument().Note_F.Y = 252\n App.activeDocument().Note_F.Scale = 3.0\n App.activeDocument().Note_F.Text = str(self.lineEdit_15.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_F)\n if self.lineEdit_14.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_E')\n App.activeDocument().Note_E.X = 391.0\n App.activeDocument().Note_E.Y = 258.6\n App.activeDocument().Note_E.Scale = 3.0\n App.activeDocument().Note_E.Text = str(self.lineEdit_14.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_E)\n if self.lineEdit_13.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_D')\n App.activeDocument().Note_D.X = 391.0\n App.activeDocument().Note_D.Y = 265.2\n App.activeDocument().Note_D.Scale = 3.0\n App.activeDocument().Note_D.Text = str(self.lineEdit_13.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_D)\n if self.lineEdit_12.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_C')\n App.activeDocument().Note_C.X = 391.0\n App.activeDocument().Note_C.Y = 271.8\n App.activeDocument().Note_C.Scale = 3.0\n App.activeDocument().Note_C.Text = str(self.lineEdit_12.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_C)\n if self.lineEdit_11.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_B')\n App.activeDocument().Note_B.X = 391.0\n App.activeDocument().Note_B.Y = 278.4\n App.activeDocument().Note_B.Scale = 3.0\n App.activeDocument().Note_B.Text = str(self.lineEdit_11.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_B)\n if self.lineEdit_10.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','Note_A')\n App.activeDocument().Note_A.X = 391.0\n App.activeDocument().Note_A.Y = 285.0\n App.activeDocument().Note_A.Scale = 3.0\n App.activeDocument().Note_A.Text = str(self.lineEdit_10.text())\n App.activeDocument().Page.addObject(App.activeDocument().Note_A)\n if self.lineEdit_20.text() != \"\":\n App.activeDocument().addObject('Drawing::FeatureViewAnnotation','CopyRight')\n App.activeDocument().CopyRight.X = 221\n App.activeDocument().CopyRight.Y = 286\n App.activeDocument().CopyRight.Scale = 3.0\n App.activeDocument().CopyRight.Text = str(self.lineEdit_20.text())\n App.activeDocument().Page.addObject(App.activeDocument().CopyRight)\n\n App.ActiveDocument.recompute()\n\n def on_pushButton04_clicked(self): # Bouton nettoyer\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolUS\")\n except:\n None\n try:\n App.getDocument(App.ActiveDocument.Name).removeObject(\"SymbolEU\")\n except:\n None\n DESIGNED_BY = \"\" ;self.lineEdit_01.setText(\"\")\n CREATION_DATE = \"\" ;self.lineEdit_02.setText(\"\")\n self.lineEdit_02h.setText(\"\")\n CHECKED_BY = \"\" ;self.lineEdit_03.setText(\"\")\n CHECK_DATE = \"\" ;self.lineEdit_04.setText(\"\")\n self.lineEdit_04h.setText(\"\")\n SIZE = \"A3\" ;self.lineEdit_05.setText(\"A3\")\n SCALE = \"\" ;self.lineEdit_06.setText(\"\")\n WEIGHT = \"\" ;self.lineEdit_07.setText(\"\")\n DRAWING_NUMBER = \"\" ;self.lineEdit_08.setText(\"\")\n SHEET = \"\" ;self.lineEdit_09.setText(\"\")\n TITLE = \"\" ;self.textEdit_01.setText(\"\")\n DESCRIPTION = \"\" ;self.textEdit_02.setText(\"\")\n \n self.lineEdit_10.setText(\"\")\n self.lineEdit_11.setText(\"\")\n self.lineEdit_12.setText(\"\")\n self.lineEdit_13.setText(\"\")\n self.lineEdit_14.setText(\"\")\n self.lineEdit_15.setText(\"\")\n self.lineEdit_16.setText(\"\")\n self.lineEdit_17.setText(\"\")\n self.lineEdit_18.setText(\"\")\n self.lineEdit_20.setText(\"\")\n\n def on_pushButton03_clicked(self): # Bouton Memo\n self.lineEdit_01.setText(DESIGNED_BY)\n self.lineEdit_02.setText(CREA_DATE)\n self.lineEdit_02h.setText(CREA_TIME)\n self.lineEdit_03.setText(CHECKED_BY)\n self.lineEdit_04.setText(CHEC_DATE)\n self.lineEdit_04h.setText(CHEC_TIME)\n self.lineEdit_05.setText(SIZE)\n self.lineEdit_06.setText(SCALE)\n self.lineEdit_07.setText(WEIGHT)\n self.lineEdit_08.setText(DRAWING_NUMBER)\n self.lineEdit_09.setText(SHEET)\n self.textEdit_01.setText(TITLE)\n self.textEdit_02.setText(DESCRIPTION)\n\n self.lineEdit_18.setText(lineEdit18)\n self.lineEdit_17.setText(lineEdit17)\n self.lineEdit_16.setText(lineEdit16)\n self.lineEdit_15.setText(lineEdit15)\n self.lineEdit_14.setText(lineEdit14)\n self.lineEdit_13.setText(lineEdit13)\n self.lineEdit_12.setText(lineEdit12)\n self.lineEdit_11.setText(lineEdit11)\n self.lineEdit_10.setText(lineEdit10)\n self.lineEdit_20.setText(lineEdit20)\n\n def on_pushButton02_clicked(self): # Bouton Quitter\n App.Console.PrintMessage(\"Terminé\\r\\n\")\n self.window.hide()\n# def on_pushButton01_clicked(self): # Bouton appel de Position\n# MainWindow.resize(210, 480)\n# executer()\n# MainWindow.resize(810, 480)\n#______________________________________________________________________________________\n\nMainWindow = QtGui.QMainWindow()\nui = Ui_MainWindow(MainWindow)\nMainWindow.show()\n\n}}\n\n## Autre\n\nLes champs n\\'ont pas de limite de longueur, vérifiez votre cartouche.\n\nCe programme crée sur votre projet un dessin représentant le symbole régional de projection, n\\'y touchez pas il est enregistré sous forme cachée donc invisible.\n\nSi vous voulez qu\\'il soit effacé dé-commentez ces lignes commentées et vice versa\n\n\n```python\n\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").Visibility = False\net\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").Visibility = False\n```\n\n(j\\'avais quelque fois une erreur à l\\'exécution quand le symbole était effacé)\n\nCe module travaille avec la feuille de mise en plan incluse dans FreeCAD cette feuille s\\'appelle **Page**, ne pas modifier le nom de cette feuille !\n\n## Révision\n\nver 0.3 le 02/07/2014 conversion pour utilisation avec **PyQt4** et **PySide**\n\n\n
\n\n\n
\n\n\n
\n\n# Macro CartoucheFC Full \n\n\n
\n\n\n{{Macro\n|Name=Macro_CartoucheFC_Full\n|Icon=Macro_CartoucheFC_Full.png\n|Description=This macro is a complete application, it allows to fill the cartridge of the drawing sheet with full editabletext (For [Drawing Workbench](Drawing_Workbench.md)).\n|Author=Mario52\n|Version=00.10\n|Date=2017-02-15\n|FCVersion=All version using Drawing Workbench\n|Download=[https://www.freecadweb.org/wiki/images/6/68/Macro_CartoucheFC_Full.png ToolBar Icon]\n}}\n\n## Description \n\nThis macro is a complete application, it allows to fill simply all the fields of the cartridge\n\nChoice in the page Misc_templates_Full\n\nHere the order of filling in the line FreeCAD texteditable. The date and time fields are separated by a **\\\"space negative space\\\" \\\" - \\\"** and constitute a single line textedit.\n\n\"CartoucheFC_Full\"\n\n## Usage \n\n**PS: Some characters such as & \\$ are not accepted (and possibly other special characters).**\n\nIf you have any questions or want to add a function, you can address you on the french forum [Remplir cartouche](http://forum.freecadweb.org/viewtopic.php?f=12&t=2049)\n\n- The window remains above other Windows, thereby controlling the cartridge without leaving the program.\n- Copy the code into a file named **Macro_CartoucheFC_Full.FCMacro** and place it in your usual macros directory.\n- After you have created your drawing sheet using the Drawing of FreeCAD module, run the macro **Macro_CartoucheFC_Full**.\n- At the opening, the program will register in memory all data already present in the cartridge of the sheet (if they are filled), all these data will be automatically returned to using the button ** Memo** and kept in memory until the closure of the programme.\n- First select your page to work\n- Date button ** D.** and time ** H.** displayed the date and time of the system.\n\n -The date format depends on the selected symbol **EU** or **US** which determines the regional format. Change does not happen automatically (for the case or you have entered a date manually) you must again click buttons dates if you change the symbol (check before printing).\n\n- Choice your format page\n- Button **Symbole EU** or US change the meaning of the symbol of projection \\\"Select your Symbol\\\" is displayed by default, and then the active symbol appears. Click on the button and check the leaf symbol, click a second time to modify the symbol.\n\n -The choice of this symbol, affects the date format **EU = dd/MM/yyyy** and **US = MM/dd/yyyy**.\n\n -**Attention**: this command does not pass through the button **Apply** and immediately changes the symbol to each presses on the key, always check if you have the appropriate symbol on your worksheet.\n\n- Button **Clean** Clears all fields in the cartridge. You can revert to the original data using the button **Memo**.\n- Button **Apply** saves all fields of the cartridge in the sheet. You can revert to the original data using the button **Memo** (except for the regional symbol that works in independent and is effective immediately).\n\n## Code \n\nThe icon for you toolBar ![](images/Macro_CartoucheFC_Full.png )\n\n**Macro_CartoucheFC_Full.FCMacro**\n\n\n{{MacroCode|code=\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\"\"\"\n***************************************************************************\n* Copyright (c) 2014 2016 2017 *\n* *\n* This file is a supplement to the FreeCAD CAx development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n* *\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n***************************************************************************\n* WARNING! All changes in this file will be lost and * \n* may cause malfunction of the program *\n***************************************************************************\n\"\"\"\n#OS: Windows 10\n#Word size of OS: 64-bit\n#Word size of FreeCAD: 64-bit\n#Version: 0.16.6706 (Git)\n#Build type: Release\n#Branch: releases/FreeCAD-0-16\n#Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0\n#Python version: 2.7.8\n#Qt version: 4.8.7\n#Coin version: 4.0.0a\n#OCC version: 6.8.0.oce-0.17\n\n__title__ = \"Macro_CartoucheFC_Full\"\n__author__ = \"Mario52\"\n__url__ = \"http://www.freecadweb.org/index-fr.html\"\n__Wiki__ = \"http://www.freecadweb.org/wiki/Macro_CartoucheFC_Full\"\n__version__ = \"00.10\"\n__date__ = \"15/02/2017\"\n\n__Requires__ = (\"all version and freecad \" +\n\" DESIGNED_BY, CREATION_DATE, CHECKED_BY, CHECK_DATE, SIZE, SCALE, WEIGHT, DRAWING_NUMBER, SHEET, \" +\n\" TITLE, DESCRIPTION, COMPANY, COPYRIGHT, Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I\" )\n__Template__ = \" A3_Landscape_xx_FULL.svg, A3_Portrait_xx_FULL, A4_Landscape_xx_FULL.svg, A4_Portrait_xx_FULL\"\n__Template_Link__ = \"http://www.freecadweb.org/wiki/index.php?title=Misc_templates_Full\"\n\nimport PySide\nfrom PySide import QtCore, QtGui\n\nimport Draft, Part, FreeCAD, math, PartGui, FreeCADGui\nfrom math import sqrt, pi, sin, cos, asin\nfrom FreeCAD import Base\n\ndef utf8(unio):\n return unicode(unio).encode('UTF8')\n\nglobal path\n#path = FreeCAD.ConfigGet(\"AppHomePath\")\npath = FreeCAD.ConfigGet(\"UserAppData\")\n\nglobal PageActive ; PageActive = \"Select your page\" # essais \n#global PageActive ; PageActive = \"Page\" # page active\nglobal DESIGNED_BY ; DESIGNED_BY = \"\" # lineEdit01 DESIGNED_BY\nglobal MDESIGNED_BY ; MDESIGNED_BY = \"\" # \nglobal CREATION_DATE ; CREATION_DATE = \"\" # lineEdit02 CREATION_DATE date\nglobal MCREATION_DATE ; MCREATION_DATE = \"\" # \nglobal CREA_DATE ; CREA_DATE = \"\" # lineEdit02h date\nglobal MCREA_DATE ; MCREA_DATE = \"\" # \nglobal CREA_TIME ; CREA_TIME = \"\" # lineEdit02h heure\nglobal MCREA_TIME ; MCREA_TIME = \"\" # \nglobal CHECKED_BY ; CHECKED_BY = \"\" # lineEdit03\nglobal MCHECKED_BY ; MCHECKED_BY = \"\" # \nglobal CHECK_DATE ; CHECK_DATE = \"\" # lineEdit04 date\nglobal MCHECK_DATE ; MCHECK_DATE = \"\" # \nglobal CHEC_DATE ; CHEC_DATE = \"\" # lineEdit04 date\nglobal MCHEC_DATE ; MCHEC_DATE = \"\" # \nglobal CHEC_TIME ; CHEC_TIME = \"\" # lineEdit04h heure\nglobal MCHEC_TIME ; MCHEC_TIME = \"\" # \nglobal SIZE ; SIZE = \"\" # lineEdit05\nglobal MSIZE ; MSIZE = \"\" # \nglobal SCALE ; SCALE = \"\" # lineEdit06\nglobal MSCALE ; MSCALE = \"\" # \nglobal WEIGHT ; WEIGHT = \"\" # lineEdit07\nglobal MWEIGHT ; MWEIGHT = \"\" # \nglobal DRAWING_NUMBER ; DRAWING_NUMBER = \"\" # lineEdit08\nglobal MDRAWING_NUMBER ; MDRAWING_NUMBER = \"\" # \nglobal SHEET ; SHEET = \"\" # lineEdit09\nglobal MSHEET ; MSHEET = \"\" # \nglobal TITLE ; TITLE = \"\" # textEdit_01\nglobal MTITLE ; MTITLE = \"\" # \nglobal DESCRIPTION ; DESCRIPTION = \"\" # textEdit_02\nglobal MDESCRIPTION ; MDESCRIPTION = \"\" # \nglobal COMPANY ; COMPANY = \"\" # textEdit_02b\nglobal MCOMPANY ; MCOMPANY = \"\" # \nglobal COPYRIGHT ; COPYRIGHT = \"\" # lineEdit_20\nglobal MCOPYRIGHT ; MCOPYRIGHT = \"\" # \nglobal Note_A ; Note_A = \"\" # lineEdit_10\nglobal MNote_A ; MNote_A = \"\" # \nglobal Note_B ; Note_B = \"\" # lineEdit_11\nglobal MNote_B ; MNote_B = \"\" # \nglobal Note_C ; Note_C = \"\" # lineEdit_12\nglobal MNote_C ; MNote_C = \"\" # \nglobal Note_D ; Note_D = \"\" # lineEdit_13\nglobal MNote_D ; MNote_D = \"\" # \nglobal Note_E ; Note_E = \"\" # lineEdit_14\nglobal MNote_E ; MNote_E = \"\" # \nglobal Note_F ; Note_F = \"\" # lineEdit_15\nglobal MNote_F ; MNote_F = \"\" # \nglobal Note_G ; Note_G = \"\" # lineEdit_16\nglobal MNote_G ; MNote_G = \"\" # \nglobal Note_H ; Note_H = \"\" # lineEdit_17\nglobal MNote_H ; MNote_H = \"\" # \nglobal Note_I ; Note_I = \"\" # lineEdit_18\nglobal MNote_I ; MNote_I = \"\" # \n\nglobal SymbolSwitch ; SymbolSwitch = 1 # 0=US 1=EU\nglobal ui ; ui = \"\"\n\ndef heure():\n return QtCore.QTime().currentTime().toString('hh:mm:ss')\ndef dateEu():\n return QtCore.QDate().currentDate().toString('dd/MM/yyyy') # forme euro\ndef dateUK():\n return QtCore.QDate().currentDate().toString('yyyy/MM/dd') # forme UK\ndef dateUs():\n return QtCore.QDate().currentDate().toString('MM/dd/yyyy') # forme US\ndef dateComp():\n return QtCore.QDate().currentDate().toString('dddd d MMMM yyyy') # Retourne \"dimanche 20 Juillet 77\"\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\ndef errorDialog(msg):\n diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u\"Error Message\",msg)\n diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenetre en avant\n diag.exec_()\n\ndef symbol_EU(depx, depy, scale): #symbol_EU =O\n global PageActive\n global ui\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0]\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0]if len(str(page)) != 2:\n comP = []\n nameL = []\n if \"Page\" in (page.Name):\n for ii in (page.Group):\n if ((ii.Label) == \"Symbol_EU\") or ((ii.Label) == \"Symbol_US\") :\n App.activeDocument().removeObject(ii.Name)\n\n points=[FreeCAD.Vector(-7.5,0.0,0.0),FreeCAD.Vector(20.0,0.0,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(12.5,7.5,0.0),FreeCAD.Vector(12.5,-7.5,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(-5,2.5,0.0),FreeCAD.Vector(5.0,5.0,0.0),FreeCAD.Vector(5.0,-5.0,0.0),FreeCAD.Vector(-5.0,-2.5,0.0)]\n i = Draft.makeWire(points,closed=True,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n pl=FreeCAD.Placement()\n pl.Rotation.Q=(0.0,-0.0,-0.0,1.0)\n pl.Base=FreeCAD.Vector(12.5,-0.0,0.0)\n i = Draft.makeCircle(radius=2.5,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n i = Draft.makeCircle(radius=5.0,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name) comp = Part.makeCompound(comP)\n Part.show(comp)\n App.ActiveDocument.ActiveObject.Label = \"Symbol_EU\" obj = FreeCAD.ActiveDocument.ActiveObject\n obj.ViewObject.LineColor = (0.0,0.0,0.0)\n obj.ViewObject.Visibility = False\n \n obj2 = Draft.makeDrawingView(obj, page) \n obj2.X = depx\n obj2.Y = depy\n obj2.Scale = scale #0.8 # A3\n obj2.Label = \"Symbol_EU\" for i in nameL: App.activeDocument().removeObject(i) App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj)\n App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj2)\n App.ActiveDocument.recompute()\n else:\n ui.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n FreeCAD.Console.PrintError(\"Error selected page [ \" + PageActive + \" ]\" + \"\\n\")\n\ndef symbol_US(depx, depy, scale): #symbol_US O=\n global PageActive\n global ui\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0]\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0]\n\n if len(str(page)) != 2:\n comP = []\n nameL = [] if \"Page\" in (page.Name):\n for ii in (page.Group):\n if ((ii.Label) == \"Symbol_EU\") or ((ii.Label) == \"Symbol_US\") :\n App.activeDocument().removeObject(ii.Name)\n\n points=[FreeCAD.Vector(-7.5,0.0,0.0),FreeCAD.Vector(20.0,0.0,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(0.0,7.5,0.0),FreeCAD.Vector(0.0,-7.5,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(7.5,2.5,0.0),FreeCAD.Vector(17.5,5.0,0.0),FreeCAD.Vector(17.5,-5.0,0.0),FreeCAD.Vector(7.5,-2.5,0.0)]\n i = Draft.makeWire(points,closed=True,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n pl=FreeCAD.Placement()\n pl.Rotation.Q=(0.0,-0.0,-0.0,1.0)\n pl.Base=FreeCAD.Vector(0.0,-0.0,0.0)\n i = Draft.makeCircle(radius=2.5,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n i = Draft.makeCircle(radius=5.0,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name) comp = Part.makeCompound(comP)\n Part.show(comp)\n App.ActiveDocument.ActiveObject.Label = \"Symbol_US\" obj = FreeCAD.ActiveDocument.ActiveObject\n obj.ViewObject.LineColor = (0.0,0.0,0.0)\n obj.ViewObject.Visibility = False obj2 = Draft.makeDrawingView(obj, page) \n obj2.X = depx\n obj2.Y = depy\n obj2.Scale = scale #0.8 # A3\n obj2.Label = \"Symbol_US\" for i in nameL: App.activeDocument().removeObject(i) App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj)\n App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj2)\n App.ActiveDocument.recompute()\n else:\n ui.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n FreeCAD.Console.PrintError(\"Error selected page [ \" + PageActive + \" ]\" + \"\\n\")\n\ndef memoEntree():\n global MDESIGNED_BY, MCREATION_DATE, MCREA_DATE , MCREA_TIME, MCHECKED_BY, MCHECK_DATE\n global MCHEC_DATE , MCHEC_TIME , MSIZE , MSCALE , MWEIGHT ,MDRAWING_NUMBER\n global MSHEET , MTITLE , MDESCRIPTION, MCOMPANY , MCOPYRIGHT\n global MNote_A, MNote_B, MNote_C, MNote_D, MNote_E, MNote_F, MNote_G, MNote_H, MNote_I\n global PageActive\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].Name\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0]\n\n try:\n MDESIGNED_BY = App.activeDocument().getObject(page).EditableTexts[0] # lineEdit01 DESIGNED_BY\n MCREATION_DATE = App.activeDocument().getObject(page).EditableTexts[1] # lineEdit02 CREATION_DATE date\n\n MCREA_DATE = MCREA_TIME = MCHEC_DATE = MCHEC_TIME = \"\"\n\n try:\n MCREA_DATE = MCREATION_DATE.split(\" - \")[0] # lineEdit02h date\n except:\n MCREA_DATE = MCREATION_DATE\n try:\n MCREA_TIME = MCREATION_DATE.split(\" - \")[1] # lineEdit02h heure\n except: None \n\n MCHECKED_BY = App.activeDocument().getObject(page).EditableTexts[2] # lineEdit03\n MCHECK_DATE = App.activeDocument().getObject(page).EditableTexts[3] # lineEdit04 date\n\n try:\n MCHEC_DATE = MCHECK_DATE.split(\" - \")[0] # lineEdit04 date\n except:\n MCHEC_DATE = MCHECK_DATE\n try:\n MCHEC_TIME = MCHECK_DATE.split(\" - \")[1] # lineEdit04h heure\n except: None \n\n MSIZE = App.activeDocument().getObject(page).EditableTexts[4] # lineEdit05\n MSCALE = App.activeDocument().getObject(page).EditableTexts[5] # lineEdit06\n MWEIGHT = App.activeDocument().getObject(page).EditableTexts[6] # lineEdit07\n MDRAWING_NUMBER = App.activeDocument().getObject(page).EditableTexts[7] # lineEdit08\n MSHEET = App.activeDocument().getObject(page).EditableTexts[8] # lineEdit09\n MTITLE = App.activeDocument().getObject(page).EditableTexts[9] # textEdit_01\n\n try:\n MDESCRIPTION = App.activeDocument().getObject(page).EditableTexts[10] # textEdit_02\n MCOMPANY = App.activeDocument().getObject(page).EditableTexts[11] # textEdit_02b\n MCOPYRIGHT = App.activeDocument().getObject(page).EditableTexts[12] # lineEdit_20\n MNote_A = App.activeDocument().getObject(page).EditableTexts[13] # lineEdit_10\n MNote_B = App.activeDocument().getObject(page).EditableTexts[14] # lineEdit_11\n MNote_C = App.activeDocument().getObject(page).EditableTexts[15] # lineEdit_12\n MNote_D = App.activeDocument().getObject(page).EditableTexts[16] # lineEdit_13\n MNote_E = App.activeDocument().getObject(page).EditableTexts[17] # lineEdit_14\n MNote_F = App.activeDocument().getObject(page).EditableTexts[18] # lineEdit_15\n MNote_G = App.activeDocument().getObject(page).EditableTexts[19] # lineEdit_16\n MNote_H = App.activeDocument().getObject(page).EditableTexts[20] # lineEdit_17\n MNote_I = App.activeDocument().getObject(page).EditableTexts[21] # lineEdit_18\n except Exception:\n App.Console.PrintError(\"Erreur cartouche level DESCRIPTION (Missing field)\"+\"\\n\"\n \"You may be using an inadequate template. Try with this template\"+\"\\n\")\n App.Console.PrintMessage(\"http://www.freecadweb.org/wiki/index.php?title=Misc_templates_Full\"+\"\\n\\n\")\n App.Console.PrintError(\"Or for the original FreeCAD template use this macro\"+\"\\n\")\n App.Console.PrintMessage(\"http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC\"+\"\\n\") errorDialog(\"Erreur cartouche level DESCRIPTION (Missing field)\"+\"\\n\"\n \"You may be using an inadequate template. Try with this template\"+\"\\n\"\n \"http://www.freecadweb.org/wiki/index.php?title=Misc_templates_Full\"+\"\\n\\n\"\n \"Or for the original FreeCAD template use this macro\"+\"\\n\"\n \"http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC\"+\"\\n\\n\")\n\n except:\n errorDialog(\"Erreur cartouche\")\n\nclass Ui_MainWindow(object):\n\n def __init__(self, MainWindow):\n global path\n global PageActive\n self.window = MainWindow\n\n MainWindow.setObjectName(_fromUtf8(\"MainWindow\"))\n MainWindow.resize(810, 400)\n MainWindow.setMaximumSize(QtCore.QSize(810, 400))\n self.centralWidget = QtGui.QWidget(MainWindow)\n self.centralWidget.setObjectName(_fromUtf8(\"centralWidget\"))\n\n# self.pushButton01 = QtGui.QPushButton(self.centralWidget)\n# self.pushButton01.setGeometry(QtCore.QRect(115, 360, 93, 28))\n# self.pushButton01.setObjectName(_fromUtf8(\"pushButton01\"))\n# self.pushButton01.clicked.connect(self.on_pushButton01_clicked) #connection pushButton01\n\n self.pushButton02 = QtGui.QPushButton(self.centralWidget)\n self.pushButton02.setGeometry(QtCore.QRect(225, 360, 93, 28))\n self.pushButton02.setObjectName(_fromUtf8(\"pushButton02\"))\n self.pushButton02.clicked.connect(self.on_pushButton02_clicked) #connection pushButton02\n\n self.pushButton03 = QtGui.QPushButton(self.centralWidget)\n self.pushButton03.setGeometry(QtCore.QRect(335, 360, 93, 28))\n self.pushButton03.setToolTip(\"The memo button work only with the first Page\")\n self.pushButton03.setObjectName(_fromUtf8(\"pushButton03\"))\n self.pushButton03.clicked.connect(self.on_pushButton03_clicked) #connection pushButton03\n\n self.pushButton04 = QtGui.QPushButton(self.centralWidget)\n self.pushButton04.setGeometry(QtCore.QRect(445, 360, 93, 28))\n self.pushButton04.setObjectName(_fromUtf8(\"pushButton04\"))\n self.pushButton04.clicked.connect(self.on_pushButton04_clicked) #connection pushButton04\n\n self.pushButton05 = QtGui.QPushButton(self.centralWidget)\n self.pushButton05.setGeometry(QtCore.QRect(555, 360, 93, 28))\n# self.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n self.pushButton05.setObjectName(_fromUtf8(\"pushButton05\"))\n self.pushButton05.clicked.connect(self.on_pushButton05_clicked) #connection pushButton05\n\n #####\n self.groupBox = QtGui.QGroupBox(self.centralWidget)\n self.groupBox.setGeometry(QtCore.QRect(20, 159, 190, 101))\n self.groupBox.setObjectName(_fromUtf8(\"groupBox\"))\n\n self.label_20 = QtGui.QLabel(self.groupBox)\n self.label_20.setGeometry(QtCore.QRect(115, 5, 61, 17))\n self.label_20.setObjectName(_fromUtf8(\"label_20\"))\n ############### font and color Label\n font = QtGui.QFont()\n font.setBold(True)\n self.label_20.setFont(font)\n self.label_20.setStyleSheet(\"color : #ff0000\")\n ############### font and color\n self.label_20.setVisible(False)\n\n self.radioButton_0 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_0.setGeometry(QtCore.QRect(95, 1, 91, 17))\n self.radioButton_0.setChecked(True)\n self.radioButton_0.setEnabled(False)\n self.radioButton_0.setVisible(False)\n self.radioButton_0.setObjectName(_fromUtf8(\"radioButton_0\"))\n\n self.radioButton_1 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_1.setGeometry(QtCore.QRect(95, 20, 91, 17))\n self.radioButton_1.setObjectName(_fromUtf8(\"radioButton_1\"))\n self.radioButton_1.clicked.connect(self.on_radioButton_A3_clicked)# connect radioButton_A3\n\n self.radioButton_2 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_2.setGeometry(QtCore.QRect(95, 39, 91, 17))\n self.radioButton_2.setObjectName(_fromUtf8(\"radioButton_2\"))\n self.radioButton_2.clicked.connect(self.on_radioButton_A3_clicked)# connect radioButton_A3\n\n self.radioButton_3 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_3.setGeometry(QtCore.QRect(95, 58, 91, 17))\n self.radioButton_3.setObjectName(_fromUtf8(\"radioButton_3\"))\n self.radioButton_3.clicked.connect(self.on_radioButton_A4_clicked)# connect radioButton_A4\n\n self.radioButton_4 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_4.setGeometry(QtCore.QRect(95, 76, 91, 17))\n self.radioButton_4.setObjectName(_fromUtf8(\"radioButton_4\"))\n self.radioButton_4.clicked.connect(self.on_radioButton_A4_clicked)# connect radioButton_A4\n\n self.lineEdit_05 = QtGui.QLineEdit(self.groupBox)\n self.lineEdit_05.setGeometry(QtCore.QRect(10, 16, 75, 41))\n font = QtGui.QFont()\n font.setPointSize(25)\n font.setBold(False)\n font.setWeight(50)\n self.lineEdit_05.setFont(font)\n self.lineEdit_05.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_05.setObjectName(_fromUtf8(\"lineEdit_05\"))\n self.lineEdit_05.setText(SIZE)\n\n self.frame = QtGui.QFrame(self.groupBox)\n self.frame.setGeometry(QtCore.QRect(10, 58, 74, 41))\n self.frame.setFrameShape(QtGui.QFrame.StyledPanel)\n self.frame.setFrameShadow(QtGui.QFrame.Raised)\n self.frame.setObjectName(_fromUtf8(\"frame\"))\n\n self.radioButton_EU = QtGui.QRadioButton(self.frame)\n self.radioButton_EU.setGeometry(QtCore.QRect(0, 1, 41, 17))\n self.radioButton_EU.setChecked(True)\n self.radioButton_EU.setObjectName(_fromUtf8(\"radioButton_EU\"))\n self.radioButton_EU.clicked.connect(self.on_radioButton_EU_clicked) #connection radioButton_EU\n\n self.radioButton_US = QtGui.QRadioButton(self.frame)\n self.radioButton_US.setGeometry(QtCore.QRect(37, 1, 41, 17))\n self.radioButton_US.setObjectName(_fromUtf8(\"radioButton_US\"))\n self.radioButton_US.clicked.connect(self.on_radioButton_US_clicked) #connection radioButton_US\n\n self.pushButton10 = QtGui.QPushButton(self.frame)\n self.pushButton10.setGeometry(QtCore.QRect(0, 18, 75, 23))\n self.pushButton10.setToolTip(\"Create the symbol EU or US\"+\"\\n\"\n \"This button is Independent of the Write button\"+\"\\n\"\n \"If you desire modify the symbol in the cartouche,\"+\"\\n\"\n \"delete the inadequate symbol manualy.\")\n self.pushButton10.setEnabled(False)\n self.pushButton10.setObjectName(_fromUtf8(\"pushButton10\"))\n self.pushButton10.clicked.connect(self.on_pushButton10_clicked) #connection pushButton10\n\n #####\n\n self.pushButton06 = QtGui.QPushButton(self.centralWidget)\n self.pushButton06.setGeometry(QtCore.QRect(170, 57, 20, 20))\n self.pushButton06.setObjectName(_fromUtf8(\"pushButton06\"))\n self.pushButton06.clicked.connect(self.on_pushButton06_clicked) #connection pushButton06\n\n self.pushButton07 = QtGui.QPushButton(self.centralWidget)\n self.pushButton07.setGeometry(QtCore.QRect(190, 57, 20, 20))\n self.pushButton07.setObjectName(_fromUtf8(\"pushButton07\"))\n self.pushButton07.clicked.connect(self.on_pushButton07_clicked) #connection pushButton07\n\n self.pushButton08 = QtGui.QPushButton(self.centralWidget)\n self.pushButton08.setGeometry(QtCore.QRect(170, 137, 20, 20))\n self.pushButton08.setObjectName(_fromUtf8(\"pushButton08\"))\n self.pushButton08.clicked.connect(self.on_pushButton08_clicked) #connection pushButton08\n\n self.pushButton09 = QtGui.QPushButton(self.centralWidget)\n self.pushButton09.setGeometry(QtCore.QRect(190, 137, 20, 20))\n self.pushButton09.setObjectName(_fromUtf8(\"pushButton09\"))\n self.pushButton09.clicked.connect(self.on_pushButton09_clicked) #connection pushButton09\n\n self.lineEdit_01 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_01.setGeometry(QtCore.QRect(20, 20, 190, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_01.setFont(font)\n self.lineEdit_01.setObjectName(_fromUtf8(\"lineEdit_01\"))\n self.lineEdit_01.setText(DESIGNED_BY)\n\n self.lineEdit_02 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02.setGeometry(QtCore.QRect(20, 60, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02.setFont(font)\n self.lineEdit_02.setObjectName(_fromUtf8(\"lineEdit_02\"))\n self.lineEdit_02.setText(CREA_DATE)\n\n self.lineEdit_02h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02h.setGeometry(QtCore.QRect(98, 60, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02h.setFont(font)\n self.lineEdit_02h.setObjectName(_fromUtf8(\"lineEdit_02h\"))\n self.lineEdit_02h.setText(CREA_TIME)\n\n self.lineEdit_03 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_03.setGeometry(QtCore.QRect(20, 100, 190, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_03.setFont(font)\n self.lineEdit_03.setObjectName(_fromUtf8(\"lineEdit_03\"))\n self.lineEdit_03.setText(CHECKED_BY)\n\n self.lineEdit_04 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04.setGeometry(QtCore.QRect(20, 140, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04.setFont(font)\n self.lineEdit_04.setObjectName(_fromUtf8(\"lineEdit_04\"))\n self.lineEdit_04.setText(CHEC_DATE)\n\n self.lineEdit_04h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04h.setGeometry(QtCore.QRect(98, 140, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04h.setFont(font)\n self.lineEdit_04h.setObjectName(_fromUtf8(\"lineEdit_04h\"))\n self.lineEdit_04h.setText(CHEC_TIME)\n\n self.lineEdit_06 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_06.setGeometry(QtCore.QRect(20, 280, 61, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_06.setFont(font)\n self.lineEdit_06.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_06.setObjectName(_fromUtf8(\"lineEdit_06\"))\n self.lineEdit_06.setText(SCALE)\n\n self.lineEdit_07 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_07.setGeometry(QtCore.QRect(100, 280, 101, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_07.setFont(font)\n self.lineEdit_07.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_07.setObjectName(_fromUtf8(\"lineEdit_07\"))\n self.lineEdit_07.setText(WEIGHT)\n\n self.lineEdit_08 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_08.setGeometry(QtCore.QRect(220, 280, 341, 41))\n self.lineEdit_08.setObjectName(_fromUtf8(\"lineEdit_08\"))\n self.lineEdit_08.setText(DRAWING_NUMBER)\n\n self.lineEdit_09 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_09.setGeometry(QtCore.QRect(570, 280, 81, 41))\n self.lineEdit_09.setObjectName(_fromUtf8(\"lineEdit_09\"))\n self.lineEdit_09.setText(SHEET)\n\n self.lineEdit_20 = QtGui.QLineEdit(self.centralWidget) # Copyright\n self.lineEdit_20.setGeometry(QtCore.QRect(20, 330, 771, 22))\n self.lineEdit_20.setObjectName(_fromUtf8(\"lineEdit_20\"))\n self.lineEdit_20.setText(COPYRIGHT)\n\n self.lineEdit_10 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_10.setGeometry(QtCore.QRect(690, 290, 101, 30))\n self.lineEdit_10.setObjectName(_fromUtf8(\"lineEdit_10\"))\n self.lineEdit_10.setText(Note_A)\n\n self.lineEdit_11 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_11.setGeometry(QtCore.QRect(690, 260, 101, 30))\n self.lineEdit_11.setObjectName(_fromUtf8(\"lineEdit_11\"))\n self.lineEdit_11.setText(Note_B)\n\n self.lineEdit_12 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_12.setGeometry(QtCore.QRect(690, 230, 101, 30))\n self.lineEdit_12.setObjectName(_fromUtf8(\"lineEdit_12\"))\n self.lineEdit_12.setText(Note_C)\n\n self.lineEdit_13 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_13.setGeometry(QtCore.QRect(690, 200, 101, 30))\n self.lineEdit_13.setObjectName(_fromUtf8(\"lineEdit_13\"))\n self.lineEdit_13.setText(Note_D)\n\n self.lineEdit_14 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_14.setGeometry(QtCore.QRect(690, 170, 101, 30))\n self.lineEdit_14.setObjectName(_fromUtf8(\"lineEdit_14\"))\n self.lineEdit_14.setText(Note_E)\n\n self.lineEdit_15 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_15.setGeometry(QtCore.QRect(690, 140, 101, 30))\n self.lineEdit_15.setObjectName(_fromUtf8(\"lineEdit_15\"))\n self.lineEdit_15.setText(Note_F)\n\n self.lineEdit_16 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_16.setGeometry(QtCore.QRect(690, 110, 101, 30))\n self.lineEdit_16.setObjectName(_fromUtf8(\"lineEdit_16\"))\n self.lineEdit_16.setText(Note_G)\n\n self.lineEdit_17 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_17.setGeometry(QtCore.QRect(690, 80, 101, 30))\n self.lineEdit_17.setObjectName(_fromUtf8(\"lineEdit_17\"))\n self.lineEdit_17.setText(Note_H)\n\n self.lineEdit_18 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_18.setGeometry(QtCore.QRect(690, 50, 101, 30))\n self.lineEdit_18.setObjectName(_fromUtf8(\"lineEdit_18\"))\n self.lineEdit_18.setText(Note_I)\n##\n self.lineEdit_page = QtGui.QLineEdit(self.centralWidget) # nom de page\n self.lineEdit_page.setGeometry(QtCore.QRect(20, 365, 181, 20))\n self.lineEdit_page.setToolTip(\"Name page to work\"+\"\\n\"\n \"The name of the first page is always named 'Page'\"\n \"Select the new page in the Combo view\")\n self.lineEdit_page.setObjectName(_fromUtf8(\"lineEdit_page\"))\n self.lineEdit_page.setEnabled(False)\n self.lineEdit_page.setStyleSheet(\"color: red\")\n self.lineEdit_page.setText(PageActive)\n self.lineEdit_page.textChanged.connect(self.on_lineEdit_page_Pressed) # \n\n self.label_01T = QtGui.QLabel(self.centralWidget)\n self.label_01T.setGeometry(QtCore.QRect(220, 0, 91, 16))\n self.label_01T.setObjectName(_fromUtf8(\"label_01T\"))\n\n self.textEdit_01 = QtGui.QTextEdit(self.centralWidget) # Title\n self.textEdit_01.setGeometry(QtCore.QRect(220, 20, 431,55 ))\n font = QtGui.QFont()\n font.setPointSize(15)\n font.setBold(True)\n font.setWeight(75)\n self.textEdit_01.setFont(font)\n self.textEdit_01.setObjectName(_fromUtf8(\"textEdit_01\"))\n self.textEdit_01.setText(TITLE)\n\n self.label_02T = QtGui.QLabel(self.centralWidget)\n self.label_02T.setGeometry(QtCore.QRect(220, 80, 101, 16))\n self.label_02T.setObjectName(_fromUtf8(\"label_02T\"))\n\n self.textEdit_02 = QtGui.QTextEdit(self.centralWidget) # DESCRIPTION\n self.textEdit_02.setGeometry(QtCore.QRect(220, 100, 431, 55))\n self.textEdit_02.setObjectName(_fromUtf8(\"textEdit_02\"))\n self.textEdit_02.setText(DESCRIPTION)\n\n self.label_02bT = QtGui.QLabel(self.centralWidget)\n self.label_02bT.setGeometry(QtCore.QRect(220, 160, 90, 16))\n self.label_02bT.setObjectName(_fromUtf8(\"label_02bT\"))\n\n self.textEdit_02b = QtGui.QTextEdit(self.centralWidget) # COMPANY\n self.textEdit_02b.setGeometry(QtCore.QRect(220, 180, 340, 60))\n self.textEdit_02b.setObjectName(_fromUtf8(\"textEdit_02b\"))\n self.textEdit_02b.setText(COMPANY)\n\n self.label_01 = QtGui.QLabel(self.centralWidget)\n self.label_01.setGeometry(QtCore.QRect(20, 0, 91, 16))\n self.label_01.setObjectName(_fromUtf8(\"label_01\"))\n\n self.label_02 = QtGui.QLabel(self.centralWidget)\n self.label_02.setGeometry(QtCore.QRect(20, 40, 53, 16))\n self.label_02.setObjectName(_fromUtf8(\"label_02\"))\n\n self.label_03 = QtGui.QLabel(self.centralWidget)\n self.label_03.setGeometry(QtCore.QRect(20, 80, 101, 16))\n self.label_03.setObjectName(_fromUtf8(\"label_03\"))\n\n self.label_04 = QtGui.QLabel(self.centralWidget)\n self.label_04.setGeometry(QtCore.QRect(20, 120, 91, 16))\n self.label_04.setObjectName(_fromUtf8(\"label_04\"))\n\n self.label_06 = QtGui.QLabel(self.centralWidget)\n self.label_06.setGeometry(QtCore.QRect(20, 260, 53, 16))\n self.label_06.setObjectName(_fromUtf8(\"label_06\"))\n\n self.label_07 = QtGui.QLabel(self.centralWidget)\n self.label_07.setGeometry(QtCore.QRect(100, 260, 101, 16))\n self.label_07.setObjectName(_fromUtf8(\"label_07\"))\n\n self.label_08 = QtGui.QLabel(self.centralWidget)\n self.label_08.setGeometry(QtCore.QRect(220, 260, 121, 16))\n self.label_08.setObjectName(_fromUtf8(\"label_08\"))\n\n self.label_09 = QtGui.QLabel(self.centralWidget)\n self.label_09.setGeometry(QtCore.QRect(570, 260, 53, 16))\n self.label_09.setObjectName(_fromUtf8(\"label_09\"))\n\n self.label_10 = QtGui.QLabel(self.centralWidget)\n self.label_10.setGeometry(QtCore.QRect(670, 290, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_10.setFont(font)\n self.label_10.setObjectName(_fromUtf8(\"label_10\"))\n\n self.label_11 = QtGui.QLabel(self.centralWidget)\n self.label_11.setGeometry(QtCore.QRect(670, 260, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_11.setFont(font)\n self.label_11.setObjectName(_fromUtf8(\"label_11\"))\n\n self.label_12 = QtGui.QLabel(self.centralWidget)\n self.label_12.setGeometry(QtCore.QRect(670, 230, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_12.setFont(font)\n self.label_12.setObjectName(_fromUtf8(\"label_12\"))\n\n self.label_13 = QtGui.QLabel(self.centralWidget)\n self.label_13.setGeometry(QtCore.QRect(670, 200, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_13.setFont(font)\n self.label_13.setObjectName(_fromUtf8(\"label_13\"))\n\n self.label_14 = QtGui.QLabel(self.centralWidget)\n self.label_14.setGeometry(QtCore.QRect(670, 170, 15, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_14.setFont(font)\n self.label_14.setObjectName(_fromUtf8(\"label_14\"))\n\n self.label_15 = QtGui.QLabel(self.centralWidget)\n self.label_15.setGeometry(QtCore.QRect(670, 140, 14, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_15.setFont(font)\n self.label_15.setObjectName(_fromUtf8(\"label_15\"))\n\n self.label_16 = QtGui.QLabel(self.centralWidget)\n self.label_16.setGeometry(QtCore.QRect(670, 110, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_16.setFont(font)\n self.label_16.setObjectName(_fromUtf8(\"label_16\"))\n\n self.label_17 = QtGui.QLabel(self.centralWidget)\n self.label_17.setGeometry(QtCore.QRect(670, 80, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_17.setFont(font)\n self.label_17.setObjectName(_fromUtf8(\"label_17\"))\n\n self.label_18 = QtGui.QLabel(self.centralWidget)\n self.label_18.setGeometry(QtCore.QRect(670, 50, 10, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_18.setFont(font)\n self.label_18.setObjectName(_fromUtf8(\"label_18\"))\n\n self.label_19 = QtGui.QLabel(self.centralWidget)\n self.label_19.setGeometry(QtCore.QRect(720, 15, 100, 33))\n self.label_19.setObjectName(_fromUtf8(\"label_19\"))\n\n self.label_page = QtGui.QLabel(self.centralWidget)\n self.label_page.setGeometry(QtCore.QRect(20, 350, 181, 16))\n self.label_page.setObjectName(_fromUtf8(\"label_page\"))\n\n self.label_Version = QtGui.QLabel(self.centralWidget) # Version\n self.label_Version.setGeometry(QtCore.QRect(685, 383, 121, 20))\n self.label_Version.setObjectName(_fromUtf8(\"label_Version\"))\n\n MainWindow.setCentralWidget(self.centralWidget)\n\n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n\n def retranslateUi(self, MainWindow):\n MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenetre en avant\n MainWindow.setWindowTitle(\"Cartouche (Full)\")\n# self.pushButton01.setText(\"Position\")\n self.pushButton02.setText(\"Quit\") #Quitter\n self.pushButton03.setText(\"Memo\")\n self.pushButton04.setText(\"Clean\")#Nettoyer\n self.pushButton05.setText(\"Write\")#Appliquer\n self.pushButton06.setText(\"D.\")\n self.pushButton07.setText(\"H.\")\n self.pushButton08.setText(\"D.\")\n self.pushButton09.setText(\"H.\")\n self.pushButton10.setText(\"Create Symb.\")\n\n self.label_01.setText(\"Designed by :\")\n self.label_02.setText(\"Date :\")\n self.label_03.setText(\"Checked by :\")\n self.label_04.setText(\"Date :\")\n self.label_06.setText(\"Scale :\")\n self.label_07.setText(\"Weight (Kg) :\")\n self.label_08.setText(\"Drawing number :\")\n self.label_01T.setText(\"Title :\")\n self.label_02T.setText(\"Description :\")\n self.label_02bT.setText(\"Company :\")\n self.label_09.setText(\"Sheet :\")\n\n self.label_10.setText(\"A\")\n self.label_11.setText(\"B\")\n self.label_12.setText(\"C\")\n self.label_13.setText(\"D\")\n self.label_14.setText(\"E\")\n self.label_15.setText(\"F\")\n self.label_16.setText(\"G\")\n self.label_17.setText(\"H\")\n self.label_18.setText(\"I\")\n self.label_19.setText(\"Notes\")\n self.label_20.setText(\"Warning\")\n self.label_page.setText(\"Name page to work\")\n self.label_Version.setText(\"Ver: 00.10 15/02/2017\") # Version\n self.groupBox.setTitle(\"Size :\")\n self.radioButton_1.setText(\"A3 Landscape\")\n self.radioButton_2.setText(\"A3 Portrait\")\n self.radioButton_3.setText(\"A4 Landscape\")\n self.radioButton_4.setText(\"A4 Portrait\")\n self.radioButton_EU.setText(\"EU\")\n self.radioButton_US.setText(\"US\")\n self.lineEdit_05.setText(\"?\")\n\n#______________________________________________________________________________________\n # Radio Boutons\n def on_radioButton_A3_clicked(self): # connect radioButton_A3\n self.label_20.setVisible(False)\n self.pushButton10.setEnabled(True)\n self.lineEdit_05.setText(\"A3\")\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n\n def on_radioButton_A4_clicked(self): # connect radioButton_A4\n self.label_20.setVisible(False)\n self.pushButton10.setEnabled(True)\n self.lineEdit_05.setText(\"A4\")\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n # Radio Boutons\n\n def on_radioButton_EU_clicked(self): # Bouton /Symbole EU\n global SymbolSwitch\n SymbolSwitch = 1\n\n def on_radioButton_US_clicked(self): # Bouton /Symbole US\n global SymbolSwitch\n SymbolSwitch = 0\n\n def on_pushButton10_clicked(self): # Bouton /Symbole EU US disposition dans le cartouche\n global SymbolSwitch\n global PageActive\n self.label_20.setVisible(False)\n\n if self.radioButton_0.isChecked():\n self.label_20.setVisible(True)\n self.pushButton10.setEnabled(False)\n self.pushButton10.setStyleSheet(\"color: red\")\n self.lineEdit_page.setStyleSheet(\"color: red\")\n FreeCAD.Console.PrintError(\"Select one format A3 or A4 for the Symbole\" + \"\\n\")\n else:\n self.pushButton10.setEnabled(True)\n self.pushButton10.setStyleSheet(\"background-color: #FF5B2B\")\n self.pushButton10.setText(\"Wait.\")\n FreeCADGui.updateGui() # rafraichi l'ecran\n if SymbolSwitch == 1:\n if self.radioButton_1.isChecked():\n symbol_EU(247.5, 263.5, 0.8) # A3 Landscape\n elif self.radioButton_2.isChecked():\n symbol_EU(124.55, 386.3, 0.8) # A3 Portrait\n elif self.radioButton_3.isChecked():\n symbol_EU(158.7, 181.35, 0.6) # A4 Landscape\n elif self.radioButton_4.isChecked():\n symbol_EU(71.9, 269.0, 0.6) # A4 Portrait\n else:\n if self.radioButton_1.isChecked():\n symbol_US(247.5, 263.5, 0.8) # A3 Landscape\n elif self.radioButton_2.isChecked():\n symbol_US(124.55, 386.3, 0.8) # A3 Portrait\n elif self.radioButton_3.isChecked():\n symbol_US(158.7, 181.35, 0.6) # A4 Landscape\n elif self.radioButton_4.isChecked():\n symbol_US(71.9, 269.0, 0.6) # A4 Portrait\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n self.pushButton10.setText(\"Create Symb.\")\n FreeCADGui.updateGui() # rafraichi l'ecran\n \n def on_lineEdit_page_Pressed(self): # Name page\n global PageActive\n PageActive = self.lineEdit_page.text()\n\n def on_pushButton09_clicked(self): # Bouton /heure document\n self.lineEdit_04h.setText(str(heure()))\n\n def on_pushButton08_clicked(self): # Bouton date/ document\n global SymbolSwitch\n if SymbolSwitch==0:\n self.lineEdit_04.setText(str(dateUs()))\n else:\n self.lineEdit_04.setText(str(dateEu()))\n\n def on_pushButton07_clicked(self): # Bouton /heure checked\n self.lineEdit_02h.setText(str(heure()))\n\n def on_pushButton06_clicked(self): # Bouton date/ checked\n global SymbolSwitch\n if SymbolSwitch==0:\n self.lineEdit_02.setText(str(dateUs()))\n else:\n self.lineEdit_02.setText(str(dateEu()))\n\n def on_pushButton05_clicked(self): # Bouton Appliquer\n try:\n global DESIGNED_BY, CREATION_DATE, CREA_DATE , CREA_TIME, CHECKED_BY, CHECK_DATE\n global CHEC_DATE , CHEC_TIME , SIZE , SCALE , WEIGHT ,DRAWING_NUMBER\n global SHEET , TITLE , DESCRIPTION, COMPANY , COPYRIGHT\n global Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I\n global ui\n global SymbolSwitch\n global PageActive\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0]\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0] if len(str(page)) != 2: self.pushButton05.setStyleSheet(\"background-color: #FF5B2B\")\n self.pushButton05.setText(\"Wait.\")\n FreeCADGui.updateGui() # rafraichi l'ecran\n\n DESIGNED_BY = (self.lineEdit_01.text())\n CREATION_DATE = (self.lineEdit_02.text())+\" - \"+(self.lineEdit_02h.text())\n CHECKED_BY = (self.lineEdit_03.text())\n CHECK_DATE = (self.lineEdit_04.text())+\" - \"+(self.lineEdit_04h.text())\n SIZE = (self.lineEdit_05.text())\n SCALE = (self.lineEdit_06.text())\n WEIGHT = (self.lineEdit_07.text())\n DRAWING_NUMBER = (self.lineEdit_08.text())\n SHEET = (self.lineEdit_09.text())\n TITLE = (self.textEdit_01.toPlainText())\n DESCRIPTION = (self.textEdit_02.toPlainText())\n COMPANY = (self.textEdit_02b.toPlainText())\n COPYRIGHT = (self.lineEdit_20.text()) Note_A = (self.lineEdit_10.text())\n Note_B = (self.lineEdit_11.text())\n Note_C = (self.lineEdit_12.text())\n Note_D = (self.lineEdit_13.text())\n Note_E = (self.lineEdit_14.text())\n Note_F = (self.lineEdit_15.text())\n Note_G = (self.lineEdit_16.text())\n Note_H = (self.lineEdit_17.text())\n Note_I = (self.lineEdit_18.text()) try:\n FreeCAD.getDocument(App.ActiveDocument.Name).getObject(page.Name).EditableTexts = [DESIGNED_BY, CREATION_DATE, CHECKED_BY, CHECK_DATE, SIZE, SCALE, WEIGHT, DRAWING_NUMBER, SHEET, TITLE, DESCRIPTION, COMPANY, COPYRIGHT, Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I, ]\n#old FreeCAD.getDocument(App.ActiveDocument.Name).getObjectsByLabel(PageActive.encode('utf-8'))[0].EditableTexts = [DESIGNED_BY, CREATION_DATE, CHECKED_BY, CHECK_DATE, SIZE, SCALE, WEIGHT, DRAWING_NUMBER, SHEET, TITLE, DESCRIPTION, COMPANY, COPYRIGHT, Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I, ]\n App.ActiveDocument.recompute()\n FreeCAD.Console.PrintMessage(\"Write done to ( \" + page.Label + \" )\" + \"\\n\")\n self.pushButton05.setStyleSheet(\"color: QPalette.Base\")\n except Exception:\n FreeCAD.Console.PrintError(\"Error write cartouche or verify the selected page ( \" + page.Label + \" )\" + \"\\n\")\n self.pushButton05.setStyleSheet(\"background-color: red\")\n else:\n FreeCAD.Console.PrintError(\"Error selected page ( \" + Page.Label + \" )\" + \"\\n\")\n self.pushButton05.setStyleSheet(\"background-color: red\")\n\n except Exception:\n self.pushButton05.setStyleSheet(\"background-color: red\")\n FreeCAD.Console.PrintError(\"Error or not page \" + \"\\n\")\n self.pushButton05.setText(\"Write\")\n App.ActiveDocument.recompute()\n\n def on_pushButton04_clicked(self): # Bouton nettoyer\n\n self.lineEdit_01.setText(\"\")\n self.lineEdit_02.setText(\"\")\n self.lineEdit_02h.setText(\"\")\n self.lineEdit_03.setText(\"\")\n self.lineEdit_04.setText(\"\")\n self.lineEdit_04h.setText(\"\")\n self.lineEdit_05.setText(\"?\")\n self.lineEdit_06.setText(\"\")\n self.lineEdit_07.setText(\"\")\n self.lineEdit_08.setText(\"\")\n self.lineEdit_09.setText(\"\")\n self.textEdit_01.setText(\"\")\n self.textEdit_02.setText(\"\")\n self.textEdit_02b.setText(\"\")\n self.lineEdit_20.setText(\"\")\n self.lineEdit_10.setText(\"\")\n self.lineEdit_11.setText(\"\")\n self.lineEdit_12.setText(\"\")\n self.lineEdit_13.setText(\"\")\n self.lineEdit_14.setText(\"\")\n self.lineEdit_15.setText(\"\")\n self.lineEdit_16.setText(\"\")\n self.lineEdit_17.setText(\"\")\n self.lineEdit_18.setText(\"\")\n\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n self.label_20.setVisible(False)\n self.radioButton_0.setChecked(True)\n self.pushButton05.setEnabled(True)\n self.pushButton05.setStyleSheet(\"background-color: QPalette.Base\") # origin system\n self.groupBox.setEnabled(True)\n\n def on_pushButton03_clicked(self): # Bouton Memo\n global MDESIGNED_BY, MCREATION_DATE, MCREA_DATE , MCREA_TIME, MCHECKED_BY, MCHECK_DATE\n global MCHEC_DATE , MCHEC_TIME , MSIZE , MSCALE , MWEIGHT ,MDRAWING_NUMBER\n global MSHEET , MTITLE , MDESCRIPTION, MCOMPANY , MCOPYRIGHT\n global MNote_A, MNote_B, MNote_C, MNote_D, MNote_E, MNote_F, MNote_G, MNote_H, MNote_I\n \n self.lineEdit_01.setText(MDESIGNED_BY)\n self.lineEdit_02.setText(MCREA_DATE)\n self.lineEdit_02h.setText(MCREA_TIME)\n self.lineEdit_03.setText(MCHECKED_BY)\n self.lineEdit_04.setText(MCHEC_DATE)\n self.lineEdit_04h.setText(MCHEC_TIME)\n self.lineEdit_05.setText(\"?\") #(SIZE)\n self.lineEdit_06.setText(MSCALE)\n self.lineEdit_07.setText(MWEIGHT)\n self.lineEdit_08.setText(MDRAWING_NUMBER)\n self.lineEdit_09.setText(MSHEET)\n self.textEdit_01.setText(MTITLE)\n self.textEdit_02.setText(MDESCRIPTION)\n self.textEdit_02b.setText(MCOMPANY)\n self.lineEdit_20.setText(MCOPYRIGHT)\n self.lineEdit_10.setText(MNote_A)\n self.lineEdit_11.setText(MNote_B)\n self.lineEdit_12.setText(MNote_C)\n self.lineEdit_13.setText(MNote_D)\n self.lineEdit_14.setText(MNote_E)\n self.lineEdit_15.setText(MNote_F)\n self.lineEdit_16.setText(MNote_G)\n self.lineEdit_17.setText(MNote_H)\n self.lineEdit_18.setText(MNote_I)\n# self.lineEdit_page.setText(PageActive)\n self.radioButton_0.setChecked(True)\n\n def on_pushButton02_clicked(self): # Bouton Quitter\n App.Console.PrintMessage(\"End CartoucheFC_Full\\r\\n\")\n self.window.hide()\n FreeCADGui.Selection.removeObserver(s) # Uninstalls the resident function\n App.Console.PrintMessage(\"removeObserver\"+\"\\n\")\n\n# def on_pushButton01_clicked(self): # Bouton appel de Position\n# MainWindow.resize(210, 480)\n# executer()\n# MainWindow.resize(810, 480)\n#______________________________________________________________________________________\n\nclass SelObserver:\n print \"run..\"\n def setSelection(self,document): # Selection in ComboView\n global PageActive\n global ui\n if len(Gui.Selection.getSelection(document)) == 1:\n\n ff = ui\n ff.lineEdit_page.setStyleSheet(\"color: QPalette.Base\") # origin system\n ff.pushButton05.setEnabled(True)\n ff.pushButton05.setStyleSheet(\"background-color: QPalette.Base\") # origin system\n ff.groupBox.setEnabled(True)\n\n if (str(Gui.Selection.getSelection(document)[0].Name[0:4]) == \"Page\"):\n PageActive = str(Gui.Selection.getSelection(document)[0].Label.encode('utf-8'))\n try:\n ff.lineEdit_page.setText(unicode(PageActive,'utf-8')) # convert if accent\n except Exception:\n ff.lineEdit_page.setText(PageActive) # normal\n\n memoEntree() # entree memo click mouse\n ff.on_pushButton03_clicked() # Bouton Memo\n else:\n FreeCAD.Console.PrintError(\"Select a valid Page__________________________\" + \"\\n\")\n ff.lineEdit_page.setStyleSheet(\"color: red\")\n ff.lineEdit_page.setText(\"Select a valid Page\") # \n ff.pushButton05.setEnabled(False)\n ff.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n ff.groupBox.setEnabled(False)\n\n FreeCAD.Console.PrintMessage(\" \" + \"Name Label\" + \"\\n\")\n for i in App.ActiveDocument.Objects:\n if i.Name[0:4] == \"Page\":\n name = i.Name + \" \"\n labe = i.Label+ \" \"\n FreeCAD.Console.PrintMessage(\" Valid Page : \" + name[:15] + \",\" + labe[:25] + \"\\n\")\n FreeCAD.Console.PrintError(\"_____________________________________________\" + \"\\n\")\n\nfor obj in FreeCAD.ActiveDocument.Objects: # deslectionne\n FreeCADGui.Selection.removeSelection(obj)\n\ns=SelObserver()\nFreeCADGui.Selection.addObserver(s) # install the function mode resident \n\nMainWindow = QtGui.QMainWindow()\nui = Ui_MainWindow(MainWindow)\nMainWindow.show()\n}}\n\n## Other \n\nThe fields have no length limit, check your cartouche.\n\nThis program creates a drawing representing the regional projection symbol on your project, do not touch it is registered therefore hidden form invisible.\n\nIf you want it to be cleared uncomment the commented lines and vice versa\n\n\n```python\n\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").Visibility = False\n```\n\net \n```python\n\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").Visibility = False\n``` (I had some times an error in execution when the symbol was erased)\n\nThis module works with the drawing sheet included in FreeCAD this sheet is called **Page**, do not change the name of this sheet!\n\n## Revision \n\nver \\\"00.10\\\" : 15/02/2017 : tuning page multiple (It is possible to lose a page if there are too many)\n\nver \\\"00.09\\\" : 10/02/2017 : add radio button for choice symbol and correct the placement symbol in the separate page\n\nver \\\"00.08 : 06/02/2017 : the dialog box name page accept the accent\n\nver \\\"00.07 : 05/02/2017 : add save cartouche with name page (for multi page in projects) ps: not for character accentuate \\\"àùé \\...\\\"\n\nver 00.06 : 13/10/2016 : selection format page and position for the symbol convention (for FreeCAD ver 0.17)\n\nver 5 : 08/08/2014 PyQt4 and PySide\n\n\n
\n\n\n
\n\n\n
\n\n# Macro CartoucheFC Full/fr \n\n\n
\n\n\n{{Macro/fr\n|Name=Macro_CartoucheFC_Full\n|Icon=Macro_CartoucheFC_Full.png\n|Description=Cette macro est une application complète, elle permet de remplir le cartouche de la feuille de dessin avec tous les champs éditables (Pour l'[atelier Drawing](Drawing_Workbench/fr.md)).\n|Author=Mario52\n|Version=00.10\n|Date=2017-02-15\n|FCVersion=Toutes les versions utilisant l'atelier Drawing\n|Download=[https://www.freecadweb.org/wiki/images/6/68/Macro_CartoucheFC_Full.png Icône de la barre d'outils]\n}}\n\n## Description \n\nCette macro est une application complète, elle permet de remplir simplement tous les champs du cartouche.\n\nTéléchargez les feuilles Misc_templates_Full\n\nVoici l\\'ordre de remplissage de la ligne éditable de FreeCAD. Les champs date et heure sont séparés par un \\'*\\'espace négatif espace* \\\" - \\\"\\'\\'\\' et constituent une seule ligne éditable.\n\n\"CartoucheFC_Full\"\n\n## Utilisation \n\n**PS : certains caractères comme & \\$ ne sont pas acceptés (et peut être d\\'autres caractères spéciaux).**\n\nSi vous avez des questions ou si vous voulez ajouter une fonction, vous pouvez vous adresser au forum français [Remplir cartouche](http://forum.freecadweb.org/viewtopic.php?f=12&t=2049)\n\n- La fenêtre reste au dessus des autres fenêtres et permet ainsi de contrôler le cartouche sans quitter le programme.\n\n- Copiez le code dans un fichier nommé **Macro_CartoucheFC_Full.py** et placez le dans votre répertoire de macros habituelle.\n\n- Après avoir créé votre feuille de dessin à l\\'aide du module Drawing de FreeCAD, lancez la macro **Macro_CartoucheFC_Full**.\n\n- A l\\'ouverture, le programme enregistrera en mémoire toutes les données déjà présente dans le cartouche de la feuille (s\\'ils sont remplis), toutes ces données seront automatiquement restituées à l\\'aide du bouton **Memo** et tenus en mémoire jusqu'à la fermeture du programme.\n\n- Les boutons de date ** D.** et heure ** H.** affichent la date et heure du système.\n\n -Le format de la date est tributaire du symbole sélectionné **EU** ou **US** qui détermine le format régional. Le changement ne se fait pas automatiquement (pour le cas ou vous avez entré une date manuellement) il faut cliquer à nouveau sur les boutons dates si vous changez le symbole (vérifiez avant d\\'imprimer).\n\n- Premièrement sélectionnez votre page de travail.\n\n- Choice : choisissez le format de page utilisé.\n\n- Le bouton **Symbole EU** ou US change le sens du symbole de projection \\\"Select your Symbol\\\" est affiché par défaut, puis le symbole actif s\\'affiche. Cliquez sur le bouton et vérifiez sur la feuille le symbole, cliquez une seconde fois pour modifier le symbole.\n\n -Le choix de ce symbole, influe le format de la date **EU = dd/MM/yyyy** et **US = MM/dd/yyyy**.\n\n -**Attention** : Cette commande ne passe pas par le bouton **Appliquer** et modifie immédiatement le symbole à chaque appuis sur la touche, vérifiez toujours si vous avez sur votre feuille le symbole approprié.\n\n- Le bouton **Nettoyer** efface tous les champs du cartouche. Vous pouvez revenir aux données d\\'origine à l\\'aide du bouton **Memo**.\n\n- Le bouton **Appliquer** enregistre tous les champs du cartouche dans la feuille. Vous pouvez revenir aux données d\\'origine à l\\'aide du bouton **Memo** (sauf pour le symbole régional qui travaille en indépendant et est effectif immédiatement).\n\n## Code \n\nL\\' icône pour votre barre d\\'outils ![](images/Macro_CartoucheFC_Full.png )\n\n**Macro_CartoucheFC_Full.FCMacro**\n\n\n{{MacroCode|code=\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\"\"\"\n***************************************************************************\n* Copyright (c) 2014 2016 2017 *\n* *\n* This file is a supplement to the FreeCAD CAx development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n* *\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n***************************************************************************\n* WARNING! All changes in this file will be lost and * \n* may cause malfunction of the program *\n***************************************************************************\n\"\"\"\n#OS: Windows 10\n#Word size of OS: 64-bit\n#Word size of FreeCAD: 64-bit\n#Version: 0.16.6706 (Git)\n#Build type: Release\n#Branch: releases/FreeCAD-0-16\n#Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0\n#Python version: 2.7.8\n#Qt version: 4.8.7\n#Coin version: 4.0.0a\n#OCC version: 6.8.0.oce-0.17\n\n__title__ = \"Macro_CartoucheFC_Full\"\n__author__ = \"Mario52\"\n__url__ = \"http://www.freecadweb.org/index-fr.html\"\n__Wiki__ = \"http://www.freecadweb.org/wiki/Macro_CartoucheFC_Full\"\n__version__ = \"00.10\"\n__date__ = \"15/02/2017\"\n\n__Requires__ = (\"all version and freecad \" +\n\" DESIGNED_BY, CREATION_DATE, CHECKED_BY, CHECK_DATE, SIZE, SCALE, WEIGHT, DRAWING_NUMBER, SHEET, \" +\n\" TITLE, DESCRIPTION, COMPANY, COPYRIGHT, Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I\" )\n__Template__ = \" A3_Landscape_xx_FULL.svg, A3_Portrait_xx_FULL, A4_Landscape_xx_FULL.svg, A4_Portrait_xx_FULL\"\n__Template_Link__ = \"http://www.freecadweb.org/wiki/index.php?title=Misc_templates_Full\"\n\nimport PySide\nfrom PySide import QtCore, QtGui\n\nimport Draft, Part, FreeCAD, math, PartGui, FreeCADGui\nfrom math import sqrt, pi, sin, cos, asin\nfrom FreeCAD import Base\n\ndef utf8(unio):\n return unicode(unio).encode('UTF8')\n\nglobal path\n#path = FreeCAD.ConfigGet(\"AppHomePath\")\npath = FreeCAD.ConfigGet(\"UserAppData\")\n\nglobal PageActive ; PageActive = \"Select your page\" # essais \n#global PageActive ; PageActive = \"Page\" # page active\nglobal DESIGNED_BY ; DESIGNED_BY = \"\" # lineEdit01 DESIGNED_BY\nglobal MDESIGNED_BY ; MDESIGNED_BY = \"\" # \nglobal CREATION_DATE ; CREATION_DATE = \"\" # lineEdit02 CREATION_DATE date\nglobal MCREATION_DATE ; MCREATION_DATE = \"\" # \nglobal CREA_DATE ; CREA_DATE = \"\" # lineEdit02h date\nglobal MCREA_DATE ; MCREA_DATE = \"\" # \nglobal CREA_TIME ; CREA_TIME = \"\" # lineEdit02h heure\nglobal MCREA_TIME ; MCREA_TIME = \"\" # \nglobal CHECKED_BY ; CHECKED_BY = \"\" # lineEdit03\nglobal MCHECKED_BY ; MCHECKED_BY = \"\" # \nglobal CHECK_DATE ; CHECK_DATE = \"\" # lineEdit04 date\nglobal MCHECK_DATE ; MCHECK_DATE = \"\" # \nglobal CHEC_DATE ; CHEC_DATE = \"\" # lineEdit04 date\nglobal MCHEC_DATE ; MCHEC_DATE = \"\" # \nglobal CHEC_TIME ; CHEC_TIME = \"\" # lineEdit04h heure\nglobal MCHEC_TIME ; MCHEC_TIME = \"\" # \nglobal SIZE ; SIZE = \"\" # lineEdit05\nglobal MSIZE ; MSIZE = \"\" # \nglobal SCALE ; SCALE = \"\" # lineEdit06\nglobal MSCALE ; MSCALE = \"\" # \nglobal WEIGHT ; WEIGHT = \"\" # lineEdit07\nglobal MWEIGHT ; MWEIGHT = \"\" # \nglobal DRAWING_NUMBER ; DRAWING_NUMBER = \"\" # lineEdit08\nglobal MDRAWING_NUMBER ; MDRAWING_NUMBER = \"\" # \nglobal SHEET ; SHEET = \"\" # lineEdit09\nglobal MSHEET ; MSHEET = \"\" # \nglobal TITLE ; TITLE = \"\" # textEdit_01\nglobal MTITLE ; MTITLE = \"\" # \nglobal DESCRIPTION ; DESCRIPTION = \"\" # textEdit_02\nglobal MDESCRIPTION ; MDESCRIPTION = \"\" # \nglobal COMPANY ; COMPANY = \"\" # textEdit_02b\nglobal MCOMPANY ; MCOMPANY = \"\" # \nglobal COPYRIGHT ; COPYRIGHT = \"\" # lineEdit_20\nglobal MCOPYRIGHT ; MCOPYRIGHT = \"\" # \nglobal Note_A ; Note_A = \"\" # lineEdit_10\nglobal MNote_A ; MNote_A = \"\" # \nglobal Note_B ; Note_B = \"\" # lineEdit_11\nglobal MNote_B ; MNote_B = \"\" # \nglobal Note_C ; Note_C = \"\" # lineEdit_12\nglobal MNote_C ; MNote_C = \"\" # \nglobal Note_D ; Note_D = \"\" # lineEdit_13\nglobal MNote_D ; MNote_D = \"\" # \nglobal Note_E ; Note_E = \"\" # lineEdit_14\nglobal MNote_E ; MNote_E = \"\" # \nglobal Note_F ; Note_F = \"\" # lineEdit_15\nglobal MNote_F ; MNote_F = \"\" # \nglobal Note_G ; Note_G = \"\" # lineEdit_16\nglobal MNote_G ; MNote_G = \"\" # \nglobal Note_H ; Note_H = \"\" # lineEdit_17\nglobal MNote_H ; MNote_H = \"\" # \nglobal Note_I ; Note_I = \"\" # lineEdit_18\nglobal MNote_I ; MNote_I = \"\" # \n\nglobal SymbolSwitch ; SymbolSwitch = 1 # 0=US 1=EU\nglobal ui ; ui = \"\"\n\ndef heure():\n return QtCore.QTime().currentTime().toString('hh:mm:ss')\ndef dateEu():\n return QtCore.QDate().currentDate().toString('dd/MM/yyyy') # forme euro\ndef dateUK():\n return QtCore.QDate().currentDate().toString('yyyy/MM/dd') # forme UK\ndef dateUs():\n return QtCore.QDate().currentDate().toString('MM/dd/yyyy') # forme US\ndef dateComp():\n return QtCore.QDate().currentDate().toString('dddd d MMMM yyyy') # Retourne \"dimanche 20 Juillet 77\"\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\ndef errorDialog(msg):\n diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u\"Error Message\",msg)\n diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenetre en avant\n diag.exec_()\n\ndef symbol_EU(depx, depy, scale): #symbol_EU =O\n global PageActive\n global ui\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0]\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0]if len(str(page)) != 2:\n comP = []\n nameL = []\n if \"Page\" in (page.Name):\n for ii in (page.Group):\n if ((ii.Label) == \"Symbol_EU\") or ((ii.Label) == \"Symbol_US\") :\n App.activeDocument().removeObject(ii.Name)\n\n points=[FreeCAD.Vector(-7.5,0.0,0.0),FreeCAD.Vector(20.0,0.0,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(12.5,7.5,0.0),FreeCAD.Vector(12.5,-7.5,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(-5,2.5,0.0),FreeCAD.Vector(5.0,5.0,0.0),FreeCAD.Vector(5.0,-5.0,0.0),FreeCAD.Vector(-5.0,-2.5,0.0)]\n i = Draft.makeWire(points,closed=True,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n pl=FreeCAD.Placement()\n pl.Rotation.Q=(0.0,-0.0,-0.0,1.0)\n pl.Base=FreeCAD.Vector(12.5,-0.0,0.0)\n i = Draft.makeCircle(radius=2.5,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n i = Draft.makeCircle(radius=5.0,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name) comp = Part.makeCompound(comP)\n Part.show(comp)\n App.ActiveDocument.ActiveObject.Label = \"Symbol_EU\" obj = FreeCAD.ActiveDocument.ActiveObject\n obj.ViewObject.LineColor = (0.0,0.0,0.0)\n obj.ViewObject.Visibility = False\n \n obj2 = Draft.makeDrawingView(obj, page) \n obj2.X = depx\n obj2.Y = depy\n obj2.Scale = scale #0.8 # A3\n obj2.Label = \"Symbol_EU\" for i in nameL: App.activeDocument().removeObject(i) App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj)\n App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj2)\n App.ActiveDocument.recompute()\n else:\n ui.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n FreeCAD.Console.PrintError(\"Error selected page [ \" + PageActive + \" ]\" + \"\\n\")\n\ndef symbol_US(depx, depy, scale): #symbol_US O=\n global PageActive\n global ui\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0]\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0]\n\n if len(str(page)) != 2:\n comP = []\n nameL = [] if \"Page\" in (page.Name):\n for ii in (page.Group):\n if ((ii.Label) == \"Symbol_EU\") or ((ii.Label) == \"Symbol_US\") :\n App.activeDocument().removeObject(ii.Name)\n\n points=[FreeCAD.Vector(-7.5,0.0,0.0),FreeCAD.Vector(20.0,0.0,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(0.0,7.5,0.0),FreeCAD.Vector(0.0,-7.5,0.0)]\n i = Draft.makeWire(points,closed=False,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n points=[FreeCAD.Vector(7.5,2.5,0.0),FreeCAD.Vector(17.5,5.0,0.0),FreeCAD.Vector(17.5,-5.0,0.0),FreeCAD.Vector(7.5,-2.5,0.0)]\n i = Draft.makeWire(points,closed=True,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n pl=FreeCAD.Placement()\n pl.Rotation.Q=(0.0,-0.0,-0.0,1.0)\n pl.Base=FreeCAD.Vector(0.0,-0.0,0.0)\n i = Draft.makeCircle(radius=2.5,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name)\n i = Draft.makeCircle(radius=5.0,placement=pl,face=False,support=None)\n comP.append(i.Shape)\n nameL.append(i.Name) comp = Part.makeCompound(comP)\n Part.show(comp)\n App.ActiveDocument.ActiveObject.Label = \"Symbol_US\" obj = FreeCAD.ActiveDocument.ActiveObject\n obj.ViewObject.LineColor = (0.0,0.0,0.0)\n obj.ViewObject.Visibility = False obj2 = Draft.makeDrawingView(obj, page) \n obj2.X = depx\n obj2.Y = depy\n obj2.Scale = scale #0.8 # A3\n obj2.Label = \"Symbol_US\" for i in nameL: App.activeDocument().removeObject(i) App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj)\n App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].addObject(obj2)\n App.ActiveDocument.recompute()\n else:\n ui.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n FreeCAD.Console.PrintError(\"Error selected page [ \" + PageActive + \" ]\" + \"\\n\")\n\ndef memoEntree():\n global MDESIGNED_BY, MCREATION_DATE, MCREA_DATE , MCREA_TIME, MCHECKED_BY, MCHECK_DATE\n global MCHEC_DATE , MCHEC_TIME , MSIZE , MSCALE , MWEIGHT ,MDRAWING_NUMBER\n global MSHEET , MTITLE , MDESCRIPTION, MCOMPANY , MCOPYRIGHT\n global MNote_A, MNote_B, MNote_C, MNote_D, MNote_E, MNote_F, MNote_G, MNote_H, MNote_I\n global PageActive\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0].Name\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0]\n\n try:\n MDESIGNED_BY = App.activeDocument().getObject(page).EditableTexts[0] # lineEdit01 DESIGNED_BY\n MCREATION_DATE = App.activeDocument().getObject(page).EditableTexts[1] # lineEdit02 CREATION_DATE date\n\n MCREA_DATE = MCREA_TIME = MCHEC_DATE = MCHEC_TIME = \"\"\n\n try:\n MCREA_DATE = MCREATION_DATE.split(\" - \")[0] # lineEdit02h date\n except:\n MCREA_DATE = MCREATION_DATE\n try:\n MCREA_TIME = MCREATION_DATE.split(\" - \")[1] # lineEdit02h heure\n except: None \n\n MCHECKED_BY = App.activeDocument().getObject(page).EditableTexts[2] # lineEdit03\n MCHECK_DATE = App.activeDocument().getObject(page).EditableTexts[3] # lineEdit04 date\n\n try:\n MCHEC_DATE = MCHECK_DATE.split(\" - \")[0] # lineEdit04 date\n except:\n MCHEC_DATE = MCHECK_DATE\n try:\n MCHEC_TIME = MCHECK_DATE.split(\" - \")[1] # lineEdit04h heure\n except: None \n\n MSIZE = App.activeDocument().getObject(page).EditableTexts[4] # lineEdit05\n MSCALE = App.activeDocument().getObject(page).EditableTexts[5] # lineEdit06\n MWEIGHT = App.activeDocument().getObject(page).EditableTexts[6] # lineEdit07\n MDRAWING_NUMBER = App.activeDocument().getObject(page).EditableTexts[7] # lineEdit08\n MSHEET = App.activeDocument().getObject(page).EditableTexts[8] # lineEdit09\n MTITLE = App.activeDocument().getObject(page).EditableTexts[9] # textEdit_01\n\n try:\n MDESCRIPTION = App.activeDocument().getObject(page).EditableTexts[10] # textEdit_02\n MCOMPANY = App.activeDocument().getObject(page).EditableTexts[11] # textEdit_02b\n MCOPYRIGHT = App.activeDocument().getObject(page).EditableTexts[12] # lineEdit_20\n MNote_A = App.activeDocument().getObject(page).EditableTexts[13] # lineEdit_10\n MNote_B = App.activeDocument().getObject(page).EditableTexts[14] # lineEdit_11\n MNote_C = App.activeDocument().getObject(page).EditableTexts[15] # lineEdit_12\n MNote_D = App.activeDocument().getObject(page).EditableTexts[16] # lineEdit_13\n MNote_E = App.activeDocument().getObject(page).EditableTexts[17] # lineEdit_14\n MNote_F = App.activeDocument().getObject(page).EditableTexts[18] # lineEdit_15\n MNote_G = App.activeDocument().getObject(page).EditableTexts[19] # lineEdit_16\n MNote_H = App.activeDocument().getObject(page).EditableTexts[20] # lineEdit_17\n MNote_I = App.activeDocument().getObject(page).EditableTexts[21] # lineEdit_18\n except Exception:\n App.Console.PrintError(\"Erreur cartouche level DESCRIPTION (Missing field)\"+\"\\n\"\n \"You may be using an inadequate template. Try with this template\"+\"\\n\")\n App.Console.PrintMessage(\"http://www.freecadweb.org/wiki/index.php?title=Misc_templates_Full\"+\"\\n\\n\")\n App.Console.PrintError(\"Or for the original FreeCAD template use this macro\"+\"\\n\")\n App.Console.PrintMessage(\"http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC\"+\"\\n\") errorDialog(\"Erreur cartouche level DESCRIPTION (Missing field)\"+\"\\n\"\n \"You may be using an inadequate template. Try with this template\"+\"\\n\"\n \"http://www.freecadweb.org/wiki/index.php?title=Misc_templates_Full\"+\"\\n\\n\"\n \"Or for the original FreeCAD template use this macro\"+\"\\n\"\n \"http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC\"+\"\\n\\n\")\n\n except:\n errorDialog(\"Erreur cartouche\")\n\nclass Ui_MainWindow(object):\n\n def __init__(self, MainWindow):\n global path\n global PageActive\n self.window = MainWindow\n\n MainWindow.setObjectName(_fromUtf8(\"MainWindow\"))\n MainWindow.resize(810, 400)\n MainWindow.setMaximumSize(QtCore.QSize(810, 400))\n self.centralWidget = QtGui.QWidget(MainWindow)\n self.centralWidget.setObjectName(_fromUtf8(\"centralWidget\"))\n\n# self.pushButton01 = QtGui.QPushButton(self.centralWidget)\n# self.pushButton01.setGeometry(QtCore.QRect(115, 360, 93, 28))\n# self.pushButton01.setObjectName(_fromUtf8(\"pushButton01\"))\n# self.pushButton01.clicked.connect(self.on_pushButton01_clicked) #connection pushButton01\n\n self.pushButton02 = QtGui.QPushButton(self.centralWidget)\n self.pushButton02.setGeometry(QtCore.QRect(225, 360, 93, 28))\n self.pushButton02.setObjectName(_fromUtf8(\"pushButton02\"))\n self.pushButton02.clicked.connect(self.on_pushButton02_clicked) #connection pushButton02\n\n self.pushButton03 = QtGui.QPushButton(self.centralWidget)\n self.pushButton03.setGeometry(QtCore.QRect(335, 360, 93, 28))\n self.pushButton03.setToolTip(\"The memo button work only with the first Page\")\n self.pushButton03.setObjectName(_fromUtf8(\"pushButton03\"))\n self.pushButton03.clicked.connect(self.on_pushButton03_clicked) #connection pushButton03\n\n self.pushButton04 = QtGui.QPushButton(self.centralWidget)\n self.pushButton04.setGeometry(QtCore.QRect(445, 360, 93, 28))\n self.pushButton04.setObjectName(_fromUtf8(\"pushButton04\"))\n self.pushButton04.clicked.connect(self.on_pushButton04_clicked) #connection pushButton04\n\n self.pushButton05 = QtGui.QPushButton(self.centralWidget)\n self.pushButton05.setGeometry(QtCore.QRect(555, 360, 93, 28))\n# self.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n self.pushButton05.setObjectName(_fromUtf8(\"pushButton05\"))\n self.pushButton05.clicked.connect(self.on_pushButton05_clicked) #connection pushButton05\n\n #####\n self.groupBox = QtGui.QGroupBox(self.centralWidget)\n self.groupBox.setGeometry(QtCore.QRect(20, 159, 190, 101))\n self.groupBox.setObjectName(_fromUtf8(\"groupBox\"))\n\n self.label_20 = QtGui.QLabel(self.groupBox)\n self.label_20.setGeometry(QtCore.QRect(115, 5, 61, 17))\n self.label_20.setObjectName(_fromUtf8(\"label_20\"))\n ############### font and color Label\n font = QtGui.QFont()\n font.setBold(True)\n self.label_20.setFont(font)\n self.label_20.setStyleSheet(\"color : #ff0000\")\n ############### font and color\n self.label_20.setVisible(False)\n\n self.radioButton_0 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_0.setGeometry(QtCore.QRect(95, 1, 91, 17))\n self.radioButton_0.setChecked(True)\n self.radioButton_0.setEnabled(False)\n self.radioButton_0.setVisible(False)\n self.radioButton_0.setObjectName(_fromUtf8(\"radioButton_0\"))\n\n self.radioButton_1 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_1.setGeometry(QtCore.QRect(95, 20, 91, 17))\n self.radioButton_1.setObjectName(_fromUtf8(\"radioButton_1\"))\n self.radioButton_1.clicked.connect(self.on_radioButton_A3_clicked)# connect radioButton_A3\n\n self.radioButton_2 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_2.setGeometry(QtCore.QRect(95, 39, 91, 17))\n self.radioButton_2.setObjectName(_fromUtf8(\"radioButton_2\"))\n self.radioButton_2.clicked.connect(self.on_radioButton_A3_clicked)# connect radioButton_A3\n\n self.radioButton_3 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_3.setGeometry(QtCore.QRect(95, 58, 91, 17))\n self.radioButton_3.setObjectName(_fromUtf8(\"radioButton_3\"))\n self.radioButton_3.clicked.connect(self.on_radioButton_A4_clicked)# connect radioButton_A4\n\n self.radioButton_4 = QtGui.QRadioButton(self.groupBox)\n self.radioButton_4.setGeometry(QtCore.QRect(95, 76, 91, 17))\n self.radioButton_4.setObjectName(_fromUtf8(\"radioButton_4\"))\n self.radioButton_4.clicked.connect(self.on_radioButton_A4_clicked)# connect radioButton_A4\n\n self.lineEdit_05 = QtGui.QLineEdit(self.groupBox)\n self.lineEdit_05.setGeometry(QtCore.QRect(10, 16, 75, 41))\n font = QtGui.QFont()\n font.setPointSize(25)\n font.setBold(False)\n font.setWeight(50)\n self.lineEdit_05.setFont(font)\n self.lineEdit_05.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_05.setObjectName(_fromUtf8(\"lineEdit_05\"))\n self.lineEdit_05.setText(SIZE)\n\n self.frame = QtGui.QFrame(self.groupBox)\n self.frame.setGeometry(QtCore.QRect(10, 58, 74, 41))\n self.frame.setFrameShape(QtGui.QFrame.StyledPanel)\n self.frame.setFrameShadow(QtGui.QFrame.Raised)\n self.frame.setObjectName(_fromUtf8(\"frame\"))\n\n self.radioButton_EU = QtGui.QRadioButton(self.frame)\n self.radioButton_EU.setGeometry(QtCore.QRect(0, 1, 41, 17))\n self.radioButton_EU.setChecked(True)\n self.radioButton_EU.setObjectName(_fromUtf8(\"radioButton_EU\"))\n self.radioButton_EU.clicked.connect(self.on_radioButton_EU_clicked) #connection radioButton_EU\n\n self.radioButton_US = QtGui.QRadioButton(self.frame)\n self.radioButton_US.setGeometry(QtCore.QRect(37, 1, 41, 17))\n self.radioButton_US.setObjectName(_fromUtf8(\"radioButton_US\"))\n self.radioButton_US.clicked.connect(self.on_radioButton_US_clicked) #connection radioButton_US\n\n self.pushButton10 = QtGui.QPushButton(self.frame)\n self.pushButton10.setGeometry(QtCore.QRect(0, 18, 75, 23))\n self.pushButton10.setToolTip(\"Create the symbol EU or US\"+\"\\n\"\n \"This button is Independent of the Write button\"+\"\\n\"\n \"If you desire modify the symbol in the cartouche,\"+\"\\n\"\n \"delete the inadequate symbol manualy.\")\n self.pushButton10.setEnabled(False)\n self.pushButton10.setObjectName(_fromUtf8(\"pushButton10\"))\n self.pushButton10.clicked.connect(self.on_pushButton10_clicked) #connection pushButton10\n\n #####\n\n self.pushButton06 = QtGui.QPushButton(self.centralWidget)\n self.pushButton06.setGeometry(QtCore.QRect(170, 57, 20, 20))\n self.pushButton06.setObjectName(_fromUtf8(\"pushButton06\"))\n self.pushButton06.clicked.connect(self.on_pushButton06_clicked) #connection pushButton06\n\n self.pushButton07 = QtGui.QPushButton(self.centralWidget)\n self.pushButton07.setGeometry(QtCore.QRect(190, 57, 20, 20))\n self.pushButton07.setObjectName(_fromUtf8(\"pushButton07\"))\n self.pushButton07.clicked.connect(self.on_pushButton07_clicked) #connection pushButton07\n\n self.pushButton08 = QtGui.QPushButton(self.centralWidget)\n self.pushButton08.setGeometry(QtCore.QRect(170, 137, 20, 20))\n self.pushButton08.setObjectName(_fromUtf8(\"pushButton08\"))\n self.pushButton08.clicked.connect(self.on_pushButton08_clicked) #connection pushButton08\n\n self.pushButton09 = QtGui.QPushButton(self.centralWidget)\n self.pushButton09.setGeometry(QtCore.QRect(190, 137, 20, 20))\n self.pushButton09.setObjectName(_fromUtf8(\"pushButton09\"))\n self.pushButton09.clicked.connect(self.on_pushButton09_clicked) #connection pushButton09\n\n self.lineEdit_01 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_01.setGeometry(QtCore.QRect(20, 20, 190, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_01.setFont(font)\n self.lineEdit_01.setObjectName(_fromUtf8(\"lineEdit_01\"))\n self.lineEdit_01.setText(DESIGNED_BY)\n\n self.lineEdit_02 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02.setGeometry(QtCore.QRect(20, 60, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02.setFont(font)\n self.lineEdit_02.setObjectName(_fromUtf8(\"lineEdit_02\"))\n self.lineEdit_02.setText(CREA_DATE)\n\n self.lineEdit_02h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_02h.setGeometry(QtCore.QRect(98, 60, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_02h.setFont(font)\n self.lineEdit_02h.setObjectName(_fromUtf8(\"lineEdit_02h\"))\n self.lineEdit_02h.setText(CREA_TIME)\n\n self.lineEdit_03 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_03.setGeometry(QtCore.QRect(20, 100, 190, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_03.setFont(font)\n self.lineEdit_03.setObjectName(_fromUtf8(\"lineEdit_03\"))\n self.lineEdit_03.setText(CHECKED_BY)\n\n self.lineEdit_04 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04.setGeometry(QtCore.QRect(20, 140, 82, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04.setFont(font)\n self.lineEdit_04.setObjectName(_fromUtf8(\"lineEdit_04\"))\n self.lineEdit_04.setText(CHEC_DATE)\n\n self.lineEdit_04h = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_04h.setGeometry(QtCore.QRect(98, 140, 72, 16))\n font = QtGui.QFont()\n font.setPointSize(7)\n self.lineEdit_04h.setFont(font)\n self.lineEdit_04h.setObjectName(_fromUtf8(\"lineEdit_04h\"))\n self.lineEdit_04h.setText(CHEC_TIME)\n\n self.lineEdit_06 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_06.setGeometry(QtCore.QRect(20, 280, 61, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_06.setFont(font)\n self.lineEdit_06.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_06.setObjectName(_fromUtf8(\"lineEdit_06\"))\n self.lineEdit_06.setText(SCALE)\n\n self.lineEdit_07 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_07.setGeometry(QtCore.QRect(100, 280, 101, 41))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_07.setFont(font)\n self.lineEdit_07.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_07.setObjectName(_fromUtf8(\"lineEdit_07\"))\n self.lineEdit_07.setText(WEIGHT)\n\n self.lineEdit_08 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_08.setGeometry(QtCore.QRect(220, 280, 341, 41))\n self.lineEdit_08.setObjectName(_fromUtf8(\"lineEdit_08\"))\n self.lineEdit_08.setText(DRAWING_NUMBER)\n\n self.lineEdit_09 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_09.setGeometry(QtCore.QRect(570, 280, 81, 41))\n self.lineEdit_09.setObjectName(_fromUtf8(\"lineEdit_09\"))\n self.lineEdit_09.setText(SHEET)\n\n self.lineEdit_20 = QtGui.QLineEdit(self.centralWidget) # Copyright\n self.lineEdit_20.setGeometry(QtCore.QRect(20, 330, 771, 22))\n self.lineEdit_20.setObjectName(_fromUtf8(\"lineEdit_20\"))\n self.lineEdit_20.setText(COPYRIGHT)\n\n self.lineEdit_10 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_10.setGeometry(QtCore.QRect(690, 290, 101, 30))\n self.lineEdit_10.setObjectName(_fromUtf8(\"lineEdit_10\"))\n self.lineEdit_10.setText(Note_A)\n\n self.lineEdit_11 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_11.setGeometry(QtCore.QRect(690, 260, 101, 30))\n self.lineEdit_11.setObjectName(_fromUtf8(\"lineEdit_11\"))\n self.lineEdit_11.setText(Note_B)\n\n self.lineEdit_12 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_12.setGeometry(QtCore.QRect(690, 230, 101, 30))\n self.lineEdit_12.setObjectName(_fromUtf8(\"lineEdit_12\"))\n self.lineEdit_12.setText(Note_C)\n\n self.lineEdit_13 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_13.setGeometry(QtCore.QRect(690, 200, 101, 30))\n self.lineEdit_13.setObjectName(_fromUtf8(\"lineEdit_13\"))\n self.lineEdit_13.setText(Note_D)\n\n self.lineEdit_14 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_14.setGeometry(QtCore.QRect(690, 170, 101, 30))\n self.lineEdit_14.setObjectName(_fromUtf8(\"lineEdit_14\"))\n self.lineEdit_14.setText(Note_E)\n\n self.lineEdit_15 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_15.setGeometry(QtCore.QRect(690, 140, 101, 30))\n self.lineEdit_15.setObjectName(_fromUtf8(\"lineEdit_15\"))\n self.lineEdit_15.setText(Note_F)\n\n self.lineEdit_16 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_16.setGeometry(QtCore.QRect(690, 110, 101, 30))\n self.lineEdit_16.setObjectName(_fromUtf8(\"lineEdit_16\"))\n self.lineEdit_16.setText(Note_G)\n\n self.lineEdit_17 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_17.setGeometry(QtCore.QRect(690, 80, 101, 30))\n self.lineEdit_17.setObjectName(_fromUtf8(\"lineEdit_17\"))\n self.lineEdit_17.setText(Note_H)\n\n self.lineEdit_18 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_18.setGeometry(QtCore.QRect(690, 50, 101, 30))\n self.lineEdit_18.setObjectName(_fromUtf8(\"lineEdit_18\"))\n self.lineEdit_18.setText(Note_I)\n##\n self.lineEdit_page = QtGui.QLineEdit(self.centralWidget) # nom de page\n self.lineEdit_page.setGeometry(QtCore.QRect(20, 365, 181, 20))\n self.lineEdit_page.setToolTip(\"Name page to work\"+\"\\n\"\n \"The name of the first page is always named 'Page'\"\n \"Select the new page in the Combo view\")\n self.lineEdit_page.setObjectName(_fromUtf8(\"lineEdit_page\"))\n self.lineEdit_page.setEnabled(False)\n self.lineEdit_page.setStyleSheet(\"color: red\")\n self.lineEdit_page.setText(PageActive)\n self.lineEdit_page.textChanged.connect(self.on_lineEdit_page_Pressed) # \n\n self.label_01T = QtGui.QLabel(self.centralWidget)\n self.label_01T.setGeometry(QtCore.QRect(220, 0, 91, 16))\n self.label_01T.setObjectName(_fromUtf8(\"label_01T\"))\n\n self.textEdit_01 = QtGui.QTextEdit(self.centralWidget) # Title\n self.textEdit_01.setGeometry(QtCore.QRect(220, 20, 431,55 ))\n font = QtGui.QFont()\n font.setPointSize(15)\n font.setBold(True)\n font.setWeight(75)\n self.textEdit_01.setFont(font)\n self.textEdit_01.setObjectName(_fromUtf8(\"textEdit_01\"))\n self.textEdit_01.setText(TITLE)\n\n self.label_02T = QtGui.QLabel(self.centralWidget)\n self.label_02T.setGeometry(QtCore.QRect(220, 80, 101, 16))\n self.label_02T.setObjectName(_fromUtf8(\"label_02T\"))\n\n self.textEdit_02 = QtGui.QTextEdit(self.centralWidget) # DESCRIPTION\n self.textEdit_02.setGeometry(QtCore.QRect(220, 100, 431, 55))\n self.textEdit_02.setObjectName(_fromUtf8(\"textEdit_02\"))\n self.textEdit_02.setText(DESCRIPTION)\n\n self.label_02bT = QtGui.QLabel(self.centralWidget)\n self.label_02bT.setGeometry(QtCore.QRect(220, 160, 90, 16))\n self.label_02bT.setObjectName(_fromUtf8(\"label_02bT\"))\n\n self.textEdit_02b = QtGui.QTextEdit(self.centralWidget) # COMPANY\n self.textEdit_02b.setGeometry(QtCore.QRect(220, 180, 340, 60))\n self.textEdit_02b.setObjectName(_fromUtf8(\"textEdit_02b\"))\n self.textEdit_02b.setText(COMPANY)\n\n self.label_01 = QtGui.QLabel(self.centralWidget)\n self.label_01.setGeometry(QtCore.QRect(20, 0, 91, 16))\n self.label_01.setObjectName(_fromUtf8(\"label_01\"))\n\n self.label_02 = QtGui.QLabel(self.centralWidget)\n self.label_02.setGeometry(QtCore.QRect(20, 40, 53, 16))\n self.label_02.setObjectName(_fromUtf8(\"label_02\"))\n\n self.label_03 = QtGui.QLabel(self.centralWidget)\n self.label_03.setGeometry(QtCore.QRect(20, 80, 101, 16))\n self.label_03.setObjectName(_fromUtf8(\"label_03\"))\n\n self.label_04 = QtGui.QLabel(self.centralWidget)\n self.label_04.setGeometry(QtCore.QRect(20, 120, 91, 16))\n self.label_04.setObjectName(_fromUtf8(\"label_04\"))\n\n self.label_06 = QtGui.QLabel(self.centralWidget)\n self.label_06.setGeometry(QtCore.QRect(20, 260, 53, 16))\n self.label_06.setObjectName(_fromUtf8(\"label_06\"))\n\n self.label_07 = QtGui.QLabel(self.centralWidget)\n self.label_07.setGeometry(QtCore.QRect(100, 260, 101, 16))\n self.label_07.setObjectName(_fromUtf8(\"label_07\"))\n\n self.label_08 = QtGui.QLabel(self.centralWidget)\n self.label_08.setGeometry(QtCore.QRect(220, 260, 121, 16))\n self.label_08.setObjectName(_fromUtf8(\"label_08\"))\n\n self.label_09 = QtGui.QLabel(self.centralWidget)\n self.label_09.setGeometry(QtCore.QRect(570, 260, 53, 16))\n self.label_09.setObjectName(_fromUtf8(\"label_09\"))\n\n self.label_10 = QtGui.QLabel(self.centralWidget)\n self.label_10.setGeometry(QtCore.QRect(670, 290, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_10.setFont(font)\n self.label_10.setObjectName(_fromUtf8(\"label_10\"))\n\n self.label_11 = QtGui.QLabel(self.centralWidget)\n self.label_11.setGeometry(QtCore.QRect(670, 260, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_11.setFont(font)\n self.label_11.setObjectName(_fromUtf8(\"label_11\"))\n\n self.label_12 = QtGui.QLabel(self.centralWidget)\n self.label_12.setGeometry(QtCore.QRect(670, 230, 16, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_12.setFont(font)\n self.label_12.setObjectName(_fromUtf8(\"label_12\"))\n\n self.label_13 = QtGui.QLabel(self.centralWidget)\n self.label_13.setGeometry(QtCore.QRect(670, 200, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_13.setFont(font)\n self.label_13.setObjectName(_fromUtf8(\"label_13\"))\n\n self.label_14 = QtGui.QLabel(self.centralWidget)\n self.label_14.setGeometry(QtCore.QRect(670, 170, 15, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_14.setFont(font)\n self.label_14.setObjectName(_fromUtf8(\"label_14\"))\n\n self.label_15 = QtGui.QLabel(self.centralWidget)\n self.label_15.setGeometry(QtCore.QRect(670, 140, 14, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_15.setFont(font)\n self.label_15.setObjectName(_fromUtf8(\"label_15\"))\n\n self.label_16 = QtGui.QLabel(self.centralWidget)\n self.label_16.setGeometry(QtCore.QRect(670, 110, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_16.setFont(font)\n self.label_16.setObjectName(_fromUtf8(\"label_16\"))\n\n self.label_17 = QtGui.QLabel(self.centralWidget)\n self.label_17.setGeometry(QtCore.QRect(670, 80, 18, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_17.setFont(font)\n self.label_17.setObjectName(_fromUtf8(\"label_17\"))\n\n self.label_18 = QtGui.QLabel(self.centralWidget)\n self.label_18.setGeometry(QtCore.QRect(670, 50, 10, 33))\n font = QtGui.QFont()\n font.setPointSize(12)\n font.setBold(True)\n font.setWeight(75)\n self.label_18.setFont(font)\n self.label_18.setObjectName(_fromUtf8(\"label_18\"))\n\n self.label_19 = QtGui.QLabel(self.centralWidget)\n self.label_19.setGeometry(QtCore.QRect(720, 15, 100, 33))\n self.label_19.setObjectName(_fromUtf8(\"label_19\"))\n\n self.label_page = QtGui.QLabel(self.centralWidget)\n self.label_page.setGeometry(QtCore.QRect(20, 350, 181, 16))\n self.label_page.setObjectName(_fromUtf8(\"label_page\"))\n\n self.label_Version = QtGui.QLabel(self.centralWidget) # Version\n self.label_Version.setGeometry(QtCore.QRect(685, 383, 121, 20))\n self.label_Version.setObjectName(_fromUtf8(\"label_Version\"))\n\n MainWindow.setCentralWidget(self.centralWidget)\n\n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n\n def retranslateUi(self, MainWindow):\n MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenetre en avant\n MainWindow.setWindowTitle(\"Cartouche (Full)\")\n# self.pushButton01.setText(\"Position\")\n self.pushButton02.setText(\"Quit\") #Quitter\n self.pushButton03.setText(\"Memo\")\n self.pushButton04.setText(\"Clean\")#Nettoyer\n self.pushButton05.setText(\"Write\")#Appliquer\n self.pushButton06.setText(\"D.\")\n self.pushButton07.setText(\"H.\")\n self.pushButton08.setText(\"D.\")\n self.pushButton09.setText(\"H.\")\n self.pushButton10.setText(\"Create Symb.\")\n\n self.label_01.setText(\"Designed by :\")\n self.label_02.setText(\"Date :\")\n self.label_03.setText(\"Checked by :\")\n self.label_04.setText(\"Date :\")\n self.label_06.setText(\"Scale :\")\n self.label_07.setText(\"Weight (Kg) :\")\n self.label_08.setText(\"Drawing number :\")\n self.label_01T.setText(\"Title :\")\n self.label_02T.setText(\"Description :\")\n self.label_02bT.setText(\"Company :\")\n self.label_09.setText(\"Sheet :\")\n\n self.label_10.setText(\"A\")\n self.label_11.setText(\"B\")\n self.label_12.setText(\"C\")\n self.label_13.setText(\"D\")\n self.label_14.setText(\"E\")\n self.label_15.setText(\"F\")\n self.label_16.setText(\"G\")\n self.label_17.setText(\"H\")\n self.label_18.setText(\"I\")\n self.label_19.setText(\"Notes\")\n self.label_20.setText(\"Warning\")\n self.label_page.setText(\"Name page to work\")\n self.label_Version.setText(\"Ver: 00.10 15/02/2017\") # Version\n self.groupBox.setTitle(\"Size :\")\n self.radioButton_1.setText(\"A3 Landscape\")\n self.radioButton_2.setText(\"A3 Portrait\")\n self.radioButton_3.setText(\"A4 Landscape\")\n self.radioButton_4.setText(\"A4 Portrait\")\n self.radioButton_EU.setText(\"EU\")\n self.radioButton_US.setText(\"US\")\n self.lineEdit_05.setText(\"?\")\n\n#______________________________________________________________________________________\n # Radio Boutons\n def on_radioButton_A3_clicked(self): # connect radioButton_A3\n self.label_20.setVisible(False)\n self.pushButton10.setEnabled(True)\n self.lineEdit_05.setText(\"A3\")\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n\n def on_radioButton_A4_clicked(self): # connect radioButton_A4\n self.label_20.setVisible(False)\n self.pushButton10.setEnabled(True)\n self.lineEdit_05.setText(\"A4\")\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n # Radio Boutons\n\n def on_radioButton_EU_clicked(self): # Bouton /Symbole EU\n global SymbolSwitch\n SymbolSwitch = 1\n\n def on_radioButton_US_clicked(self): # Bouton /Symbole US\n global SymbolSwitch\n SymbolSwitch = 0\n\n def on_pushButton10_clicked(self): # Bouton /Symbole EU US disposition dans le cartouche\n global SymbolSwitch\n global PageActive\n self.label_20.setVisible(False)\n\n if self.radioButton_0.isChecked():\n self.label_20.setVisible(True)\n self.pushButton10.setEnabled(False)\n self.pushButton10.setStyleSheet(\"color: red\")\n self.lineEdit_page.setStyleSheet(\"color: red\")\n FreeCAD.Console.PrintError(\"Select one format A3 or A4 for the Symbole\" + \"\\n\")\n else:\n self.pushButton10.setEnabled(True)\n self.pushButton10.setStyleSheet(\"background-color: #FF5B2B\")\n self.pushButton10.setText(\"Wait.\")\n FreeCADGui.updateGui() # rafraichi l'ecran\n if SymbolSwitch == 1:\n if self.radioButton_1.isChecked():\n symbol_EU(247.5, 263.5, 0.8) # A3 Landscape\n elif self.radioButton_2.isChecked():\n symbol_EU(124.55, 386.3, 0.8) # A3 Portrait\n elif self.radioButton_3.isChecked():\n symbol_EU(158.7, 181.35, 0.6) # A4 Landscape\n elif self.radioButton_4.isChecked():\n symbol_EU(71.9, 269.0, 0.6) # A4 Portrait\n else:\n if self.radioButton_1.isChecked():\n symbol_US(247.5, 263.5, 0.8) # A3 Landscape\n elif self.radioButton_2.isChecked():\n symbol_US(124.55, 386.3, 0.8) # A3 Portrait\n elif self.radioButton_3.isChecked():\n symbol_US(158.7, 181.35, 0.6) # A4 Landscape\n elif self.radioButton_4.isChecked():\n symbol_US(71.9, 269.0, 0.6) # A4 Portrait\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n self.pushButton10.setText(\"Create Symb.\")\n FreeCADGui.updateGui() # rafraichi l'ecran\n \n def on_lineEdit_page_Pressed(self): # Name page\n global PageActive\n PageActive = self.lineEdit_page.text()\n\n def on_pushButton09_clicked(self): # Bouton /heure document\n self.lineEdit_04h.setText(str(heure()))\n\n def on_pushButton08_clicked(self): # Bouton date/ document\n global SymbolSwitch\n if SymbolSwitch==0:\n self.lineEdit_04.setText(str(dateUs()))\n else:\n self.lineEdit_04.setText(str(dateEu()))\n\n def on_pushButton07_clicked(self): # Bouton /heure checked\n self.lineEdit_02h.setText(str(heure()))\n\n def on_pushButton06_clicked(self): # Bouton date/ checked\n global SymbolSwitch\n if SymbolSwitch==0:\n self.lineEdit_02.setText(str(dateUs()))\n else:\n self.lineEdit_02.setText(str(dateEu()))\n\n def on_pushButton05_clicked(self): # Bouton Appliquer\n try:\n global DESIGNED_BY, CREATION_DATE, CREA_DATE , CREA_TIME, CHECKED_BY, CHECK_DATE\n global CHEC_DATE , CHEC_TIME , SIZE , SCALE , WEIGHT ,DRAWING_NUMBER\n global SHEET , TITLE , DESCRIPTION, COMPANY , COPYRIGHT\n global Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I\n global ui\n global SymbolSwitch\n global PageActive\n\n try:\n page = App.activeDocument().getObjectsByLabel(PageActive.encode('utf-8'))[0]\n except Exception:\n page = App.activeDocument().getObjectsByLabel(PageActive)[0] if len(str(page)) != 2: self.pushButton05.setStyleSheet(\"background-color: #FF5B2B\")\n self.pushButton05.setText(\"Wait.\")\n FreeCADGui.updateGui() # rafraichi l'ecran\n\n DESIGNED_BY = (self.lineEdit_01.text())\n CREATION_DATE = (self.lineEdit_02.text())+\" - \"+(self.lineEdit_02h.text())\n CHECKED_BY = (self.lineEdit_03.text())\n CHECK_DATE = (self.lineEdit_04.text())+\" - \"+(self.lineEdit_04h.text())\n SIZE = (self.lineEdit_05.text())\n SCALE = (self.lineEdit_06.text())\n WEIGHT = (self.lineEdit_07.text())\n DRAWING_NUMBER = (self.lineEdit_08.text())\n SHEET = (self.lineEdit_09.text())\n TITLE = (self.textEdit_01.toPlainText())\n DESCRIPTION = (self.textEdit_02.toPlainText())\n COMPANY = (self.textEdit_02b.toPlainText())\n COPYRIGHT = (self.lineEdit_20.text()) Note_A = (self.lineEdit_10.text())\n Note_B = (self.lineEdit_11.text())\n Note_C = (self.lineEdit_12.text())\n Note_D = (self.lineEdit_13.text())\n Note_E = (self.lineEdit_14.text())\n Note_F = (self.lineEdit_15.text())\n Note_G = (self.lineEdit_16.text())\n Note_H = (self.lineEdit_17.text())\n Note_I = (self.lineEdit_18.text()) try:\n FreeCAD.getDocument(App.ActiveDocument.Name).getObject(page.Name).EditableTexts = [DESIGNED_BY, CREATION_DATE, CHECKED_BY, CHECK_DATE, SIZE, SCALE, WEIGHT, DRAWING_NUMBER, SHEET, TITLE, DESCRIPTION, COMPANY, COPYRIGHT, Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I, ]\n#old FreeCAD.getDocument(App.ActiveDocument.Name).getObjectsByLabel(PageActive.encode('utf-8'))[0].EditableTexts = [DESIGNED_BY, CREATION_DATE, CHECKED_BY, CHECK_DATE, SIZE, SCALE, WEIGHT, DRAWING_NUMBER, SHEET, TITLE, DESCRIPTION, COMPANY, COPYRIGHT, Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I, ]\n App.ActiveDocument.recompute()\n FreeCAD.Console.PrintMessage(\"Write done to ( \" + page.Label + \" )\" + \"\\n\")\n self.pushButton05.setStyleSheet(\"color: QPalette.Base\")\n except Exception:\n FreeCAD.Console.PrintError(\"Error write cartouche or verify the selected page ( \" + page.Label + \" )\" + \"\\n\")\n self.pushButton05.setStyleSheet(\"background-color: red\")\n else:\n FreeCAD.Console.PrintError(\"Error selected page ( \" + Page.Label + \" )\" + \"\\n\")\n self.pushButton05.setStyleSheet(\"background-color: red\")\n\n except Exception:\n self.pushButton05.setStyleSheet(\"background-color: red\")\n FreeCAD.Console.PrintError(\"Error or not page \" + \"\\n\")\n self.pushButton05.setText(\"Write\")\n App.ActiveDocument.recompute()\n\n def on_pushButton04_clicked(self): # Bouton nettoyer\n\n self.lineEdit_01.setText(\"\")\n self.lineEdit_02.setText(\"\")\n self.lineEdit_02h.setText(\"\")\n self.lineEdit_03.setText(\"\")\n self.lineEdit_04.setText(\"\")\n self.lineEdit_04h.setText(\"\")\n self.lineEdit_05.setText(\"?\")\n self.lineEdit_06.setText(\"\")\n self.lineEdit_07.setText(\"\")\n self.lineEdit_08.setText(\"\")\n self.lineEdit_09.setText(\"\")\n self.textEdit_01.setText(\"\")\n self.textEdit_02.setText(\"\")\n self.textEdit_02b.setText(\"\")\n self.lineEdit_20.setText(\"\")\n self.lineEdit_10.setText(\"\")\n self.lineEdit_11.setText(\"\")\n self.lineEdit_12.setText(\"\")\n self.lineEdit_13.setText(\"\")\n self.lineEdit_14.setText(\"\")\n self.lineEdit_15.setText(\"\")\n self.lineEdit_16.setText(\"\")\n self.lineEdit_17.setText(\"\")\n self.lineEdit_18.setText(\"\")\n\n self.pushButton10.setStyleSheet(\"color: QPalette.Base\") # origin system\n self.label_20.setVisible(False)\n self.radioButton_0.setChecked(True)\n self.pushButton05.setEnabled(True)\n self.pushButton05.setStyleSheet(\"background-color: QPalette.Base\") # origin system\n self.groupBox.setEnabled(True)\n\n def on_pushButton03_clicked(self): # Bouton Memo\n global MDESIGNED_BY, MCREATION_DATE, MCREA_DATE , MCREA_TIME, MCHECKED_BY, MCHECK_DATE\n global MCHEC_DATE , MCHEC_TIME , MSIZE , MSCALE , MWEIGHT ,MDRAWING_NUMBER\n global MSHEET , MTITLE , MDESCRIPTION, MCOMPANY , MCOPYRIGHT\n global MNote_A, MNote_B, MNote_C, MNote_D, MNote_E, MNote_F, MNote_G, MNote_H, MNote_I\n \n self.lineEdit_01.setText(MDESIGNED_BY)\n self.lineEdit_02.setText(MCREA_DATE)\n self.lineEdit_02h.setText(MCREA_TIME)\n self.lineEdit_03.setText(MCHECKED_BY)\n self.lineEdit_04.setText(MCHEC_DATE)\n self.lineEdit_04h.setText(MCHEC_TIME)\n self.lineEdit_05.setText(\"?\") #(SIZE)\n self.lineEdit_06.setText(MSCALE)\n self.lineEdit_07.setText(MWEIGHT)\n self.lineEdit_08.setText(MDRAWING_NUMBER)\n self.lineEdit_09.setText(MSHEET)\n self.textEdit_01.setText(MTITLE)\n self.textEdit_02.setText(MDESCRIPTION)\n self.textEdit_02b.setText(MCOMPANY)\n self.lineEdit_20.setText(MCOPYRIGHT)\n self.lineEdit_10.setText(MNote_A)\n self.lineEdit_11.setText(MNote_B)\n self.lineEdit_12.setText(MNote_C)\n self.lineEdit_13.setText(MNote_D)\n self.lineEdit_14.setText(MNote_E)\n self.lineEdit_15.setText(MNote_F)\n self.lineEdit_16.setText(MNote_G)\n self.lineEdit_17.setText(MNote_H)\n self.lineEdit_18.setText(MNote_I)\n# self.lineEdit_page.setText(PageActive)\n self.radioButton_0.setChecked(True)\n\n def on_pushButton02_clicked(self): # Bouton Quitter\n App.Console.PrintMessage(\"End CartoucheFC_Full\\r\\n\")\n self.window.hide()\n FreeCADGui.Selection.removeObserver(s) # Uninstalls the resident function\n App.Console.PrintMessage(\"removeObserver\"+\"\\n\")\n\n# def on_pushButton01_clicked(self): # Bouton appel de Position\n# MainWindow.resize(210, 480)\n# executer()\n# MainWindow.resize(810, 480)\n#______________________________________________________________________________________\n\nclass SelObserver:\n print \"run..\"\n def setSelection(self,document): # Selection in ComboView\n global PageActive\n global ui\n if len(Gui.Selection.getSelection(document)) == 1:\n\n ff = ui\n ff.lineEdit_page.setStyleSheet(\"color: QPalette.Base\") # origin system\n ff.pushButton05.setEnabled(True)\n ff.pushButton05.setStyleSheet(\"background-color: QPalette.Base\") # origin system\n ff.groupBox.setEnabled(True)\n\n if (str(Gui.Selection.getSelection(document)[0].Name[0:4]) == \"Page\"):\n PageActive = str(Gui.Selection.getSelection(document)[0].Label.encode('utf-8'))\n try:\n ff.lineEdit_page.setText(unicode(PageActive,'utf-8')) # convert if accent\n except Exception:\n ff.lineEdit_page.setText(PageActive) # normal\n\n memoEntree() # entree memo click mouse\n ff.on_pushButton03_clicked() # Bouton Memo\n else:\n FreeCAD.Console.PrintError(\"Select a valid Page__________________________\" + \"\\n\")\n ff.lineEdit_page.setStyleSheet(\"color: red\")\n ff.lineEdit_page.setText(\"Select a valid Page\") # \n ff.pushButton05.setEnabled(False)\n ff.pushButton05.setStyleSheet(\"background-color: red\") # This function gives a color button\n ff.groupBox.setEnabled(False)\n\n FreeCAD.Console.PrintMessage(\" \" + \"Name Label\" + \"\\n\")\n for i in App.ActiveDocument.Objects:\n if i.Name[0:4] == \"Page\":\n name = i.Name + \" \"\n labe = i.Label+ \" \"\n FreeCAD.Console.PrintMessage(\" Valid Page : \" + name[:15] + \",\" + labe[:25] + \"\\n\")\n FreeCAD.Console.PrintError(\"_____________________________________________\" + \"\\n\")\n\nfor obj in FreeCAD.ActiveDocument.Objects: # deslectionne\n FreeCADGui.Selection.removeSelection(obj)\n\ns=SelObserver()\nFreeCADGui.Selection.addObserver(s) # install the function mode resident \n\nMainWindow = QtGui.QMainWindow()\nui = Ui_MainWindow(MainWindow)\nMainWindow.show()\n}}\n\n## Autre \n\nLes champs n\\'ont pas de limite de longueur, vérifiez l\\'affichage dans votre cartouche.\n\nCe programme crée sur votre projet un dessin représentant le symbole régional de projection, n\\'y touchez pas, il est enregistré sous forme cachée donc invisible.\n\nSi vous voulez qu\\'il soit effacée dé-commentez les lignes commentées et vice versa.\n\n\n```python\n\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_EU\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_EU\").Visibility = False\n```\n\net \n```python\n\n# App.getDocument(App.ActiveDocument.Name).removeObject(\"Symbol_US\")\n FreeCADGui.getDocument(App.ActiveDocument.Name).getObject(\"Symbol_US\").Visibility = False\n``` (j\\'avais quelque fois une erreur à l\\'exécution quand le symbole était effacé)\n\nVous pouvez aussi utiliser une feuille avec le symbole présent dans le cartouche et ne pas utiliser cette fonction.\n\nCe module travaille avec le module de mise en plan de FreeCAD la feuille s\\'appelle **Page**, ne pas modifier le nom de cette page !\n\n## Version\n\nver \\\"00.10\\\" : 15/02/2017 : réglage pour pages multiples (Il est possible de perdre une page s\\'il y en a trop ! )\n\nver \\\"00.09\\\" : 10/02/2017 : ajout de boutons radio pour le choix du type de symbole et correction de la position du symbole dans les pages (la précédente version effaçait le symbole d\\'une page pour le reconstruire dans la nouvelle page) et ajout sélection par souris et de tests sur le choix des pages\n\nver \\\"00.08 : 06/02/2017 : La boîte de dialoguenom de la page accepteles accents et autres caractères\n\nver \\\"00.07 : 05/02/2017 : ajout d\\'une fenêtre \\\"Nom\\\" pour pouvoir remplir le cartouche de différentes feuilles dans le même projet PS: les caracteres accentué ne sont pas acceptés \\\"àùé \\...\\\"\n\nver 00.06 : 13/10/2016 : sélection du format de la page et position automatique du symbole de convention (pour FreeCAD ver 0.17)\n\nver 5 : 08/08/2014 PyQt4 and PySide\n\n\n
\n\n\n
\n\n\n
\n\n# Macro CartoucheFC 2 \n\n\n
\n\n\n{{Macro\n|Name=Macro CartoucheFC 2\n|Icon=Macro_CartoucheFC_2.png\n|Description=This macro is a complete application, it allows to fill the cartridge of the drawing sheet with full editabletext (Only For [Drawing Workbench](Drawing_Workbench.md)).\n|Author=Mario52\n|Version=5.0\n|Date=2014-08-08\n|FCVersion=All version using Drawing WorkBench\n|Download=[https://www.freecadweb.org/wiki/images/0/00/Macro_CartoucheFC_2.png ToolBar Icon]\n}}\n\n## Description \n\nThis macro is a complete application, it allows to fill simply all the fields of the cartridge A3 Landscape english\n\n\"Macro\n\nThe picture represents the hierarchy of filling the fields occupied in the \\\"textEditable\\\" window in FreeCAD\n\n## Utilisation \n\nUsage is very easy, run the macro and modify the fields.\n\n- The **Quit** button to exit the application.\n- The **Memo** button renders the contents of the cartridge at the opening of the macro.\n- The **Clear** button clean all the fields in the macro (fields are rendered by pressing on the **Memo**).\n- The **Apply** button applies the changes to the template.\n\nThe window stays above all windows to visualize the changes (this function can be unpleasant if you decide to open a new window and remains unavailable)\n\n**PS: Some characters such as & \\$ are not accepted (and possibly other special characters).**\n\nIf you have any questions or want to add a function, you can address you on the french forum [Remplir cartouche](http://forum.freecadweb.org/viewtopic.php?f=12&t=2049)\n\n## Code \n\nToolBar Icon ![](images/Macro_CartoucheFC_2.png )\n\n**Macro_CartoucheFC_2.FcMacro**\n\n\n{{MacroCode|code=\n\n# -*- coding: utf-8 -*-\n\"\"\"\n***************************************************************************\n* Copyright (c) 2014 *\n* *\n* This file is a supplement to the FreeCAD CAD development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n* *\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n***************************************************************************\n* WARNING! All changes in this file will be lost and * \n* may cause malfunction of the program *\n***************************************************************************\n\"\"\"\n# Macro_CartoucheFC_2.FcMacro\n# \n# il faut que la page (drawing viewer) s'appelle \" Page \" qui est le nom par défaut du module Drawing\n# cette macro fonctionne avec la feuille A3_Landscape_ qui possede tous les champs EditableTexts\n# \n# http://www.freecadweb.org/wiki/index.php?title=Drawing_templates\n# Fill the area of the cartridge\n# It is necessary that the page (drawing viewer) is called \"Page\", which is the default name of the Drawing module\n# Python 2.6\n# 08/08/2014 ver 5.0 (pour cartouche modèle 2 (A3 Landscape english)) # PyQt and PySide \n# Created: by mario52\n# PyQt and PySide \n\n#OS: Windows Vista\n#Word size: 32-bit\n#Version: 0.14.3700 (Git)\n#Branch: releases/FreeCAD-0-14\n#Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1\n#Python version: 2.6.2\n#Qt version: 4.5.2\n#Coin version: 3.1.0\n#SoQt version: 1.4.1\n\ntry:\n import PyQt4 # PyQt4\n from PyQt4 import QtCore, QtGui # PyQt4\nexcept Exception:\n import PySide # PySide\n from PySide import QtCore, QtGui # PySide\n\nimport Draft, Part, FreeCAD, math, PartGui, FreeCADGui\nfrom math import sqrt, pi, sin, cos, asin\nfrom FreeCAD import Base\n\ndef utf8(unio):\n return unicode(unio).encode('UTF8')\n\nglobal path\nglobal Drawn_by ; Drawn_by = \"\" # lineEdit_001\nglobal DRAWN_BY ; DRAWN_BY = \"\" # lineEdit_002\nglobal Controlled_by ; Controlled_by = \"\" # lineEdit_003\nglobal CONTROLLED_BY ; CONTROLLED_BY = \"\" # lineEdit_004\nglobal Date ; Date = \"\" # lineEdit_005\nglobal DATE ; DATE = \"\" # lineEdit_006\nglobal Controlled_2 ; Controlled_2 = \"\" # lineEdit_007\nglobal CONTROLLED_2 ; CONTROLLED_2 = \"\" # lineEdit_008\nglobal Controlled_3 ; Controlled_3 = \"\" # lineEdit_009\nglobal CONTROLLED_3 ; CONTROLLED_3 = \"\" # lineEdit_010\nglobal SCALE ; SCALE = \"\" # lineEdit_011\nglobal MOD ; MOD = \"\" # lineEdit_012\nglobal COMPANY ; COMPANY = \"\" # lineEdit_013\nglobal ADRESS ; ADRESS = \"\" # lineEdit_014\nglobal COUNTRY ; COUNTRY = \"\" # lineEdit_015\nglobal PART_NAME ; PART_NAME = \"\" # lineEdit_016\nglobal Project_number ; Project_number = \"\" # lineEdit_017\nglobal A_ ; A_ = \"\" # lineEdit_018\nglobal A__ ; A__ = \"\" # lineEdit_019\nglobal B_ ; B_ = \"\" # lineEdit_020\nglobal B__ ; B__ = \"\" # lineEdit_021\nglobal C_ ; C_ = \"\" # lineEdit_022\nglobal C__ ; C__ = \"\" # lineEdit_023\nglobal D_ ; D_ = \"\" # lineEdit_024\nglobal D__ ; D__ = \"\" # lineEdit_025\nglobal E_ ; E_ = \"\" # lineEdit_026\nglobal E__ ; E__ = \"\" # lineEdit_027\nglobal Quantity ; Quantity = \"\" # lineEdit_028\nglobal Part_ID_number ; Part_ID_number = \"\" # lineEdit_029\nglobal Fabrication_tolerances ; Fabrication_tolerance = \"\" #lineEdit_030\nglobal Material ; Material = \"\" # lineEdit_031\nglobal _01 ; _01 = \"\" # lineEdit_032\nglobal _001_001 ; _001_001 = \"\" # lineEdit_033\nglobal ISO2768_fh ; ISO2768_fh = \"\" # lineEdit_034\nglobal IRON ; IRON = \"\" # lineEdit_035\n\npath = FreeCAD.ConfigGet(\"AppHomePath\")\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\ndef errorDialog(msg):\n # Create a simple dialog QMessageBox\n # The first argument indicates the icon used: one of QtGui.QMessageBox.{NoIcon, Information, Warning, Critical, Question} \n diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u\"Error Message\",msg)\n try:\n diag.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4 cette fonction met la fenêtre en avant\n except Exception:\n diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenêtre en avant\n #diag.setWindowModality(QtCore.Qt.ApplicationModal) # la fonction a été désactivée pour favoriser \"WindowStaysOnTopHint\"\n diag.exec_()\n\ntry:\n Drawn_by = App.activeDocument().getObject(\"Page\").EditableTexts[0] # lineEdit_001\n DRAWN_BY = App.activeDocument().getObject(\"Page\").EditableTexts[1] # lineEdit_002\n Controlled_by = App.activeDocument().getObject(\"Page\").EditableTexts[2] # lineEdit_003\n CONTROLLED_BY = App.activeDocument().getObject(\"Page\").EditableTexts[3] # lineEdit_004\n Date = App.activeDocument().getObject(\"Page\").EditableTexts[4] # lineEdit_005\n DATE = App.activeDocument().getObject(\"Page\").EditableTexts[5] # lineEdit_006\n Controlled_2 = App.activeDocument().getObject(\"Page\").EditableTexts[6] # lineEdit_007\n CONTROLLED_2 = App.activeDocument().getObject(\"Page\").EditableTexts[7] # lineEdit_008\n Controlled_3 = App.activeDocument().getObject(\"Page\").EditableTexts[8] # lineEdit_009\n CONTROLLED_3 = App.activeDocument().getObject(\"Page\").EditableTexts[9] # lineEdit_010\n SCALE = App.activeDocument().getObject(\"Page\").EditableTexts[10] # lineEdit_011\n MOD = App.activeDocument().getObject(\"Page\").EditableTexts[11] # lineEdit_012\n COMPANY = App.activeDocument().getObject(\"Page\").EditableTexts[12] # lineEdit_013\n ADRESS = App.activeDocument().getObject(\"Page\").EditableTexts[13] # lineEdit_014\n COUNTRY = App.activeDocument().getObject(\"Page\").EditableTexts[14] # lineEdit_015\n PART_NAME = App.activeDocument().getObject(\"Page\").EditableTexts[15] # lineEdit_016\n Project_number = App.activeDocument().getObject(\"Page\").EditableTexts[16] # lineEdit_017\n A_ = App.activeDocument().getObject(\"Page\").EditableTexts[17] # lineEdit_018\n A__ = App.activeDocument().getObject(\"Page\").EditableTexts[18] # lineEdit_019\n B_ = App.activeDocument().getObject(\"Page\").EditableTexts[19] # lineEdit_020\n B__ = App.activeDocument().getObject(\"Page\").EditableTexts[20] # lineEdit_021\n C_ = App.activeDocument().getObject(\"Page\").EditableTexts[21] # lineEdit_022\n C__ = App.activeDocument().getObject(\"Page\").EditableTexts[22] # lineEdit_023\n D_ = App.activeDocument().getObject(\"Page\").EditableTexts[23] # lineEdit_024\n D__ = App.activeDocument().getObject(\"Page\").EditableTexts[24] # lineEdit_025\n E_ = App.activeDocument().getObject(\"Page\").EditableTexts[25] # lineEdit_026\n E__ = App.activeDocument().getObject(\"Page\").EditableTexts[26] # lineEdit_027\n Quantity= App.activeDocument().getObject(\"Page\").EditableTexts[27] # lineEdit_028\n Part_ID_number = App.activeDocument().getObject(\"Page\").EditableTexts[28] # lineEdit_029\n Fabrication_tolerance = App.activeDocument().getObject(\"Page\").EditableTexts[29] #lineEdit_030\n Material = App.activeDocument().getObject(\"Page\").EditableTexts[30] # lineEdit_031\n _01 = App.activeDocument().getObject(\"Page\").EditableTexts[31] # lineEdit_032\n _001_001 = App.activeDocument().getObject(\"Page\").EditableTexts[32] # lineEdit_033\n ISO2768_fh = App.activeDocument().getObject(\"Page\").EditableTexts[33] # lineEdit_034\n IRON = App.activeDocument().getObject(\"Page\").EditableTexts[34] # lineEdit_035\n\nexcept:\n errorDialog(\"Error read cartridge\")\n\nclass Ui_MainWindow(object):\n\n def __init__(self, MainWindow):\n self.window = MainWindow\n\n MainWindow.setObjectName(_fromUtf8(\"MainWindow\"))\n MainWindow.resize(849, 462)\n MainWindow.setMaximumSize(QtCore.QSize(849, 462))\n self.centralWidget = QtGui.QWidget(MainWindow)\n self.centralWidget.setObjectName(_fromUtf8(\"centralWidget\"))\n\n self.pushButton02 = QtGui.QPushButton(self.centralWidget)\n self.pushButton02.setGeometry(QtCore.QRect(210, 420, 93, 28))\n self.pushButton02.setObjectName(_fromUtf8(\"pushButton_2\"))\n self.pushButton02.clicked.connect(self.on_pushButton02_clicked) # Bouton Quitter # Quit\n\n self.pushButton03 = QtGui.QPushButton(self.centralWidget)\n self.pushButton03.setGeometry(QtCore.QRect(320, 420, 93, 28))\n self.pushButton03.setObjectName(_fromUtf8(\"pushButton_3\"))\n self.pushButton03.clicked.connect(self.on_pushButton03_clicked) # Bouton Memo # Memo\n\n self.pushButton04 = QtGui.QPushButton(self.centralWidget)\n self.pushButton04.setGeometry(QtCore.QRect(430, 420, 93, 28))\n self.pushButton04.setObjectName(_fromUtf8(\"pushButton_4\"))\n self.pushButton04.clicked.connect(self.on_pushButton04_clicked) # Bouton nettoyer # Clear\n\n self.pushButton01 = QtGui.QPushButton(self.centralWidget)\n self.pushButton01.setGeometry(QtCore.QRect(540, 420, 93, 28))\n self.pushButton01.setObjectName(_fromUtf8(\"pushButton\"))\n self.pushButton01.clicked.connect(self.on_pushButton01_clicked) # Bouton Appliquer # Apply\n\n self.lineEdit_001 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_001.setGeometry(QtCore.QRect(540, 100, 101, 22))\n self.lineEdit_001.setObjectName(_fromUtf8(\"lineEdit_001\"))\n self.lineEdit_001.setText(Drawn_by)\n\n self.lineEdit_002 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_002.setGeometry(QtCore.QRect(650, 100, 121, 22))\n self.lineEdit_002.setObjectName(_fromUtf8(\"lineEdit_002\"))\n self.lineEdit_002.setText(DRAWN_BY)\n\n self.lineEdit_003 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_003.setGeometry(QtCore.QRect(540, 140, 101, 22))\n self.lineEdit_003.setObjectName(_fromUtf8(\"lineEdit_003\"))\n self.lineEdit_003.setText(Controlled_by)\n\n self.lineEdit_004 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_004.setGeometry(QtCore.QRect(650, 140, 121, 22))\n self.lineEdit_004.setObjectName(_fromUtf8(\"lineEdit_004\"))\n self.lineEdit_004.setText(CONTROLLED_BY)\n\n self.lineEdit_005 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_005.setGeometry(QtCore.QRect(540, 180, 101, 22))\n self.lineEdit_005.setObjectName(_fromUtf8(\"lineEdit_005\"))\n self.lineEdit_005.setText(Date)\n\n self.lineEdit_006 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_006.setGeometry(QtCore.QRect(650, 180, 121, 22))\n self.lineEdit_006.setObjectName(_fromUtf8(\"lineEdit_006\"))\n self.lineEdit_006.setText(DATE)\n\n self.lineEdit_007 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_007.setGeometry(QtCore.QRect(540, 220, 101, 22))\n self.lineEdit_007.setObjectName(_fromUtf8(\"lineEdit_007\"))\n self.lineEdit_007.setText(Controlled_2)\n\n self.lineEdit_008 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_008.setGeometry(QtCore.QRect(650, 220, 121, 22))\n self.lineEdit_008.setObjectName(_fromUtf8(\"lineEdit_008\"))\n self.lineEdit_008.setText(CONTROLLED_2)\n\n self.lineEdit_009 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_009.setGeometry(QtCore.QRect(540, 260, 101, 22))\n self.lineEdit_009.setObjectName(_fromUtf8(\"lineEdit_009\"))\n self.lineEdit_009.setText(Controlled_3)\n\n self.lineEdit_010 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_010.setGeometry(QtCore.QRect(650, 260, 121, 22))\n self.lineEdit_010.setObjectName(_fromUtf8(\"lineEdit_010\"))\n self.lineEdit_010.setText(CONTROLLED_3)\n\n self.lineEdit_011 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_011.setGeometry(QtCore.QRect(780, 100, 61, 61))\n self.lineEdit_011.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_011.setObjectName(_fromUtf8(\"lineEdit_011\"))\n self.lineEdit_011.setText(SCALE)\n\n self.lineEdit_012 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_012.setGeometry(QtCore.QRect(10, 100, 131, 181))\n font = QtGui.QFont()\n font.setPointSize(20)\n self.lineEdit_012.setFont(font)\n self.lineEdit_012.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_012.setObjectName(_fromUtf8(\"lineEdit_012\"))\n self.lineEdit_012.setText(MOD)\n\n self.lineEdit_013 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_013.setGeometry(QtCore.QRect(10, 300, 261, 22))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_013.setFont(font)\n self.lineEdit_013.setObjectName(_fromUtf8(\"lineEdit_013\"))\n self.lineEdit_013.setText(COMPANY)\n\n self.lineEdit_014 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_014.setGeometry(QtCore.QRect(10, 340, 261, 22))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_014.setFont(font)\n self.lineEdit_014.setObjectName(_fromUtf8(\"lineEdit_014\"))\n self.lineEdit_014.setText(ADRESS)\n\n self.lineEdit_015 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_015.setGeometry(QtCore.QRect(10, 380, 261, 22))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_015.setFont(font)\n self.lineEdit_015.setObjectName(_fromUtf8(\"lineEdit_015\"))\n self.lineEdit_015.setText(COUNTRY)\n\n self.lineEdit_016 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_016.setGeometry(QtCore.QRect(280, 300, 301, 101))\n font = QtGui.QFont()\n font.setPointSize(14)\n self.lineEdit_016.setFont(font)\n self.lineEdit_016.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_016.setObjectName(_fromUtf8(\"lineEdit_016\"))\n self.lineEdit_016.setText(PART_NAME)\n\n self.lineEdit_017 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_017.setGeometry(QtCore.QRect(590, 300, 251, 101))\n self.lineEdit_017.setMinimumSize(QtCore.QSize(0, 0))\n font = QtGui.QFont()\n font.setPointSize(8)\n self.lineEdit_017.setFont(font)\n self.lineEdit_017.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_017.setObjectName(_fromUtf8(\"lineEdit_017\"))\n self.lineEdit_017.setText(Project_number)\n\n self.lineEdit_018 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_018.setGeometry(QtCore.QRect(150, 260, 71, 22))\n self.lineEdit_018.setObjectName(_fromUtf8(\"lineEdit_018\"))\n self.lineEdit_018.setText(A_)\n\n self.lineEdit_019 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_019.setGeometry(QtCore.QRect(230, 260, 301, 22))\n self.lineEdit_019.setObjectName(_fromUtf8(\"lineEdit_019\"))\n self.lineEdit_019.setText(A__)\n\n self.lineEdit_020 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_020.setGeometry(QtCore.QRect(150, 220, 71, 22))\n self.lineEdit_020.setObjectName(_fromUtf8(\"lineEdit_020\"))\n self.lineEdit_020.setText(B_)\n\n self.lineEdit_021 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_021.setGeometry(QtCore.QRect(230, 220, 301, 22))\n self.lineEdit_021.setObjectName(_fromUtf8(\"lineEdit_021\"))\n self.lineEdit_021.setText(B__)\n\n self.lineEdit_022 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_022.setGeometry(QtCore.QRect(150, 180, 71, 22))\n self.lineEdit_022.setObjectName(_fromUtf8(\"lineEdit_022\"))\n self.lineEdit_022.setText(C_)\n\n self.lineEdit_023 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_023.setGeometry(QtCore.QRect(230, 180, 301, 22))\n self.lineEdit_023.setObjectName(_fromUtf8(\"lineEdit_023\"))\n self.lineEdit_023.setText(C__)\n\n self.lineEdit_024 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_024.setGeometry(QtCore.QRect(150, 140, 71, 22))\n self.lineEdit_024.setObjectName(_fromUtf8(\"lineEdit_024\"))\n self.lineEdit_024.setText(D_)\n\n self.lineEdit_025 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_025.setGeometry(QtCore.QRect(230, 140, 301, 22))\n self.lineEdit_025.setObjectName(_fromUtf8(\"lineEdit_025\"))\n self.lineEdit_025.setText(D__)\n\n self.lineEdit_026 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_026.setGeometry(QtCore.QRect(150, 100, 71, 22))\n self.lineEdit_026.setObjectName(_fromUtf8(\"lineEdit_026\"))\n self.lineEdit_026.setText(E_)\n\n self.lineEdit_027 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_027.setGeometry(QtCore.QRect(230, 100, 301, 22))\n self.lineEdit_027.setObjectName(_fromUtf8(\"lineEdit_027\"))\n self.lineEdit_027.setText(E__)\n\n self.lineEdit_028 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_028.setGeometry(QtCore.QRect(10, 60, 101, 22))\n self.lineEdit_028.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_028.setObjectName(_fromUtf8(\"lineEdit_028\"))\n self.lineEdit_028.setText(Quantity)\n\n self.lineEdit_029 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_029.setGeometry(QtCore.QRect(120, 60, 131, 22))\n self.lineEdit_029.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_029.setObjectName(_fromUtf8(\"lineEdit_029\"))\n self.lineEdit_029.setText(Part_ID_number)\n\n self.lineEdit_030 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_030.setGeometry(QtCore.QRect(260, 60, 381, 22))\n self.lineEdit_030.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_030.setObjectName(_fromUtf8(\"lineEdit_030\"))\n self.lineEdit_030.setText(Fabrication_tolerance)\n\n self.lineEdit_031 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_031.setGeometry(QtCore.QRect(650, 60, 191, 22))\n self.lineEdit_031.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_031.setObjectName(_fromUtf8(\"lineEdit_031\"))\n self.lineEdit_031.setText(Material)\n\n self.lineEdit_032 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_032.setGeometry(QtCore.QRect(10, 20, 101, 22))\n self.lineEdit_032.setObjectName(_fromUtf8(\"lineEdit_032\"))\n self.lineEdit_032.setText(_01)\n\n self.lineEdit_033 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_033.setGeometry(QtCore.QRect(120, 20, 131, 22))\n self.lineEdit_033.setObjectName(_fromUtf8(\"lineEdit_033\"))\n self.lineEdit_033.setText(_001_001)\n\n self.lineEdit_034 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_034.setGeometry(QtCore.QRect(260, 20, 381, 22))\n self.lineEdit_034.setObjectName(_fromUtf8(\"lineEdit_034\"))\n self.lineEdit_034.setText(ISO2768_fh)\n\n self.lineEdit_035 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_035.setGeometry(QtCore.QRect(650, 20, 191, 22))\n self.lineEdit_035.setObjectName(_fromUtf8(\"lineEdit_035\"))\n self.lineEdit_035.setText(IRON)\n\n self.label_1 = QtGui.QLabel(self.centralWidget)\n self.label_1.setGeometry(QtCore.QRect(790, 85, 41, 16))\n self.label_1.setObjectName(_fromUtf8(\"label\"))\n self.label_2 = QtGui.QLabel(self.centralWidget)\n self.label_2.setGeometry(QtCore.QRect(10, 325, 53, 16))\n self.label_2.setObjectName(_fromUtf8(\"label_2\"))\n self.label_3 = QtGui.QLabel(self.centralWidget)\n self.label_3.setGeometry(QtCore.QRect(10, 365, 53, 16))\n self.label_3.setObjectName(_fromUtf8(\"label_3\"))\n self.label_4 = QtGui.QLabel(self.centralWidget)\n self.label_4.setGeometry(QtCore.QRect(10, 285, 161, 16))\n self.label_4.setObjectName(_fromUtf8(\"label_4\"))\n self.label_5 = QtGui.QLabel(self.centralWidget)\n self.label_5.setGeometry(QtCore.QRect(280, 285, 151, 16))\n self.label_5.setObjectName(_fromUtf8(\"label_5\"))\n self.label_6 = QtGui.QLabel(self.centralWidget)\n self.label_6.setGeometry(QtCore.QRect(590, 285, 191, 16))\n self.label_6.setObjectName(_fromUtf8(\"label_6\"))\n self.label_7 = QtGui.QLabel(self.centralWidget)\n self.label_7.setGeometry(QtCore.QRect(10, 85, 53, 16))\n self.label_7.setObjectName(_fromUtf8(\"label_7\"))\n self.label_8 = QtGui.QLabel(self.centralWidget)\n self.label_8.setGeometry(QtCore.QRect(150, 85, 53, 16))\n self.label_8.setObjectName(_fromUtf8(\"label_8\"))\n self.label_9 = QtGui.QLabel(self.centralWidget)\n self.label_9.setGeometry(QtCore.QRect(540, 85, 61, 16))\n self.label_9.setObjectName(_fromUtf8(\"label_9\"))\n self.label_10 = QtGui.QLabel(self.centralWidget)\n self.label_10.setGeometry(QtCore.QRect(540, 125, 101, 16))\n self.label_10.setObjectName(_fromUtf8(\"label_10\"))\n self.label_11 = QtGui.QLabel(self.centralWidget)\n self.label_11.setGeometry(QtCore.QRect(540, 165, 53, 16))\n self.label_11.setObjectName(_fromUtf8(\"label_11\"))\n self.label_12 = QtGui.QLabel(self.centralWidget)\n self.label_12.setGeometry(QtCore.QRect(540, 205, 81, 16))\n self.label_12.setObjectName(_fromUtf8(\"label_12\"))\n self.label_13 = QtGui.QLabel(self.centralWidget)\n self.label_13.setGeometry(QtCore.QRect(540, 245, 81, 16))\n self.label_13.setObjectName(_fromUtf8(\"label_13\"))\n self.label_14 = QtGui.QLabel(self.centralWidget)\n self.label_14.setGeometry(QtCore.QRect(10, 45, 71, 16))\n self.label_14.setObjectName(_fromUtf8(\"label_14\"))\n self.label_15 = QtGui.QLabel(self.centralWidget)\n self.label_15.setGeometry(QtCore.QRect(120, 45, 121, 16))\n self.label_15.setObjectName(_fromUtf8(\"label_15\"))\n self.label_16 = QtGui.QLabel(self.centralWidget)\n self.label_16.setGeometry(QtCore.QRect(260, 45, 141, 16))\n self.label_16.setObjectName(_fromUtf8(\"label_16\"))\n self.label_17 = QtGui.QLabel(self.centralWidget)\n self.label_17.setGeometry(QtCore.QRect(650, 45, 71, 16))\n self.label_17.setObjectName(_fromUtf8(\"label_17\"))\n\n self.graphicsView = QtGui.QGraphicsView(self.centralWidget) # Fenêtre pour logo # Logo windows\n self.graphicsView.setGeometry(QtCore.QRect(780, 220, 61, 61))\n self.graphicsView.setObjectName(_fromUtf8(\"graphicsView\"))\n self.label_18 = QtGui.QLabel(self.centralWidget)\n self.label_18.setGeometry(QtCore.QRect(790, 205, 41, 16))\n self.label_18.setObjectName(_fromUtf8(\"label_18\"))\n MainWindow.setCentralWidget(self.centralWidget)\n\n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n\n def retranslateUi(self, MainWindow):\n try:\n MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4\n except Exception:\n MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide\n\n MainWindow.setWindowTitle(_translate(\"MainWindow\", \"Cartouche mod 2\", None))\n\n self.pushButton01.setText(_translate(\"MainWindow\", \"Apply\", None))\n self.pushButton02.setText(_translate(\"MainWindow\", \"Quit\", None))\n self.pushButton03.setText(_translate(\"MainWindow\", \"Memo\", None))\n self.pushButton04.setText(_translate(\"MainWindow\", \"Clear\", None))\n\n self.lineEdit_001.setText(_translate(\"MainWindow\", \"Drawn_by\", None))\n self.lineEdit_002.setText(_translate(\"MainWindow\", \"DRAWN_BY\", None))\n self.lineEdit_003.setText(_translate(\"MainWindow\", \"Controlled_by\", None))\n self.lineEdit_004.setText(_translate(\"MainWindow\", \"CONTROLLED_BY\", None))\n self.lineEdit_005.setText(_translate(\"MainWindow\", \"Date\", None))\n self.lineEdit_006.setText(_translate(\"MainWindow\", \"DATE\", None))\n self.lineEdit_007.setText(_translate(\"MainWindow\", \"Controlled_2\", None))\n self.lineEdit_008.setText(_translate(\"MainWindow\", \"CONTROLLED_2\", None))\n self.lineEdit_009.setText(_translate(\"MainWindow\", \"Controlled_3\", None))\n self.lineEdit_010.setText(_translate(\"MainWindow\", \"CONTROLLED_3\", None))\n self.lineEdit_011.setText(_translate(\"MainWindow\", \"SCALE\", None))\n self.lineEdit_012.setText(_translate(\"MainWindow\", \"MOD\", None))\n self.lineEdit_013.setText(_translate(\"MainWindow\", \"COMPANY\", None))\n self.lineEdit_014.setText(_translate(\"MainWindow\", \"ADRESS\", None))\n self.lineEdit_015.setText(_translate(\"MainWindow\", \"COUNTRY\", None))\n self.lineEdit_016.setText(_translate(\"MainWindow\", \"PART_NAME\", None))\n self.lineEdit_017.setText(_translate(\"MainWindow\", \"Project_number\", None))\n self.lineEdit_018.setText(_translate(\"MainWindow\", \"A_\", None))\n self.lineEdit_019.setText(_translate(\"MainWindow\", \"A__\", None))\n self.lineEdit_020.setText(_translate(\"MainWindow\", \"B_\", None))\n self.lineEdit_021.setText(_translate(\"MainWindow\", \"B__\", None))\n self.lineEdit_022.setText(_translate(\"MainWindow\", \"C_\", None))\n self.lineEdit_023.setText(_translate(\"MainWindow\", \"C__\", None))\n self.lineEdit_024.setText(_translate(\"MainWindow\", \"D_\", None))\n self.lineEdit_025.setText(_translate(\"MainWindow\", \"D__\", None))\n self.lineEdit_026.setText(_translate(\"MainWindow\", \"E_\", None))\n self.lineEdit_027.setText(_translate(\"MainWindow\", \"E__\", None))\n self.lineEdit_028.setText(_translate(\"MainWindow\", \"Quantity\", None))\n self.lineEdit_029.setText(_translate(\"MainWindow\", \"Part_ID_number\", None))\n self.lineEdit_030.setText(_translate(\"MainWindow\", \"Fabrication_tolerance\", None))\n self.lineEdit_031.setText(_translate(\"MainWindow\", \"Material\", None))\n self.lineEdit_032.setText(_translate(\"MainWindow\", \"_01\", None))\n self.lineEdit_033.setText(_translate(\"MainWindow\", \"_001_001\", None))\n self.lineEdit_034.setText(_translate(\"MainWindow\", \"ISO2768_fh\", None))\n self.lineEdit_035.setText(_translate(\"MainWindow\", \"IRON\", None))\n\n self.label_1.setText(_translate(\"MainWindow\", \"Scale :\", None))\n self.label_2.setText(_translate(\"MainWindow\", \"Address :\", None))\n self.label_3.setText(_translate(\"MainWindow\", \"Country :\", None))\n self.label_4.setText(_translate(\"MainWindow\", \"Company name :\", None))\n self.label_5.setText(_translate(\"MainWindow\", \"Part name :\", None))\n self.label_6.setText(_translate(\"MainWindow\", \"Project number / id :\", None))\n self.label_7.setText(_translate(\"MainWindow\", \"Size :\", None))\n self.label_8.setText(_translate(\"MainWindow\", \"Notes :\", None))\n self.label_9.setText(_translate(\"MainWindow\", \"Draw by :\", None))\n self.label_10.setText(_translate(\"MainWindow\", \"Controlled by :\", None))\n self.label_11.setText(_translate(\"MainWindow\", \"Date :\", None))\n self.label_12.setText(_translate(\"MainWindow\", \"Controlled 2 :\", None))\n self.label_13.setText(_translate(\"MainWindow\", \"Controlled 3 :\", None))\n self.label_14.setText(_translate(\"MainWindow\", \"Quantity :\", None))\n self.label_15.setText(_translate(\"MainWindow\", \"Part ID / Number :\", None))\n self.label_16.setText(_translate(\"MainWindow\", \"Fabrication tolerance :\", None))\n self.label_17.setText(_translate(\"MainWindow\", \"Material :\", None))\n self.label_18.setText(_translate(\"MainWindow\", \"Logo :\", None))\n\n def on_pushButton01_clicked(self): # Bouton Appliquer # Appli buttom\n Drawn_by = utf8(self.lineEdit_001.text())\n DRAWN_BY = utf8(self.lineEdit_002.text())\n Controlled_by = utf8(self.lineEdit_003.text())\n CONTROLLED_BY = utf8(self.lineEdit_004.text())\n Date = utf8(self.lineEdit_005.text())\n DATE = utf8(self.lineEdit_006.text())\n Controlled_2 = utf8(self.lineEdit_007.text())\n CONTROLLED_2 = utf8(self.lineEdit_008.text())\n Controlled_3 = utf8(self.lineEdit_009.text())\n CONTROLLED_3 = utf8(self.lineEdit_010.text())\n SCALE = utf8(self.lineEdit_011.text())\n MOD = utf8(self.lineEdit_012.text())\n COMPANY = utf8(self.lineEdit_013.text())\n ADRESS = utf8(self.lineEdit_014.text())\n COUNTRY = utf8(self.lineEdit_015.text())\n PART_NAME = utf8(self.lineEdit_016.text())\n Project_number = utf8(self.lineEdit_017.text())\n A_ = utf8(self.lineEdit_018.text())\n A__ = utf8(self.lineEdit_019.text())\n B_ = utf8(self.lineEdit_020.text())\n B__ = utf8(self.lineEdit_021.text())\n C_ = utf8(self.lineEdit_022.text())\n C__ = utf8(self.lineEdit_023.text())\n D_ = utf8(self.lineEdit_024.text())\n D__ = utf8(self.lineEdit_025.text())\n E_ = utf8(self.lineEdit_026.text())\n E__ = utf8(self.lineEdit_027.text())\n Quantity = utf8(self.lineEdit_028.text())\n Part_ID_number = utf8(self.lineEdit_029.text())\n Fabrication_tolerance = utf8(self.lineEdit_030.text())\n Material = utf8(self.lineEdit_031.text())\n _01 = utf8(self.lineEdit_032.text())\n _001_001 = utf8(self.lineEdit_033.text())\n ISO2768_fh = utf8(self.lineEdit_034.text())\n IRON = utf8(self.lineEdit_035.text())\n\n try:\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts =[unicode(Drawn_by,'utf-8'), unicode(DRAWN_BY,'utf-8'), unicode(Controlled_by,'utf-8'), unicode(CONTROLLED_BY,'utf-8'), unicode(Date,'utf-8'), unicode(DATE,'utf-8'), unicode(Controlled_2, 'utf-8'), unicode(CONTROLLED_2,'utf-8'), unicode(Controlled_3,'utf-8'), unicode(CONTROLLED_3,'utf-8'), unicode(SCALE,'utf-8'), unicode(MOD,'utf-8'), unicode(COMPANY,'utf-8'), unicode(ADRESS,'utf-8'), unicode(COUNTRY, 'utf-8'), unicode(PART_NAME,'utf-8'), unicode(Project_number,'utf-8'), unicode(A_,'utf-8'), unicode(A__,'utf-8'), unicode(B_,'utf-8'), unicode(B__,'utf-8'), unicode(C_,'utf-8'), unicode(C__,'utf-8'), unicode(D_,'utf-8'), unicode(D__,'utf-8'), unicode(E_,'utf-8'), unicode(E__,'utf-8'), unicode(Quantity,'utf-8'), unicode(Part_ID_number,'utf-8'), unicode(Fabrication_tolerance,'utf-8'), unicode(Material,'utf-8'), unicode(_01,'utf-8'), unicode(_001_001,'utf-8'), unicode(ISO2768_fh,'utf-8'), unicode(IRON,'utf-8'),] # PyQt4\n App.ActiveDocument.recompute()\n except Exception:#\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts =[Drawn_by.encode('utf-8'), DRAWN_BY.encode('utf-8'), Controlled_by.encode('utf-8'), CONTROLLED_BY.encode('utf-8'), Date.encode('utf-8'), DATE.encode('utf-8'), Controlled_2.encode('utf-8'), CONTROLLED_2.encode('utf-8'), Controlled_3.encode('utf-8'), CONTROLLED_3.encode('utf-8'), SCALE.encode('utf-8'), MOD.encode('utf-8'), COMPANY.encode('utf-8'), ADRESS.encode('utf-8'), COUNTRY.encode('utf-8'), PART_NAME.encode('utf-8'), Project_number.encode('utf-8'), A_.encode('utf-8'), A__.encode('utf-8'), B_.encode('utf-8'), B__.encode('utf-8'), C_.encode('utf-8'), C__.encode('utf-8'), D_.encode('utf-8'), D__.encode('utf-8'), E_.encode('utf-8'), E__.encode('utf-8'), Quantity.encode('utf-8'), Part_ID_number.encode('utf-8'), Fabrication_tolerance.encode('utf-8'), Material.encode('utf-8'), _01.encode('utf-8'), _001_001.encode('utf-8'), ISO2768_fh.encode('utf-8'), IRON.encode('utf-8'),] # PySide\n App.ActiveDocument.recompute()\n\n def on_pushButton04_clicked(self): # Bouton nettoyer # Clear buttom\n\n Drawn_by = \"\" ;self.lineEdit_001.setText(\"\")\n DRAWN_BY = \"\" ;self.lineEdit_002.setText(\"\")\n Controlled_by = \"\" ;self.lineEdit_003.setText(\"\")\n CONTROLLED_BY = \"\" ;self.lineEdit_004.setText(\"\")\n Date = \"\" ;self.lineEdit_005.setText(\"\")\n DATE = \"\" ;self.lineEdit_006.setText(\"\")\n Controlled_2 = \"\" ;self.lineEdit_007.setText(\"\")\n CONTROLLED_2 = \"\" ;self.lineEdit_008.setText(\"\")\n Controlled_3 = \"\" ;self.lineEdit_009.setText(\"\")\n CONTROLLED_3 = \"\" ;self.lineEdit_010.setText(\"\")\n SCALE = \"\" ;self.lineEdit_011.setText(\"\")\n MOD = \"\" ;self.lineEdit_012.setText(\"\")\n COMPANY = \"\" ;self.lineEdit_013.setText(\"\")\n ADRESS = \"\" ;self.lineEdit_014.setText(\"\")\n COUNTRY = \"\" ;self.lineEdit_015.setText(\"\")\n PART_NAME = \"\" ;self.lineEdit_016.setText(\"\")\n Project_number = \"\" ;self.lineEdit_017.setText(\"\")\n A_ = \"\" ;self.lineEdit_018.setText(\"\")\n A__ = \"\" ;self.lineEdit_019.setText(\"\")\n B_ = \"\" ;self.lineEdit_020.setText(\"\")\n B__ = \"\" ;self.lineEdit_021.setText(\"\")\n C_ = \"\" ;self.lineEdit_022.setText(\"\")\n C__ = \"\" ;self.lineEdit_023.setText(\"\")\n D_ = \"\" ;self.lineEdit_024.setText(\"\")\n D__ = \"\" ;self.lineEdit_025.setText(\"\")\n E_ = \"\" ;self.lineEdit_026.setText(\"\")\n E__ = \"\" ;self.lineEdit_027.setText(\"\")\n Quantity = \"\" ;self.lineEdit_028.setText(\"\")\n Part_ID_number = \"\" ;self.lineEdit_029.setText(\"\")\n Fabrication_tolerance = \"\";self.lineEdit_030.setText(\"\")\n Material = \"\" ;self.lineEdit_031.setText(\"\")\n _01 = \"\" ;self.lineEdit_032.setText(\"\")\n _001_001 = \"\" ;self.lineEdit_033.setText(\"\")\n ISO2768_fh = \"\" ;self.lineEdit_034.setText(\"\")\n IRON = \"\" ;self.lineEdit_035.setText(\"\")\n\n def on_pushButton03_clicked(self): # Bouton Memo # Memo buttom\n self.lineEdit_001.setText(Drawn_by)\n self.lineEdit_002.setText(DRAWN_BY)\n self.lineEdit_003.setText(Controlled_by)\n self.lineEdit_004.setText(CONTROLLED_BY)\n self.lineEdit_005.setText(Date)\n self.lineEdit_006.setText(DATE)\n self.lineEdit_007.setText(Controlled_2)\n self.lineEdit_008.setText(CONTROLLED_2)\n self.lineEdit_009.setText(Controlled_3)\n self.lineEdit_010.setText(CONTROLLED_3)\n self.lineEdit_011.setText(SCALE)\n self.lineEdit_012.setText(MOD)\n self.lineEdit_013.setText(COMPANY)\n self.lineEdit_014.setText(ADRESS)\n self.lineEdit_015.setText(COUNTRY)\n self.lineEdit_016.setText(PART_NAME)\n self.lineEdit_017.setText(Project_number)\n self.lineEdit_018.setText(A_)\n self.lineEdit_019.setText(A__)\n self.lineEdit_020.setText(B_)\n self.lineEdit_021.setText(B__)\n self.lineEdit_022.setText(C_)\n self.lineEdit_023.setText(C__)\n self.lineEdit_024.setText(D_)\n self.lineEdit_025.setText(D__)\n self.lineEdit_026.setText(E_)\n self.lineEdit_027.setText(E__)\n self.lineEdit_028.setText(Quantity)\n self.lineEdit_029.setText(Part_ID_number)\n self.lineEdit_030.setText(Fabrication_tolerance)\n self.lineEdit_031.setText(Material)\n self.lineEdit_032.setText(_01)\n self.lineEdit_033.setText(_001_001)\n self.lineEdit_034.setText(ISO2768_fh)\n self.lineEdit_035.setText(IRON)\n\n def on_pushButton02_clicked(self): # Bouton Quitter # Quit buttom\n App.Console.PrintMessage(\"End cartridge mod 2\\r\\n\")\n self.window.hide()\n\nMainWindow = QtGui.QMainWindow()\nui = Ui_MainWindow(MainWindow)\nMainWindow.show()\n\n}}\n\n## Version \n\n5.0 : 08/08/2014\n\n\n
\n\n\n
\n\n\n
\n\n# Macro CartoucheFC 2/fr \n\n\n
\n\n\n{{Macro/fr\n|Name=Macro_CartoucheFC_2\n|Icon=Macro_CartoucheFC_2.png\n|Description=Cette macro est une application complète, il permet de remplir le cartouche de la feuille de dessin avec texteditable (Seulement pour l'[atelier Drawing](Drawing_Workbench/fr.md)).\n|Author=Mario52\n|Version=5.0\n|Date=2014-08-08\n|FCVersion=Toutes versions utilisant l'atelier Drawing\n|Download=[https://www.freecadweb.org/wiki/images/0/00/Macro_CartoucheFC_2.png ToolBar Icon]\n}}\n\n\n
\n\n## Description \n\nCette macro est une application complète, elle permet de remplir simplement tous les champs du cartouche A3 Landscape english\n\n\n
\n\n\"Macro\n\nLa photo représente la hiérarchie de remplissage des champs tels qu\\'ils sont dans la fenêtre \\\"textEditable\\\" de FreeCAD.\n\n## Utilisation \n\nSon utilisation est très facile, exécutez la macro et modifier les champs.\n\n- Cliquez sur le bouton **Quit** pour quitter l\\'application.\n- Cliquez sur le bouton **Memo** restitue le contenu de la cartouche lors de l\\'ouverture de la macro.\n- Cliquez sur le bouton **Clear** nettoyer tous les champs de la macro (champs sont restitués en appuyant sur le **Mémo**).\n- Cliquez sur le bouton **Apply** bouton applique les modifications au modèle.\n\nLa fenêtre reste au dessus des autres fenêtres pour permettre de visualiser les changements (cette fonction peut être désagréable si vous décidez d\\'ouvrir une nouvelle fenêtre et reste inaccessible)\n\n**PS : certains caractères comme & \\$ ne sont pas acceptés (et peut être d\\'autres caractères spéciaux) !**\n\nSi vous avez des questions ou désirez ajouter une fonction, vous pouvez vous adresse sur le forum [Remplir cartouche](http://forum.freecadweb.org/viewtopic.php?f=12&t=2049)\n\n## Code \n\nToolBar Icon ![](images/Macro_CartoucheFC_2.png )\n\n**Macro_CartoucheFC_2.FcMacro**\n\n\n{{MacroCode|code=\n\n# -*- coding: utf-8 -*-\n\"\"\"\n***************************************************************************\n* Copyright (c) 2014 *\n* *\n* This file is a supplement to the FreeCAD CAD development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n* *\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n***************************************************************************\n* WARNING! All changes in this file will be lost and * \n* may cause malfunction of the program *\n***************************************************************************\n\"\"\"\n# Macro_CartoucheFC_2.FcMacro\n# \n# il faut que la page (drawing viewer) s'appelle \" Page \" qui est le nom par défaut du module Drawing\n# cette macro fonctionne avec la feuille A3_Landscape_ qui possede tous les champs EditableTexts\n# \n# http://www.freecadweb.org/wiki/index.php?title=Drawing_templates\n# Fill the area of the cartridge\n# It is necessary that the page (drawing viewer) is called \"Page\", which is the default name of the Drawing module\n# Python 2.6\n# 08/08/2014 ver 5.0 (pour cartouche modèle 2 (A3 Landscape english)) # PyQt and PySide \n# Created: by mario52\n# PyQt and PySide \n\n#OS: Windows Vista\n#Word size: 32-bit\n#Version: 0.14.3700 (Git)\n#Branch: releases/FreeCAD-0-14\n#Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1\n#Python version: 2.6.2\n#Qt version: 4.5.2\n#Coin version: 3.1.0\n#SoQt version: 1.4.1\n\ntry:\n import PyQt4 # PyQt4\n from PyQt4 import QtCore, QtGui # PyQt4\nexcept Exception:\n import PySide # PySide\n from PySide import QtCore, QtGui # PySide\n\nimport Draft, Part, FreeCAD, math, PartGui, FreeCADGui\nfrom math import sqrt, pi, sin, cos, asin\nfrom FreeCAD import Base\n\ndef utf8(unio):\n return unicode(unio).encode('UTF8')\n\nglobal path\nglobal Drawn_by ; Drawn_by = \"\" # lineEdit_001\nglobal DRAWN_BY ; DRAWN_BY = \"\" # lineEdit_002\nglobal Controlled_by ; Controlled_by = \"\" # lineEdit_003\nglobal CONTROLLED_BY ; CONTROLLED_BY = \"\" # lineEdit_004\nglobal Date ; Date = \"\" # lineEdit_005\nglobal DATE ; DATE = \"\" # lineEdit_006\nglobal Controlled_2 ; Controlled_2 = \"\" # lineEdit_007\nglobal CONTROLLED_2 ; CONTROLLED_2 = \"\" # lineEdit_008\nglobal Controlled_3 ; Controlled_3 = \"\" # lineEdit_009\nglobal CONTROLLED_3 ; CONTROLLED_3 = \"\" # lineEdit_010\nglobal SCALE ; SCALE = \"\" # lineEdit_011\nglobal MOD ; MOD = \"\" # lineEdit_012\nglobal COMPANY ; COMPANY = \"\" # lineEdit_013\nglobal ADRESS ; ADRESS = \"\" # lineEdit_014\nglobal COUNTRY ; COUNTRY = \"\" # lineEdit_015\nglobal PART_NAME ; PART_NAME = \"\" # lineEdit_016\nglobal Project_number ; Project_number = \"\" # lineEdit_017\nglobal A_ ; A_ = \"\" # lineEdit_018\nglobal A__ ; A__ = \"\" # lineEdit_019\nglobal B_ ; B_ = \"\" # lineEdit_020\nglobal B__ ; B__ = \"\" # lineEdit_021\nglobal C_ ; C_ = \"\" # lineEdit_022\nglobal C__ ; C__ = \"\" # lineEdit_023\nglobal D_ ; D_ = \"\" # lineEdit_024\nglobal D__ ; D__ = \"\" # lineEdit_025\nglobal E_ ; E_ = \"\" # lineEdit_026\nglobal E__ ; E__ = \"\" # lineEdit_027\nglobal Quantity ; Quantity = \"\" # lineEdit_028\nglobal Part_ID_number ; Part_ID_number = \"\" # lineEdit_029\nglobal Fabrication_tolerances ; Fabrication_tolerance = \"\" #lineEdit_030\nglobal Material ; Material = \"\" # lineEdit_031\nglobal _01 ; _01 = \"\" # lineEdit_032\nglobal _001_001 ; _001_001 = \"\" # lineEdit_033\nglobal ISO2768_fh ; ISO2768_fh = \"\" # lineEdit_034\nglobal IRON ; IRON = \"\" # lineEdit_035\n\npath = FreeCAD.ConfigGet(\"AppHomePath\")\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\ndef errorDialog(msg):\n # Create a simple dialog QMessageBox\n # The first argument indicates the icon used: one of QtGui.QMessageBox.{NoIcon, Information, Warning, Critical, Question} \n diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u\"Error Message\",msg)\n try:\n diag.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4 cette fonction met la fenêtre en avant\n except Exception:\n diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenêtre en avant\n #diag.setWindowModality(QtCore.Qt.ApplicationModal) # la fonction a été désactivée pour favoriser \"WindowStaysOnTopHint\"\n diag.exec_()\n\ntry:\n Drawn_by = App.activeDocument().getObject(\"Page\").EditableTexts[0] # lineEdit_001\n DRAWN_BY = App.activeDocument().getObject(\"Page\").EditableTexts[1] # lineEdit_002\n Controlled_by = App.activeDocument().getObject(\"Page\").EditableTexts[2] # lineEdit_003\n CONTROLLED_BY = App.activeDocument().getObject(\"Page\").EditableTexts[3] # lineEdit_004\n Date = App.activeDocument().getObject(\"Page\").EditableTexts[4] # lineEdit_005\n DATE = App.activeDocument().getObject(\"Page\").EditableTexts[5] # lineEdit_006\n Controlled_2 = App.activeDocument().getObject(\"Page\").EditableTexts[6] # lineEdit_007\n CONTROLLED_2 = App.activeDocument().getObject(\"Page\").EditableTexts[7] # lineEdit_008\n Controlled_3 = App.activeDocument().getObject(\"Page\").EditableTexts[8] # lineEdit_009\n CONTROLLED_3 = App.activeDocument().getObject(\"Page\").EditableTexts[9] # lineEdit_010\n SCALE = App.activeDocument().getObject(\"Page\").EditableTexts[10] # lineEdit_011\n MOD = App.activeDocument().getObject(\"Page\").EditableTexts[11] # lineEdit_012\n COMPANY = App.activeDocument().getObject(\"Page\").EditableTexts[12] # lineEdit_013\n ADRESS = App.activeDocument().getObject(\"Page\").EditableTexts[13] # lineEdit_014\n COUNTRY = App.activeDocument().getObject(\"Page\").EditableTexts[14] # lineEdit_015\n PART_NAME = App.activeDocument().getObject(\"Page\").EditableTexts[15] # lineEdit_016\n Project_number = App.activeDocument().getObject(\"Page\").EditableTexts[16] # lineEdit_017\n A_ = App.activeDocument().getObject(\"Page\").EditableTexts[17] # lineEdit_018\n A__ = App.activeDocument().getObject(\"Page\").EditableTexts[18] # lineEdit_019\n B_ = App.activeDocument().getObject(\"Page\").EditableTexts[19] # lineEdit_020\n B__ = App.activeDocument().getObject(\"Page\").EditableTexts[20] # lineEdit_021\n C_ = App.activeDocument().getObject(\"Page\").EditableTexts[21] # lineEdit_022\n C__ = App.activeDocument().getObject(\"Page\").EditableTexts[22] # lineEdit_023\n D_ = App.activeDocument().getObject(\"Page\").EditableTexts[23] # lineEdit_024\n D__ = App.activeDocument().getObject(\"Page\").EditableTexts[24] # lineEdit_025\n E_ = App.activeDocument().getObject(\"Page\").EditableTexts[25] # lineEdit_026\n E__ = App.activeDocument().getObject(\"Page\").EditableTexts[26] # lineEdit_027\n Quantity= App.activeDocument().getObject(\"Page\").EditableTexts[27] # lineEdit_028\n Part_ID_number = App.activeDocument().getObject(\"Page\").EditableTexts[28] # lineEdit_029\n Fabrication_tolerance = App.activeDocument().getObject(\"Page\").EditableTexts[29] #lineEdit_030\n Material = App.activeDocument().getObject(\"Page\").EditableTexts[30] # lineEdit_031\n _01 = App.activeDocument().getObject(\"Page\").EditableTexts[31] # lineEdit_032\n _001_001 = App.activeDocument().getObject(\"Page\").EditableTexts[32] # lineEdit_033\n ISO2768_fh = App.activeDocument().getObject(\"Page\").EditableTexts[33] # lineEdit_034\n IRON = App.activeDocument().getObject(\"Page\").EditableTexts[34] # lineEdit_035\n\nexcept:\n errorDialog(\"Error read cartridge\")\n\nclass Ui_MainWindow(object):\n\n def __init__(self, MainWindow):\n self.window = MainWindow\n\n MainWindow.setObjectName(_fromUtf8(\"MainWindow\"))\n MainWindow.resize(849, 462)\n MainWindow.setMaximumSize(QtCore.QSize(849, 462))\n self.centralWidget = QtGui.QWidget(MainWindow)\n self.centralWidget.setObjectName(_fromUtf8(\"centralWidget\"))\n\n self.pushButton02 = QtGui.QPushButton(self.centralWidget)\n self.pushButton02.setGeometry(QtCore.QRect(210, 420, 93, 28))\n self.pushButton02.setObjectName(_fromUtf8(\"pushButton_2\"))\n self.pushButton02.clicked.connect(self.on_pushButton02_clicked) # Bouton Quitter # Quit\n\n self.pushButton03 = QtGui.QPushButton(self.centralWidget)\n self.pushButton03.setGeometry(QtCore.QRect(320, 420, 93, 28))\n self.pushButton03.setObjectName(_fromUtf8(\"pushButton_3\"))\n self.pushButton03.clicked.connect(self.on_pushButton03_clicked) # Bouton Memo # Memo\n\n self.pushButton04 = QtGui.QPushButton(self.centralWidget)\n self.pushButton04.setGeometry(QtCore.QRect(430, 420, 93, 28))\n self.pushButton04.setObjectName(_fromUtf8(\"pushButton_4\"))\n self.pushButton04.clicked.connect(self.on_pushButton04_clicked) # Bouton nettoyer # Clear\n\n self.pushButton01 = QtGui.QPushButton(self.centralWidget)\n self.pushButton01.setGeometry(QtCore.QRect(540, 420, 93, 28))\n self.pushButton01.setObjectName(_fromUtf8(\"pushButton\"))\n self.pushButton01.clicked.connect(self.on_pushButton01_clicked) # Bouton Appliquer # Apply\n\n self.lineEdit_001 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_001.setGeometry(QtCore.QRect(540, 100, 101, 22))\n self.lineEdit_001.setObjectName(_fromUtf8(\"lineEdit_001\"))\n self.lineEdit_001.setText(Drawn_by)\n\n self.lineEdit_002 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_002.setGeometry(QtCore.QRect(650, 100, 121, 22))\n self.lineEdit_002.setObjectName(_fromUtf8(\"lineEdit_002\"))\n self.lineEdit_002.setText(DRAWN_BY)\n\n self.lineEdit_003 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_003.setGeometry(QtCore.QRect(540, 140, 101, 22))\n self.lineEdit_003.setObjectName(_fromUtf8(\"lineEdit_003\"))\n self.lineEdit_003.setText(Controlled_by)\n\n self.lineEdit_004 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_004.setGeometry(QtCore.QRect(650, 140, 121, 22))\n self.lineEdit_004.setObjectName(_fromUtf8(\"lineEdit_004\"))\n self.lineEdit_004.setText(CONTROLLED_BY)\n\n self.lineEdit_005 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_005.setGeometry(QtCore.QRect(540, 180, 101, 22))\n self.lineEdit_005.setObjectName(_fromUtf8(\"lineEdit_005\"))\n self.lineEdit_005.setText(Date)\n\n self.lineEdit_006 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_006.setGeometry(QtCore.QRect(650, 180, 121, 22))\n self.lineEdit_006.setObjectName(_fromUtf8(\"lineEdit_006\"))\n self.lineEdit_006.setText(DATE)\n\n self.lineEdit_007 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_007.setGeometry(QtCore.QRect(540, 220, 101, 22))\n self.lineEdit_007.setObjectName(_fromUtf8(\"lineEdit_007\"))\n self.lineEdit_007.setText(Controlled_2)\n\n self.lineEdit_008 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_008.setGeometry(QtCore.QRect(650, 220, 121, 22))\n self.lineEdit_008.setObjectName(_fromUtf8(\"lineEdit_008\"))\n self.lineEdit_008.setText(CONTROLLED_2)\n\n self.lineEdit_009 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_009.setGeometry(QtCore.QRect(540, 260, 101, 22))\n self.lineEdit_009.setObjectName(_fromUtf8(\"lineEdit_009\"))\n self.lineEdit_009.setText(Controlled_3)\n\n self.lineEdit_010 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_010.setGeometry(QtCore.QRect(650, 260, 121, 22))\n self.lineEdit_010.setObjectName(_fromUtf8(\"lineEdit_010\"))\n self.lineEdit_010.setText(CONTROLLED_3)\n\n self.lineEdit_011 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_011.setGeometry(QtCore.QRect(780, 100, 61, 61))\n self.lineEdit_011.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_011.setObjectName(_fromUtf8(\"lineEdit_011\"))\n self.lineEdit_011.setText(SCALE)\n\n self.lineEdit_012 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_012.setGeometry(QtCore.QRect(10, 100, 131, 181))\n font = QtGui.QFont()\n font.setPointSize(20)\n self.lineEdit_012.setFont(font)\n self.lineEdit_012.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_012.setObjectName(_fromUtf8(\"lineEdit_012\"))\n self.lineEdit_012.setText(MOD)\n\n self.lineEdit_013 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_013.setGeometry(QtCore.QRect(10, 300, 261, 22))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_013.setFont(font)\n self.lineEdit_013.setObjectName(_fromUtf8(\"lineEdit_013\"))\n self.lineEdit_013.setText(COMPANY)\n\n self.lineEdit_014 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_014.setGeometry(QtCore.QRect(10, 340, 261, 22))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_014.setFont(font)\n self.lineEdit_014.setObjectName(_fromUtf8(\"lineEdit_014\"))\n self.lineEdit_014.setText(ADRESS)\n\n self.lineEdit_015 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_015.setGeometry(QtCore.QRect(10, 380, 261, 22))\n font = QtGui.QFont()\n font.setPointSize(10)\n self.lineEdit_015.setFont(font)\n self.lineEdit_015.setObjectName(_fromUtf8(\"lineEdit_015\"))\n self.lineEdit_015.setText(COUNTRY)\n\n self.lineEdit_016 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_016.setGeometry(QtCore.QRect(280, 300, 301, 101))\n font = QtGui.QFont()\n font.setPointSize(14)\n self.lineEdit_016.setFont(font)\n self.lineEdit_016.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_016.setObjectName(_fromUtf8(\"lineEdit_016\"))\n self.lineEdit_016.setText(PART_NAME)\n\n self.lineEdit_017 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_017.setGeometry(QtCore.QRect(590, 300, 251, 101))\n self.lineEdit_017.setMinimumSize(QtCore.QSize(0, 0))\n font = QtGui.QFont()\n font.setPointSize(8)\n self.lineEdit_017.setFont(font)\n self.lineEdit_017.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_017.setObjectName(_fromUtf8(\"lineEdit_017\"))\n self.lineEdit_017.setText(Project_number)\n\n self.lineEdit_018 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_018.setGeometry(QtCore.QRect(150, 260, 71, 22))\n self.lineEdit_018.setObjectName(_fromUtf8(\"lineEdit_018\"))\n self.lineEdit_018.setText(A_)\n\n self.lineEdit_019 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_019.setGeometry(QtCore.QRect(230, 260, 301, 22))\n self.lineEdit_019.setObjectName(_fromUtf8(\"lineEdit_019\"))\n self.lineEdit_019.setText(A__)\n\n self.lineEdit_020 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_020.setGeometry(QtCore.QRect(150, 220, 71, 22))\n self.lineEdit_020.setObjectName(_fromUtf8(\"lineEdit_020\"))\n self.lineEdit_020.setText(B_)\n\n self.lineEdit_021 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_021.setGeometry(QtCore.QRect(230, 220, 301, 22))\n self.lineEdit_021.setObjectName(_fromUtf8(\"lineEdit_021\"))\n self.lineEdit_021.setText(B__)\n\n self.lineEdit_022 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_022.setGeometry(QtCore.QRect(150, 180, 71, 22))\n self.lineEdit_022.setObjectName(_fromUtf8(\"lineEdit_022\"))\n self.lineEdit_022.setText(C_)\n\n self.lineEdit_023 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_023.setGeometry(QtCore.QRect(230, 180, 301, 22))\n self.lineEdit_023.setObjectName(_fromUtf8(\"lineEdit_023\"))\n self.lineEdit_023.setText(C__)\n\n self.lineEdit_024 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_024.setGeometry(QtCore.QRect(150, 140, 71, 22))\n self.lineEdit_024.setObjectName(_fromUtf8(\"lineEdit_024\"))\n self.lineEdit_024.setText(D_)\n\n self.lineEdit_025 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_025.setGeometry(QtCore.QRect(230, 140, 301, 22))\n self.lineEdit_025.setObjectName(_fromUtf8(\"lineEdit_025\"))\n self.lineEdit_025.setText(D__)\n\n self.lineEdit_026 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_026.setGeometry(QtCore.QRect(150, 100, 71, 22))\n self.lineEdit_026.setObjectName(_fromUtf8(\"lineEdit_026\"))\n self.lineEdit_026.setText(E_)\n\n self.lineEdit_027 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_027.setGeometry(QtCore.QRect(230, 100, 301, 22))\n self.lineEdit_027.setObjectName(_fromUtf8(\"lineEdit_027\"))\n self.lineEdit_027.setText(E__)\n\n self.lineEdit_028 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_028.setGeometry(QtCore.QRect(10, 60, 101, 22))\n self.lineEdit_028.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_028.setObjectName(_fromUtf8(\"lineEdit_028\"))\n self.lineEdit_028.setText(Quantity)\n\n self.lineEdit_029 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_029.setGeometry(QtCore.QRect(120, 60, 131, 22))\n self.lineEdit_029.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_029.setObjectName(_fromUtf8(\"lineEdit_029\"))\n self.lineEdit_029.setText(Part_ID_number)\n\n self.lineEdit_030 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_030.setGeometry(QtCore.QRect(260, 60, 381, 22))\n self.lineEdit_030.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_030.setObjectName(_fromUtf8(\"lineEdit_030\"))\n self.lineEdit_030.setText(Fabrication_tolerance)\n\n self.lineEdit_031 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_031.setGeometry(QtCore.QRect(650, 60, 191, 22))\n self.lineEdit_031.setAlignment(QtCore.Qt.AlignCenter)\n self.lineEdit_031.setObjectName(_fromUtf8(\"lineEdit_031\"))\n self.lineEdit_031.setText(Material)\n\n self.lineEdit_032 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_032.setGeometry(QtCore.QRect(10, 20, 101, 22))\n self.lineEdit_032.setObjectName(_fromUtf8(\"lineEdit_032\"))\n self.lineEdit_032.setText(_01)\n\n self.lineEdit_033 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_033.setGeometry(QtCore.QRect(120, 20, 131, 22))\n self.lineEdit_033.setObjectName(_fromUtf8(\"lineEdit_033\"))\n self.lineEdit_033.setText(_001_001)\n\n self.lineEdit_034 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_034.setGeometry(QtCore.QRect(260, 20, 381, 22))\n self.lineEdit_034.setObjectName(_fromUtf8(\"lineEdit_034\"))\n self.lineEdit_034.setText(ISO2768_fh)\n\n self.lineEdit_035 = QtGui.QLineEdit(self.centralWidget)\n self.lineEdit_035.setGeometry(QtCore.QRect(650, 20, 191, 22))\n self.lineEdit_035.setObjectName(_fromUtf8(\"lineEdit_035\"))\n self.lineEdit_035.setText(IRON)\n\n self.label_1 = QtGui.QLabel(self.centralWidget)\n self.label_1.setGeometry(QtCore.QRect(790, 85, 41, 16))\n self.label_1.setObjectName(_fromUtf8(\"label\"))\n self.label_2 = QtGui.QLabel(self.centralWidget)\n self.label_2.setGeometry(QtCore.QRect(10, 325, 53, 16))\n self.label_2.setObjectName(_fromUtf8(\"label_2\"))\n self.label_3 = QtGui.QLabel(self.centralWidget)\n self.label_3.setGeometry(QtCore.QRect(10, 365, 53, 16))\n self.label_3.setObjectName(_fromUtf8(\"label_3\"))\n self.label_4 = QtGui.QLabel(self.centralWidget)\n self.label_4.setGeometry(QtCore.QRect(10, 285, 161, 16))\n self.label_4.setObjectName(_fromUtf8(\"label_4\"))\n self.label_5 = QtGui.QLabel(self.centralWidget)\n self.label_5.setGeometry(QtCore.QRect(280, 285, 151, 16))\n self.label_5.setObjectName(_fromUtf8(\"label_5\"))\n self.label_6 = QtGui.QLabel(self.centralWidget)\n self.label_6.setGeometry(QtCore.QRect(590, 285, 191, 16))\n self.label_6.setObjectName(_fromUtf8(\"label_6\"))\n self.label_7 = QtGui.QLabel(self.centralWidget)\n self.label_7.setGeometry(QtCore.QRect(10, 85, 53, 16))\n self.label_7.setObjectName(_fromUtf8(\"label_7\"))\n self.label_8 = QtGui.QLabel(self.centralWidget)\n self.label_8.setGeometry(QtCore.QRect(150, 85, 53, 16))\n self.label_8.setObjectName(_fromUtf8(\"label_8\"))\n self.label_9 = QtGui.QLabel(self.centralWidget)\n self.label_9.setGeometry(QtCore.QRect(540, 85, 61, 16))\n self.label_9.setObjectName(_fromUtf8(\"label_9\"))\n self.label_10 = QtGui.QLabel(self.centralWidget)\n self.label_10.setGeometry(QtCore.QRect(540, 125, 101, 16))\n self.label_10.setObjectName(_fromUtf8(\"label_10\"))\n self.label_11 = QtGui.QLabel(self.centralWidget)\n self.label_11.setGeometry(QtCore.QRect(540, 165, 53, 16))\n self.label_11.setObjectName(_fromUtf8(\"label_11\"))\n self.label_12 = QtGui.QLabel(self.centralWidget)\n self.label_12.setGeometry(QtCore.QRect(540, 205, 81, 16))\n self.label_12.setObjectName(_fromUtf8(\"label_12\"))\n self.label_13 = QtGui.QLabel(self.centralWidget)\n self.label_13.setGeometry(QtCore.QRect(540, 245, 81, 16))\n self.label_13.setObjectName(_fromUtf8(\"label_13\"))\n self.label_14 = QtGui.QLabel(self.centralWidget)\n self.label_14.setGeometry(QtCore.QRect(10, 45, 71, 16))\n self.label_14.setObjectName(_fromUtf8(\"label_14\"))\n self.label_15 = QtGui.QLabel(self.centralWidget)\n self.label_15.setGeometry(QtCore.QRect(120, 45, 121, 16))\n self.label_15.setObjectName(_fromUtf8(\"label_15\"))\n self.label_16 = QtGui.QLabel(self.centralWidget)\n self.label_16.setGeometry(QtCore.QRect(260, 45, 141, 16))\n self.label_16.setObjectName(_fromUtf8(\"label_16\"))\n self.label_17 = QtGui.QLabel(self.centralWidget)\n self.label_17.setGeometry(QtCore.QRect(650, 45, 71, 16))\n self.label_17.setObjectName(_fromUtf8(\"label_17\"))\n\n self.graphicsView = QtGui.QGraphicsView(self.centralWidget) # Fenêtre pour logo # Logo windows\n self.graphicsView.setGeometry(QtCore.QRect(780, 220, 61, 61))\n self.graphicsView.setObjectName(_fromUtf8(\"graphicsView\"))\n self.label_18 = QtGui.QLabel(self.centralWidget)\n self.label_18.setGeometry(QtCore.QRect(790, 205, 41, 16))\n self.label_18.setObjectName(_fromUtf8(\"label_18\"))\n MainWindow.setCentralWidget(self.centralWidget)\n\n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n\n def retranslateUi(self, MainWindow):\n try:\n MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4\n except Exception:\n MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide\n\n MainWindow.setWindowTitle(_translate(\"MainWindow\", \"Cartouche mod 2\", None))\n\n self.pushButton01.setText(_translate(\"MainWindow\", \"Apply\", None))\n self.pushButton02.setText(_translate(\"MainWindow\", \"Quit\", None))\n self.pushButton03.setText(_translate(\"MainWindow\", \"Memo\", None))\n self.pushButton04.setText(_translate(\"MainWindow\", \"Clear\", None))\n\n self.lineEdit_001.setText(_translate(\"MainWindow\", \"Drawn_by\", None))\n self.lineEdit_002.setText(_translate(\"MainWindow\", \"DRAWN_BY\", None))\n self.lineEdit_003.setText(_translate(\"MainWindow\", \"Controlled_by\", None))\n self.lineEdit_004.setText(_translate(\"MainWindow\", \"CONTROLLED_BY\", None))\n self.lineEdit_005.setText(_translate(\"MainWindow\", \"Date\", None))\n self.lineEdit_006.setText(_translate(\"MainWindow\", \"DATE\", None))\n self.lineEdit_007.setText(_translate(\"MainWindow\", \"Controlled_2\", None))\n self.lineEdit_008.setText(_translate(\"MainWindow\", \"CONTROLLED_2\", None))\n self.lineEdit_009.setText(_translate(\"MainWindow\", \"Controlled_3\", None))\n self.lineEdit_010.setText(_translate(\"MainWindow\", \"CONTROLLED_3\", None))\n self.lineEdit_011.setText(_translate(\"MainWindow\", \"SCALE\", None))\n self.lineEdit_012.setText(_translate(\"MainWindow\", \"MOD\", None))\n self.lineEdit_013.setText(_translate(\"MainWindow\", \"COMPANY\", None))\n self.lineEdit_014.setText(_translate(\"MainWindow\", \"ADRESS\", None))\n self.lineEdit_015.setText(_translate(\"MainWindow\", \"COUNTRY\", None))\n self.lineEdit_016.setText(_translate(\"MainWindow\", \"PART_NAME\", None))\n self.lineEdit_017.setText(_translate(\"MainWindow\", \"Project_number\", None))\n self.lineEdit_018.setText(_translate(\"MainWindow\", \"A_\", None))\n self.lineEdit_019.setText(_translate(\"MainWindow\", \"A__\", None))\n self.lineEdit_020.setText(_translate(\"MainWindow\", \"B_\", None))\n self.lineEdit_021.setText(_translate(\"MainWindow\", \"B__\", None))\n self.lineEdit_022.setText(_translate(\"MainWindow\", \"C_\", None))\n self.lineEdit_023.setText(_translate(\"MainWindow\", \"C__\", None))\n self.lineEdit_024.setText(_translate(\"MainWindow\", \"D_\", None))\n self.lineEdit_025.setText(_translate(\"MainWindow\", \"D__\", None))\n self.lineEdit_026.setText(_translate(\"MainWindow\", \"E_\", None))\n self.lineEdit_027.setText(_translate(\"MainWindow\", \"E__\", None))\n self.lineEdit_028.setText(_translate(\"MainWindow\", \"Quantity\", None))\n self.lineEdit_029.setText(_translate(\"MainWindow\", \"Part_ID_number\", None))\n self.lineEdit_030.setText(_translate(\"MainWindow\", \"Fabrication_tolerance\", None))\n self.lineEdit_031.setText(_translate(\"MainWindow\", \"Material\", None))\n self.lineEdit_032.setText(_translate(\"MainWindow\", \"_01\", None))\n self.lineEdit_033.setText(_translate(\"MainWindow\", \"_001_001\", None))\n self.lineEdit_034.setText(_translate(\"MainWindow\", \"ISO2768_fh\", None))\n self.lineEdit_035.setText(_translate(\"MainWindow\", \"IRON\", None))\n\n self.label_1.setText(_translate(\"MainWindow\", \"Scale :\", None))\n self.label_2.setText(_translate(\"MainWindow\", \"Address :\", None))\n self.label_3.setText(_translate(\"MainWindow\", \"Country :\", None))\n self.label_4.setText(_translate(\"MainWindow\", \"Company name :\", None))\n self.label_5.setText(_translate(\"MainWindow\", \"Part name :\", None))\n self.label_6.setText(_translate(\"MainWindow\", \"Project number / id :\", None))\n self.label_7.setText(_translate(\"MainWindow\", \"Size :\", None))\n self.label_8.setText(_translate(\"MainWindow\", \"Notes :\", None))\n self.label_9.setText(_translate(\"MainWindow\", \"Draw by :\", None))\n self.label_10.setText(_translate(\"MainWindow\", \"Controlled by :\", None))\n self.label_11.setText(_translate(\"MainWindow\", \"Date :\", None))\n self.label_12.setText(_translate(\"MainWindow\", \"Controlled 2 :\", None))\n self.label_13.setText(_translate(\"MainWindow\", \"Controlled 3 :\", None))\n self.label_14.setText(_translate(\"MainWindow\", \"Quantity :\", None))\n self.label_15.setText(_translate(\"MainWindow\", \"Part ID / Number :\", None))\n self.label_16.setText(_translate(\"MainWindow\", \"Fabrication tolerance :\", None))\n self.label_17.setText(_translate(\"MainWindow\", \"Material :\", None))\n self.label_18.setText(_translate(\"MainWindow\", \"Logo :\", None))\n\n def on_pushButton01_clicked(self): # Bouton Appliquer # Appli buttom\n Drawn_by = utf8(self.lineEdit_001.text())\n DRAWN_BY = utf8(self.lineEdit_002.text())\n Controlled_by = utf8(self.lineEdit_003.text())\n CONTROLLED_BY = utf8(self.lineEdit_004.text())\n Date = utf8(self.lineEdit_005.text())\n DATE = utf8(self.lineEdit_006.text())\n Controlled_2 = utf8(self.lineEdit_007.text())\n CONTROLLED_2 = utf8(self.lineEdit_008.text())\n Controlled_3 = utf8(self.lineEdit_009.text())\n CONTROLLED_3 = utf8(self.lineEdit_010.text())\n SCALE = utf8(self.lineEdit_011.text())\n MOD = utf8(self.lineEdit_012.text())\n COMPANY = utf8(self.lineEdit_013.text())\n ADRESS = utf8(self.lineEdit_014.text())\n COUNTRY = utf8(self.lineEdit_015.text())\n PART_NAME = utf8(self.lineEdit_016.text())\n Project_number = utf8(self.lineEdit_017.text())\n A_ = utf8(self.lineEdit_018.text())\n A__ = utf8(self.lineEdit_019.text())\n B_ = utf8(self.lineEdit_020.text())\n B__ = utf8(self.lineEdit_021.text())\n C_ = utf8(self.lineEdit_022.text())\n C__ = utf8(self.lineEdit_023.text())\n D_ = utf8(self.lineEdit_024.text())\n D__ = utf8(self.lineEdit_025.text())\n E_ = utf8(self.lineEdit_026.text())\n E__ = utf8(self.lineEdit_027.text())\n Quantity = utf8(self.lineEdit_028.text())\n Part_ID_number = utf8(self.lineEdit_029.text())\n Fabrication_tolerance = utf8(self.lineEdit_030.text())\n Material = utf8(self.lineEdit_031.text())\n _01 = utf8(self.lineEdit_032.text())\n _001_001 = utf8(self.lineEdit_033.text())\n ISO2768_fh = utf8(self.lineEdit_034.text())\n IRON = utf8(self.lineEdit_035.text())\n\n try:\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts =[unicode(Drawn_by,'utf-8'), unicode(DRAWN_BY,'utf-8'), unicode(Controlled_by,'utf-8'), unicode(CONTROLLED_BY,'utf-8'), unicode(Date,'utf-8'), unicode(DATE,'utf-8'), unicode(Controlled_2, 'utf-8'), unicode(CONTROLLED_2,'utf-8'), unicode(Controlled_3,'utf-8'), unicode(CONTROLLED_3,'utf-8'), unicode(SCALE,'utf-8'), unicode(MOD,'utf-8'), unicode(COMPANY,'utf-8'), unicode(ADRESS,'utf-8'), unicode(COUNTRY, 'utf-8'), unicode(PART_NAME,'utf-8'), unicode(Project_number,'utf-8'), unicode(A_,'utf-8'), unicode(A__,'utf-8'), unicode(B_,'utf-8'), unicode(B__,'utf-8'), unicode(C_,'utf-8'), unicode(C__,'utf-8'), unicode(D_,'utf-8'), unicode(D__,'utf-8'), unicode(E_,'utf-8'), unicode(E__,'utf-8'), unicode(Quantity,'utf-8'), unicode(Part_ID_number,'utf-8'), unicode(Fabrication_tolerance,'utf-8'), unicode(Material,'utf-8'), unicode(_01,'utf-8'), unicode(_001_001,'utf-8'), unicode(ISO2768_fh,'utf-8'), unicode(IRON,'utf-8'),] # PyQt4\n App.ActiveDocument.recompute()\n except Exception:#\n FreeCAD.getDocument (App.ActiveDocument.Name).getObject(\"Page\").EditableTexts =[Drawn_by.encode('utf-8'), DRAWN_BY.encode('utf-8'), Controlled_by.encode('utf-8'), CONTROLLED_BY.encode('utf-8'), Date.encode('utf-8'), DATE.encode('utf-8'), Controlled_2.encode('utf-8'), CONTROLLED_2.encode('utf-8'), Controlled_3.encode('utf-8'), CONTROLLED_3.encode('utf-8'), SCALE.encode('utf-8'), MOD.encode('utf-8'), COMPANY.encode('utf-8'), ADRESS.encode('utf-8'), COUNTRY.encode('utf-8'), PART_NAME.encode('utf-8'), Project_number.encode('utf-8'), A_.encode('utf-8'), A__.encode('utf-8'), B_.encode('utf-8'), B__.encode('utf-8'), C_.encode('utf-8'), C__.encode('utf-8'), D_.encode('utf-8'), D__.encode('utf-8'), E_.encode('utf-8'), E__.encode('utf-8'), Quantity.encode('utf-8'), Part_ID_number.encode('utf-8'), Fabrication_tolerance.encode('utf-8'), Material.encode('utf-8'), _01.encode('utf-8'), _001_001.encode('utf-8'), ISO2768_fh.encode('utf-8'), IRON.encode('utf-8'),] # PySide\n App.ActiveDocument.recompute()\n\n def on_pushButton04_clicked(self): # Bouton nettoyer # Clear buttom\n\n Drawn_by = \"\" ;self.lineEdit_001.setText(\"\")\n DRAWN_BY = \"\" ;self.lineEdit_002.setText(\"\")\n Controlled_by = \"\" ;self.lineEdit_003.setText(\"\")\n CONTROLLED_BY = \"\" ;self.lineEdit_004.setText(\"\")\n Date = \"\" ;self.lineEdit_005.setText(\"\")\n DATE = \"\" ;self.lineEdit_006.setText(\"\")\n Controlled_2 = \"\" ;self.lineEdit_007.setText(\"\")\n CONTROLLED_2 = \"\" ;self.lineEdit_008.setText(\"\")\n Controlled_3 = \"\" ;self.lineEdit_009.setText(\"\")\n CONTROLLED_3 = \"\" ;self.lineEdit_010.setText(\"\")\n SCALE = \"\" ;self.lineEdit_011.setText(\"\")\n MOD = \"\" ;self.lineEdit_012.setText(\"\")\n COMPANY = \"\" ;self.lineEdit_013.setText(\"\")\n ADRESS = \"\" ;self.lineEdit_014.setText(\"\")\n COUNTRY = \"\" ;self.lineEdit_015.setText(\"\")\n PART_NAME = \"\" ;self.lineEdit_016.setText(\"\")\n Project_number = \"\" ;self.lineEdit_017.setText(\"\")\n A_ = \"\" ;self.lineEdit_018.setText(\"\")\n A__ = \"\" ;self.lineEdit_019.setText(\"\")\n B_ = \"\" ;self.lineEdit_020.setText(\"\")\n B__ = \"\" ;self.lineEdit_021.setText(\"\")\n C_ = \"\" ;self.lineEdit_022.setText(\"\")\n C__ = \"\" ;self.lineEdit_023.setText(\"\")\n D_ = \"\" ;self.lineEdit_024.setText(\"\")\n D__ = \"\" ;self.lineEdit_025.setText(\"\")\n E_ = \"\" ;self.lineEdit_026.setText(\"\")\n E__ = \"\" ;self.lineEdit_027.setText(\"\")\n Quantity = \"\" ;self.lineEdit_028.setText(\"\")\n Part_ID_number = \"\" ;self.lineEdit_029.setText(\"\")\n Fabrication_tolerance = \"\";self.lineEdit_030.setText(\"\")\n Material = \"\" ;self.lineEdit_031.setText(\"\")\n _01 = \"\" ;self.lineEdit_032.setText(\"\")\n _001_001 = \"\" ;self.lineEdit_033.setText(\"\")\n ISO2768_fh = \"\" ;self.lineEdit_034.setText(\"\")\n IRON = \"\" ;self.lineEdit_035.setText(\"\")\n\n def on_pushButton03_clicked(self): # Bouton Memo # Memo buttom\n self.lineEdit_001.setText(Drawn_by)\n self.lineEdit_002.setText(DRAWN_BY)\n self.lineEdit_003.setText(Controlled_by)\n self.lineEdit_004.setText(CONTROLLED_BY)\n self.lineEdit_005.setText(Date)\n self.lineEdit_006.setText(DATE)\n self.lineEdit_007.setText(Controlled_2)\n self.lineEdit_008.setText(CONTROLLED_2)\n self.lineEdit_009.setText(Controlled_3)\n self.lineEdit_010.setText(CONTROLLED_3)\n self.lineEdit_011.setText(SCALE)\n self.lineEdit_012.setText(MOD)\n self.lineEdit_013.setText(COMPANY)\n self.lineEdit_014.setText(ADRESS)\n self.lineEdit_015.setText(COUNTRY)\n self.lineEdit_016.setText(PART_NAME)\n self.lineEdit_017.setText(Project_number)\n self.lineEdit_018.setText(A_)\n self.lineEdit_019.setText(A__)\n self.lineEdit_020.setText(B_)\n self.lineEdit_021.setText(B__)\n self.lineEdit_022.setText(C_)\n self.lineEdit_023.setText(C__)\n self.lineEdit_024.setText(D_)\n self.lineEdit_025.setText(D__)\n self.lineEdit_026.setText(E_)\n self.lineEdit_027.setText(E__)\n self.lineEdit_028.setText(Quantity)\n self.lineEdit_029.setText(Part_ID_number)\n self.lineEdit_030.setText(Fabrication_tolerance)\n self.lineEdit_031.setText(Material)\n self.lineEdit_032.setText(_01)\n self.lineEdit_033.setText(_001_001)\n self.lineEdit_034.setText(ISO2768_fh)\n self.lineEdit_035.setText(IRON)\n\n def on_pushButton02_clicked(self): # Bouton Quitter # Quit buttom\n App.Console.PrintMessage(\"End cartridge mod 2\\r\\n\")\n self.window.hide()\n\nMainWindow = QtGui.QMainWindow()\nui = Ui_MainWindow(MainWindow)\nMainWindow.show()\n\n}}\n\n## Version \n\n5.0 : 08/08/2014\n\n\n
\n\n\n
\n\n\n---\n⏵ [documentation index](../README.md) > Sandbox:Mario52 Macro Cartouche\n"} {"id": "freecad-docs:wiki/SheetMetal_AddRelief.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/SheetMetal_AddRelief.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/SheetMetal_AddRelief.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c869e0ac00746120a516fba5cda702a0f03bd7a7c6aedd3aad3a8006938050e0", "bytes": 6011, "tokens": 2111, "text": "---\n GuiCommand:\n Name: SheetMetal AddRelief\n MenuLocation: SheetMetal , Make Relief\n Workbenches: SheetMetal Workbench\n Shortcut: **S** **R**\n SeeAlso: SheetMetal_AddJunction, SheetMetal_AddBend\n---\n\n# SheetMetal AddRelief\n\n## Description\n\nThe \"\" [SheetMetal AddRelief](SheetMetal_AddRelief.md) command creates corner reliefs, cutouts, at the points where three sections (base plate/walls/flanges) of a sheet metal object meet. Without these reliefs the object will not be unfoldable.\n\nThis command is the first of three steps to convert a shell object made with the [Part Workbench](Part_Workbench.md) or [PartDesign Workbench](PartDesign_Workbench.md) into an unfoldable sheet metal object:\n\n1. [SheetMetal AddRelief](SheetMetal_AddRelief.md)\n2. [SheetMetal AddJunction](SheetMetal_AddJunction.md)\n3. [SheetMetal AddBend](SheetMetal_AddBend.md)\n\n \"\" \"\" \"\" \"\" \"\" \"\" \"\" \n*Make Relief - cut off corners*\n\n## Usage\n\n1. Select one or more corner vertex(es).\n2. There are several ways to invoke the command:\n - Press the ** [Make Relief](SheetMetal_AddRelief.md)** button.\n - Select the **SheetMetal → Make Relief** option from the menu.\n - Right-click in the [Tree view](Tree_view.md) or the [3D view](3D_view.md) and select the **Sheet Metal → Make Relief** option from the context menu.\n - Use the keyboard shortcut: **S** then **R**.\n3. The **Add Corner Relief on Solid** [Task panel](Task_panel.md) opens (introduced in version 0.5.00).\n4. Optionally press the **Select** button to add more vertices.\n - Press the **Preview** button to finish the selection and display the changes.\n5. Optionally adjust the parameters in the Task panel.\n6. Press the **OK** button to finish the command and close the Task panel.\n7. A **CornerRelief** object will be created consisting of one new corner relief at each selected vertex.\n8. Optionally adjust the parameters in the [Property editor](Property_editor.md).\n\n \"\" \"\" \"\" \n\n## Notes\n\nThe commands \"\" **[SheetMetal AddRelief](SheetMetal_AddRelief.md)**, \"\" **[SheetMetal AddJunction](SheetMetal_AddJunction.md)**, and \"\" **[SheetMetal AddBend](SheetMetal_AddBend.md)** work best with hollow cuboids i.e. shell objects with a constant thickness and only 90° angles between faces.\n\nShell objects can be created with commands from the \"\" [Part Workbench](Part_Workbench.md) or the \"\" [PartDesign Workbench](PartDesign_Workbench.md).\n\nTo create a hollow cuboid with the [Part Workbench](Part_Workbench.md):\n\n1. Create a solid using either:\n - \"\" [Part Box](Part_Box.md).\n - \"\" [Part Extrude](Part_Extrude.md) from:\n - A \"\" [Draft Rectangle](Draft_Rectangle.md).\n - A \"\" [Draft Wire](Draft_Wire.md).\n - A \"\" [Sketch](Sketcher_NewSketch.md).\n2. Use \"\" [Part Thickness](Part_Thickness.md) to create a shell object from the solid (Typically with the thickness value of the sheet metal).\n\nTo create a hollow cuboid with the [PartDesign Workbench](PartDesign_Workbench.md):\n\n1. Create a solid using either:\n - \"\" [Additive Box](PartDesign_AdditiveBox.md).\n - \"\" [PartDesign Pad](PartDesign_Pad.md) from a \"\" [Sketch](Sketcher_NewSketch.md).\n2. Use \"\" [PartDesign Thickness](PartDesign_Thickness.md) to create a shell object from the solid (Typically with the thickness value of the sheet metal).\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA SheetMetal Relief object is derived from a [Part Feature](Part_Feature.md) object or, if it is inside a [PartDesign Body](PartDesign_Body.md), from a [PartDesign Feature](PartDesign_Feature.md) object, and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{Properties_Title|Parameters}}\n\n- **base Object|LinkSub**: \\\"Base Object\\\". Links to the corner vertexes defining relief positions.\n\n- **relief|Length**: \\\"Relief Size\\\". Default: {{value|2,00 mm}}.\n\n\n---\n⏵ [documentation index](../README.md) > [SheetMetal](Category_SheetMetal.md) > [Addons](Category_Addons.md) > [External Command Reference](Category_External%20Command%20Reference.md) > SheetMetal AddRelief\n"} {"id": "freecad-docs:wiki/Ship_Area.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Ship_Area.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Ship_Area.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "17f2013dcdf0ee781fa29f8506582ab65246767840023a92f322b29ca8952212", "bytes": 122, "tokens": 57, "text": "# Ship Area\n1. REDIRECT [Ship_AreasCurve](Ship_AreasCurve.md)\n\n\n---\n⏵ [documentation index](../README.md) > Ship Area\n"} {"id": "freecad-docs:wiki/Ship_Geometries_Examples.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Ship_Geometries_Examples.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Ship_Geometries_Examples.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "aeded11a3311067bde044017d5562cb0c326fdf2359f348aa1534c399051966f", "bytes": 154, "tokens": 59, "text": "# Ship Geometries Examples\n1. REDIRECT [Ship_LoadExample](Ship_LoadExample.md)\n\n\n---\n⏵ [documentation index](../README.md) > Ship Geometries Examples\n"} {"id": "freecad-docs:wiki/Sketcher_BSplineIncreaseDegree.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_BSplineIncreaseDegree.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_BSplineIncreaseDegree.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d56ef7006cba52f11e124164b34f4268e591e7d8ba78fab07f4c47b99b437357", "bytes": 3383, "tokens": 1132, "text": "---\n GuiCommand:\n Name: Sketcher BSplineIncreaseDegree\n MenuLocation: Sketch , Sketcher B-spline tools , Increase B-spline degree\n Workbenches: Sketcher_Workbench\n Version: 0.17\n SeeAlso: Sketcher_BSplineDecreaseDegree\n---\n\n# Sketcher BSplineIncreaseDegree\n\n## Description\n\nThe \"\" [Sketcher BSplineIncreaseDegree](Sketcher_BSplineIncreaseDegree.md) tool increases the degree (order) of [B-splines](B-Splines.md).\n\n## Usage\n\n1. Select one or more B-splines.\n2. There are several ways to invoke the tool:\n - Press the ** [Increase B-spline degree](Sketcher_BSplineIncreaseDegree.md)** button.\n\n - Select the **Sketch → Sketcher B-spline tools → Increase B-spline degree** option from the menu.\n\n - \n (v1.0) \n \n : Right-click in the [3D view](3D_view.md) and select the ** Increase B-spline degree** option from the context menu.\n\n## Example\n\nB-splines are basically a combination of [Bézier curves](B-Splines#B.C3.A9zier_curves.md) (nicely explained in [this](https://www.youtube.com/watch?v=bE1MrrqBAl8) and [this](https://www.youtube.com/watch?v=xXJylM2S72s) video).\n\nIn this cubic B-spline (degree 3) there are 3 segments, meaning 3 curves are connected at 2 knots.\n\nThe degree is indicated by the number in the center. See \"\" [Show/hide B-spline degree](Sketcher_BSplineDegree.md).\n\n \"\" \n*B-spline with degree 3 and 2 knots that each have multiplicity 1.*\n\nThe outer segments each have 2 control points, the inner segment has none to ensure the knots have multiplicity 1. See [this page](Sketcher_BSplineDecreaseKnotMultiplicity#Description.md) for an explanation about multiplicity.\n\nIncreasing the degree to 4 will add control points without changing the shape of the B-spline:\n\n \"\" \n*Same B-spline where the degree was changed from 3 to 4. Note that the knot multiplicity has also increased.*\n\nFrom this result you cannot get back to the initial state of the B-spline by decreasing the degree. Some information is lost when the degree of a B-spline is changed. Decreasing the degree back to 3 leads to this:\n\n \"\" \n*Same B-spline where the degree was changed back from 4 to 3. Note that the knot multiplicity has increased again. Depending on the B-spline, the algorithm to decrease the degree may add a lot of knots to preserve the shape as has happened here.*\n\nEach segment now has 2 control points and each knot is coincident with an additional control point. The knots have *C^0^* continuity so that the B-spline will get \\\"corners\\\" if you move a control point. The information of a higher continuity is therefore lost. See [this page](Sketcher_BSplineDecreaseKnotMultiplicity#Description.md) for an explanation about continuity.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher BSplineIncreaseDegree\n"} {"id": "freecad-docs:wiki/Sketcher_ConstrainParallel.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_ConstrainParallel.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_ConstrainParallel.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "841911dd6bb27308a17029636954ee52bd9c5dd28c13730f640f5e87313f054b", "bytes": 2310, "tokens": 757, "text": "---\n GuiCommand:\n Name: Sketcher ConstrainParallel\n MenuLocation: Sketch , Sketcher constraints , Constrain parallel\n Workbenches: Sketcher_Workbench\n Shortcut: **P**\n SeeAlso: \n---\n\n# Sketcher ConstrainParallel\n\n## Description\n\nThe \"\" [Sketcher ConstrainParallel](Sketcher_ConstrainParallel.md) tool constrains lines to be parallel.\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\n### [Continue mode](Sketcher_Workbench#Continue_modes.md) \n\n1. Make sure there is no selection.\n2. There are several ways to invoke the tool:\n - Press the ** [Constrain parallel](Sketcher_ConstrainParallel.md)** button.\n\n - Select the **Sketch → Sketcher constraints → Constrain parallel** option from the menu.\n\n - \n (v1.0) \n \n : Right-click in the [3D view](3D_view.md) and select the **Constrain → Constrain parallel** option from the context menu.\n\n - Use the keyboard shortcut: **P**.\n3. The cursor changes to a cross with the tool icon.\n4. Select two lines.\n5. A constraint is added.\n6. Optionally keep creating constraints.\n7. To finish, right-click or press **Esc**, or start another geometry or constraint creation tool.\n\n### Run-once mode \n\n1. Select two or more lines. (v1.0) : Points can be included in the selection, but will be ignored.\n2. Invoke the tool as explained above, or with the following additional option:\n - \n (v1.0) \n \n : Right-click in the [3D view](3D_view.md) and select the ** Constrain parallel** option from the context menu.\n3. Depending on the selection one or more constraints are added.\n\n## Scripting\n\n \n\nThe [Sketcher scripting](Sketcher_scripting.md) page explains the values which can be used for `Line1` and `Line2` and contains further examples on how to create constraints from Python scripts.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher ConstrainParallel\n"} {"id": "freecad-docs:wiki/Sketcher_ConstrainVertical.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_ConstrainVertical.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_ConstrainVertical.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2bdefc1725df3990977d8873912d33b1d4515eed2622b7e81a47667e000747b0", "bytes": 2200, "tokens": 777, "text": "---\n GuiCommand:\n Name: Sketcher ConstrainVertical\n MenuLocation: Sketch , Sketcher constraints , Constrain vertical\n Workbenches: Sketcher_Workbench\n Shortcut: **V**\n SeeAlso: Sketcher_ConstrainHorVer, Sketcher_ConstrainHorizontal\n---\n\n# Sketcher ConstrainVertical\n\n## Description\n\nThe \"\" [Sketcher ConstrainVertical](Sketcher_ConstrainVertical.md) tool constrains lines or pairs of points to be vertical (parallel to the vertical axis of the sketch).\n\n\n(v1.0) \n\n: In most cases it is advisable to use the combined [Sketcher ConstrainHorVer](Sketcher_ConstrainHorVer.md) tool instead.\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\n### [Continue mode](Sketcher_Workbench#Continue_modes.md) \n\n1. Make sure there is no selection.\n2. There are several ways to invoke the tool:\n - \n (v1.0) \n \n : If the **Auto tool for Horizontal/Vertical** [preference](Sketcher_Preferences#General.md) is selected (default): press the down arrow to the right of the **** button and select the ** Constrain vertical** option from the dropdown.\n\n - If this preference is not selected (and in {{VersionMinus|0.21}}): press the ** [Constrain vertical](Sketcher_ConstrainVertical.md)** button.\n\n - Select the **Sketch → Sketcher constraints → Constrain vertical** option from the menu.\n\n - Use the keyboard shortcut: **V**.\n3. For further steps see [Sketcher ConstrainHorizontal](Sketcher_ConstrainHorizontal#Continue_mode.md).\n\n### Run-once mode \n\nSee [Sketcher ConstrainHorizontal](Sketcher_ConstrainHorizontal#Run-once_mode.md).\n\n## Scripting\n\nSee [Sketcher ConstraintHorizontal](Sketcher_ConstrainHorizontal#Scripting.md).\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher ConstrainVertical\n"} {"id": "freecad-docs:wiki/Sketcher_CreateCircle.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_CreateCircle.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_CreateCircle.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e909373b317c51b69604ff4f3b89a168108eb1494e98987801a034bb8f60923b", "bytes": 2675, "tokens": 907, "text": "---\n GuiCommand:\n Name: Sketcher CreateCircle\n MenuLocation: Sketch , Sketcher geometries , Create circle by center\n Workbenches: Sketcher_Workbench\n Shortcut: **G** **C**\n SeeAlso: Sketcher_CreateArc\n---\n\n# Sketcher CreateCircle\n\n## Description\n\nThe \"\" [Sketcher CreateCircle](Sketcher_CreateCircle.md) tool creates a circle by its center and a point along the circle. (v1.0) : Or optionally by three points along the circle.\n\n ![](images/Sketcher_CircleExample1.png‎ ) \n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\nPos-OVP = Positional [On-View-Parameters](Sketcher_Preferences#General.md). (v1.0) \nDim-OVP = Dimensional On-View-Parameters. (v1.0) \n\n1. There are several ways to invoke the tool:\n - Press the ** [Center and rim point](Sketcher_CreateCircle.md)** button.\n - Select the **Sketcher → Sketcher geometries → Create circle by center** option from the menu.\n - Right-click in the [3D view](3D_view.md) and select the ** Create circle by center** option from the context menu.\n - Use the keyboard shortcut: **G** then **C**.\n2. The cursor changes to a cross with the current tool mode icon.\n3. The **Circle parameters** section ((v1.0) ) is added at the top of the [Sketcher Dialog](Sketcher_Dialog.md).\n4. Optionally press the **M** key or select from the dropdown list in the parameters section to change the tool mode:\n - \"\" **Center**:\n 1. Pick the center of the circle. Or with Pos-OVP: enter its X and/or Y coordinate.\n 2. Pick a point to define the radius of the circle. Or with Dim-OVP: enter this radius.\n - \"\" **3 rim points**: (v1.0) \n 1. Pick three points to define the circle. Or with Pos-OVP: enter their X and/or Y coordinates. No constraints are created for these points.\n5. The circle is created and applicable Pos-OVP and Dim-OVP based constraints are added.\n6. If the tool runs in [continue mode](Sketcher_Workbench#Continue_modes.md):\n 1. Optionally keep creating circles.\n 2. To finish, right-click or press **Esc**, or start another geometry or constraint creation tool.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher CreateCircle\n"} {"id": "freecad-docs:wiki/Sketcher_CreateEllipseByCenter.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_CreateEllipseByCenter.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_CreateEllipseByCenter.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "677be3e34b8b6f30e0ab9d793b1e1a58b41084d36a6de24cba18f96378ac29d8", "bytes": 3743, "tokens": 1216, "text": "---\n GuiCommand:\n Name: Sketcher CreateEllipseByCenter\n MenuLocation: Sketch , Sketcher geometries , Create ellipse by center\n Workbenches: Sketcher_Workbench\n Shortcut: **G** **E** **E**\n Version: 0.15\n SeeAlso: Sketcher_CreateArcOfEllipse\n---\n\n# Sketcher CreateEllipseByCenter\n\n## Description\n\nThe \"\" [Sketcher CreateEllipseByCenter](Sketcher_CreateEllipseByCenter.md) tool creates an ellipse by its center, an endpoint of one of its axes, and a point along the ellipse. (v1.0) : Or optionally by both endpoints of one of its axes and a point along the ellipse.\n\n ![](images/Sketcher_CreateEllipseByCenter_Example.png ) \n*Ellipse (white) with internal geometry (dark yellow)*\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\nPos-OVP = Positional [On-View-Parameters](Sketcher_Preferences#General.md). (v1.0) \nDim-OVP = Dimensional On-View-Parameters. (v1.0) \n\n1. There are several ways to invoke the tool:\n - Press the ** [Ellipse by center, radius, rim point](Sketcher_CreateEllipseByCenter.md)** button.\n - Select the **Sketcher → Sketcher geometries → Create ellipse by center** option from the menu.\n - Use the keyboard shortcut: **G** then **E**, then **E**.\n2. The cursor changes to a cross with the current tool mode icon.\n3. The **Ellipse parameters** section ((v1.0) ) is added at the top of the [Sketcher Dialog](Sketcher_Dialog.md).\n4. Optionally press the **M** key or select from the dropdown list in the parameters section to change the tool mode:\n - \"\" **Center**:\n 1. Pick the center of the ellipse. Or with Pos-OVP: enter its X and/or Y coordinate.\n 2. Pick an endpoint of one of the axes of the ellipse, this also defines one of its radii. Or with Dim-OVP: enter this radius and/or the angle of this axis.\n 3. Pick a point to define the other radius of the ellipse. Or with Dim-OVP: enter this radius.\n - \"\" **Axis endpoints**: (v1.0) \n 1. Pick the endpoints of one of the axes of the ellipse, this also defines one of its radii. Or with Pos-OVP: enter their X and/or Y coordinates. No constraints are created for these points.\n 2. Pick a point to define the other radius of the ellipse. Or with Pos-OVP: enter its X and/or Y coordinate. No constraint is created for this point.\n5. The ellipse is created, including a set of internal geometry (major axis, minor axis and two foci), and applicable Pos-OVP and Dim-OVP based constraints are added.\n6. If the tool runs in [continue mode](Sketcher_Workbench#Continue_modes.md):\n 1. Optionally keep creating ellipses.\n 2. To finish, right-click or press **Esc**, or start another geometry or constraint creation tool.\n\n## Notes\n\n- Elements of the internal geometry can be deleted. They can be recreated at any time with [Sketcher RestoreInternalAlignmentGeometry](Sketcher_RestoreInternalAlignmentGeometry.md).\n- Once created, the major and minor axes of an ellipse are strict and cannot be swapped by resizing. This is a consequence of the solver parametrization and the same strict behavior of [OpenCASCADE](OpenCASCADE.md). An ellipse must be rotated to swap its axes.\n\n\n {{Sketcher Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher CreateEllipseByCenter\n"} {"id": "freecad-docs:wiki/Sketcher_CreatePentagon.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_CreatePentagon.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_CreatePentagon.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d1bbdd401a5fb02ff17c65e6d9ada32a5f7a3c5ddfa7959fef8fe92a5734ddc0", "bytes": 1359, "tokens": 486, "text": "---\n GuiCommand:\n Name: Sketcher CreatePentagon\n MenuLocation: Sketch , Sketcher geometries , Create pentagon\n Workbenches: Sketcher_Workbench\n Shortcut: **G** **P** **5**\n Version: 0.15\n SeeAlso: Sketcher_CreateRegularPolygon\n---\n\n# Sketcher CreatePentagon\n\n## Description\n\nThe \"\" [Sketcher CreatePentagon](Sketcher_CreatePentagon.md) tool creates a pentagon. (v1.0) : This is the same tool as [Sketcher CreateRegularPolygon](Sketcher_CreateRegularPolygon.md) but with the number of sides preset to 5.\n\n ![](images/SketcherCreatePentagonExample.png‎ ) \n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\n1. There are several ways to invoke the tool:\n - Press the ** [Pentagon](Sketcher_CreatePentagon.md)** button.\n - Select the **Sketcher → Sketcher geometries → Create pentagon** option from the menu.\n - Use the keyboard shortcut: **G** then **P**, then **5**.\n2. For further steps see [Sketcher CreateRegularPolygon](Sketcher_CreateRegularPolygon#Usage.md).\n\n\n {{Sketcher Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher CreatePentagon\n"} {"id": "freecad-docs:wiki/Sketcher_Preferences.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_Preferences.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_Preferences.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ff03959eaef7f63eabe4d637814a3f2f4f603f1aedd651aa4d0acc173024e459", "bytes": 108594, "tokens": 7173, "text": "# Sketcher Preferences\n## Introduction\n\nThe preferences for the \"\" [Sketcher Workbench](Sketcher_Workbench.md) can be found in the [Preferences Editor](Preferences_Editor.md). In the menu select **Edit → Preferences...** and then ** Sketcher**. This group is only available if the Sketcher Workbench has been loaded in the current FreeCAD session.\n\nThere are four pages: [General](#General.md), [Grid](#Grid.md), [Display](#Display.md) and [Appearance](#Appearance.md).\n\nSome advanced preferences can only be changed in the [Parameter editor](Std_DlgParameter.md). See [Fine-tuning](Fine-tuning#Sketcher_Workbench.md).\n\nThis page has been updated for version 1.0.\n\nIn {{VersionMinus|0.21}} the [Appearance](#Appearance.md) page is labeled \\\"Colors\\\".\n\n## General\n\n\"\"\n\nOn this page you can specify the following:\n\n+++\n| Name | Description |\n+===========================================================+=============================================================================================================================================================================================================================================================================================================================================================================================================================================+\n| | If checked, the [sketcher dialog](Sketcher_Dialog.md) will show the section *Advanced solver control* to adjust solver settings. |\n| **Show section 'Advanced solver control'** | |\n| | |\n+++\n| | If checked, a special solver algorithm will be used while dragging sketch elements. This avoids that the sketch flips around while dragging. It is an improvement for most cases, however for complex sketches this option can increase the time to solve the sketch. |\n| **Improve solving while dragging** | |\n| | |\n+++\n| | If checked, new constraints that are redundant are automatically removed. |\n| **Auto remove redundants** | |\n| | |\n+++\n| | If checked, the **Esc** key can trigger exiting sketch edit mode. The option to disable this may be useful for users who are used to pressing **Esc** as part of their workflow in other CAD solutions but don\\'t necessarily want to exit a sketch. |\n| **Esc can leave sketch edit mode** | |\n| | |\n+++\n| | If checked, the shaded view is disabled when entering sketch edit mode. |\n| **Disable shading in edit mode** | |\n| | |\n+++\n| | If checked, you will be informed with a dialog about constraint substitutions. For example if the endpoints of two arcs are connected with the [coincident constraint](Sketcher_ConstrainCoincident.md) and you reconnect the arcs using the [tangent constraint](Sketcher_ConstrainTangent.md), the coincidence constraint will be substituted by the tangent constraint and you will get a popup dialog telling you this. |\n| **Notify automatic constraint substitutions** | |\n| | |\n+++\n| | If checked, the [Coincident constraint tool](Sketcher_ConstrainCoincident.md) and [PointOnObject constraint tool](Sketcher_ConstrainPointOnObject.md) are unified in a [single tool](Sketcher_ConstrainCoincidentUnified.md). |\n| **Unify Coincident and PointOnObject** | |\n| | |\n| (v1.0) | **After changing this preference you must restart FreeCAD.** |\n| | |\n+++\n| | If checked, the [Automatic horizontal/vertical constraint tool](Sketcher_ConstrainHorVer.md) is added to the toolbar (it is always available in the menu and through its shortcut), and the [Horizontal constraint tool](Sketcher_ConstrainHorizontal.md) and [Vertical constraint tool](Sketcher_ConstrainVertical.md) are grouped below it in a dropdown. |\n| **Auto tool for Horizontal/Vertical** | |\n| | |\n| (v1.0) | **After changing this preference you must restart FreeCAD.** |\n| | |\n+++\n| | If checked, [external geometry](Sketcher_External.md) is always added as reference geometry regardless of the current [construction mode](Sketcher_ToggleConstruction.md). |\n| **Always add external geometry as reference** | |\n| | |\n| (v1.1) | |\n+++\n| | Specifies the dimensional constraint tools for the toolbar (all dimensional tools are always available in the menu and through their shortcuts). The options are: |\n| **Dimensioning constraints** | |\n| | - |\n| (v1.0) | **Single tool** |\n| | |\n| | : A combined [Dimension tool](Sketcher_Dimension.md) for all dimensional constraints. The separate tools are grouped below it in a dropdown. |\n| | |\n| | - |\n| | **Separated tools** |\n| | |\n| | : Only the separate tools. |\n| | |\n| | - |\n| | **Both** |\n| | |\n| | : Both the combined [Dimension tool](Sketcher_Dimension.md) and the separated tools. |\n| | |\n| | |\n| | **After changing this preference you must restart FreeCAD.** |\n| | |\n+++\n| | Specifies how the combined [Dimension tool](Sketcher_Dimension.md) handles circles and arcs. The options are: |\n| **Dimension tool diameter/radius mode** | |\n| | - |\n| (v1.0) | **Auto** |\n| | |\n| | : First apply a radius dimension to arcs and a diameter dimension to circles. Before picking the point that will position the dimension, it is possible to switch with the **M** key. |\n| | |\n| | - |\n| | **Diameter** |\n| | |\n| | : Always first apply a diameter dimension. Idem. |\n| | |\n| | - |\n| | **Radius** |\n| | |\n| | : Always first apply a radius dimension. Idem. |\n+++\n| | Specifies the visibility mode for the On-View-Parameters. The options are: |\n| **On-View-Parameters** | |\n| | - |\n| (v1.0) | **None** |\n| | |\n| | : On-View-Parameters are completely disabled. |\n| | |\n| | - |\n| | **Dimensions only** |\n| | |\n| | : Only dimensional On-View-Parameters are enabled. They are the most useful. For example the radius of a circle. |\n| | |\n| | - |\n| | **Position and dimensions** |\n| | |\n| | : Both positional and dimensional On-View-Parameters are enabled. Positional parameters are the position of the cursor. For example for the center of a circle. |\n+++\n\n## Grid\n\n\"\"\n\nOn this page you can specify the following:\n\n+++\n| Name | Description |\n+======================================+======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================+\n| | If checked, a grid will be shown while the sketch is in edit mode. Used for new sketches. Is stored in the **Show Grid** property of sketches. |\n| **Grid** | |\n| | |\n+++\n| | If checked, grid spacing is automatically adapted based on the view dimensions. Used for new sketches. Is stored in the **Grid Auto** property of sketches. |\n| **Grid Auto Spacing** | |\n| | |\n+++\n| | The distance between two subsequent grid lines. Used as a base value if **Grid Auto Spacing** is enabled. Used for new sketches. Is stored in the **Grid Size** property of sketches. |\n| **Grid spacing** | |\n| | |\n+++\n| | The grid spacing threshold in pixels. Only used if **Grid Auto Spacing** is enabled. If the onscreen spacing is smaller than this value, physical grid spacing is multiplied by the **Major grid lines every** value. If the onscreen spacing is larger than the threshold value times the **every** value, physical grid spacing is divided by the **every** value. If the **every** value is set to 1, 10 is used instead in these calculations. |\n| **Pixel size threshold** | |\n| | |\n+++\n| | For minor grid lines you can specify: |\n| **Minor grid lines** | |\n| | - |\n| | **Line pattern** |\n| | |\n| | |\n| | - |\n| | **Line width** |\n| | |\n| | |\n| | - |\n| | **Line color** |\n| | |\n+++\n| | For major grid lines you can specify: |\n| **Major grid lines** | |\n| | - |\n| | **Major grid lines every** |\n| | |\n| | : The number of squares between major grid lines. Set to 1 to disable major grid lines. |\n| | |\n| | - |\n| | **Line pattern** |\n| | |\n| | |\n| | - |\n| | **Line width** |\n| | |\n| | |\n| | - |\n| | **Line color** |\n| | |\n+++\n\n## Display\n\n\"\"\n\nOn this page you can specify the following:\n\n+++\n| Name | Description |\n+=======================================================================+===================================================================================================================================================================================================================================================================================================================+\n| | The font size used for the labels and constraints in the sketch. |\n| **Font size** | |\n| | |\n+++\n| | The 3D view is scaled based on this factor. |\n| **View scale ratio** | |\n| | |\n| (v0.21) | |\n+++\n| | Curves are approximated by polygon segments for visualization. This value defines the number of segments. The lower limit is 50 segments. Higher values refine the visualization but can lead to longer calculation times, especially for [B-splines](Sketcher_CreateBSpline.md). |\n| **Segments per geometry** | |\n| | |\n+++\n| | If checked, a dialog will pop up to input a value for new dimensional constraints. |\n| **Ask for value after creating a dimensional constraint** | |\n| | |\n+++\n| | If checked, geometry creation tools will remain active after creating an element. You can leave a tool any time by right-clicking in the sketch. |\n| **Geometry creation \"Continue Mode\"** | |\n| | |\n+++\n| | If checked, constraint creation tools will remain active after creating a constraint. You can leave a tool any time by right-clicking in the sketch. |\n| **Constraint creation \"Continue Mode\"** | |\n| | |\n+++\n| | If checked, the length unit from the selected [unit system](Preferences_Editor#Units.md) is used but not displayed in sketch constraints. Only for supported unit systems. |\n| **Hide base length units for supported unit systems** | |\n| | |\n+++\n| | If checked, cursor coordinates are displayed beside the cursor while editing a sketch. |\n| **Show coordinates beside cursor while editing** | |\n| | |\n| (v0.21) | |\n+++\n| | If checked, cursor coordinates will use the system decimals setting instead of the short form. |\n| **Use system decimals setting for cursor coordinates** | |\n| | |\n| (v0.21) | |\n+++\n| | If checked, the names of dimensional constraints (if available) are displayed using the given format: |\n| **Show dimensional constraint name with format** | |\n| | - |\n| (v0.21) | **%N** |\n| | |\n| | : Parameter name. |\n| | |\n| | - |\n| | **%V** |\n| | |\n| | : Dimension value. |\n+++\n| | If checked, all objects that depend on the sketch will be hidden when the sketch is opened. Note that this may have no effect if the **Show objects used for external geometry** and/or **Show objects that the sketch is attached to** options are selected. |\n| **Hide all objects that depend on the sketch** | |\n| | |\n+++\n| | If checked, hidden objects used for external geometry will be shown when the sketch is opened. |\n| **Show objects used for external geometry** | |\n| | |\n+++\n| | If checked, hidden objects the sketch is attached to will be shown when the sketch is opened. |\n| **Show objects that the sketch is attached to** | |\n| | |\n+++\n| | If checked, the camera position is moved back to where it was before the sketch was opened. |\n| **Restore camera position after editing** | |\n| | |\n+++\n| | If checked, camera mode will be forced to orthographic when the sketch is opened. Camera mode will be restored when leaving edit mode. This preference is only available if **Restore camera position after editing** is activated. |\n| **Force orthographic camera when entering edit** | |\n| | |\n+++\n| | If checked, the sketch will open with \\'Section View\\' active. |\n| **Open sketch in Section View mode** | |\n| | |\n+++\n| | If pressed, the **Visibility automation** settings will be applied to existing sketches too. Otherwise they will only be used for new sketches. |\n| ****Apply to existing sketches**** | |\n| | |\n+++\n\n## Appearance\n\n\"\"\n\nUnless otherwise stated these preferences are only used while a sketch is in edit mode.\n\nOn this page you can specify the following:\n\n+++\n| Name | Description |\n+=================================================+===========================================================================================================================================================================================================================+\n| | The color used for sketch elements while they are being created. |\n| **Creating line** | |\n| | |\n+++\n| | The color used for the coordinates displayed while creating sketch elements. |\n| **Coordinate text** | |\n| | |\n+++\n| | The color used for the crosshair cursor displayed while creating sketch elements. |\n| **Cursor crosshair** | |\n| | |\n+++\n| | The colors used for constrained and unconstrained normal geometry. The line pattern and line width can also be specified. |\n| **Geometry** | |\n| | |\n| (v1.0) | |\n+++\n| | The colors used for constrained and unconstrained [construction geometry](Sketcher_ToggleConstruction.md). (v1.0) : The line pattern and line width can also be specified. |\n| **Construction geometry** | |\n| | |\n+++\n| | The colors used for constrained and unconstrained [internal alignment edges](Sketcher_RestoreInternalAlignmentGeometry.md). (v1.0) : The line pattern and line width can also be specified. |\n| **Internal alignment edge** | |\n| | |\n+++\n| | The color used for [external geometry](Sketcher_External.md). (v1.0) : The line pattern and line width can also be specified. |\n| **External geometry** | |\n| | |\n+++\n| | The color used for a fully constrained sketch. |\n| **Fully constrained Sketch** | |\n| | |\n+++\n| | The color used for an invalid sketch. |\n| **Invalid Sketch** | |\n| | |\n+++\n| | The color used for [driving geometric constraints](Sketcher_ToggleDrivingConstraint.md). |\n| **Constraint symbols** | |\n| | |\n+++\n| | The color used for [driving dimensional constraints](Sketcher_Dimension.md). |\n| **Dimensional constraint** | |\n| | |\n+++\n| | The color used for [reference dimensional constraints](Sketcher_ToggleDrivingConstraint.md). |\n| **Reference constraint** | |\n| | |\n+++\n| | The color used for [expression](Expressions.md) dependent dimensional constraints. |\n| **Expression dependent constraint** | |\n| | |\n+++\n| | The color used for [deactivated constraints](Sketcher_ToggleActiveConstraint.md). |\n| **Deactivated constraint** | |\n| | |\n+++\n| | The color used for [vertices](Glossary#Vertex.md) (points) when not in edit mode. |\n| **Colors outside Sketcher: Vertex** | |\n| | |\n+++\n| | The color used for [edges](Glossary#Edge.md) when not in edit mode. |\n| **Colors outside Sketcher: Edge** | |\n| | |\n+++\n\nThe colors for selections while a sketch is in edit mode are controlled by the global settings **Enable preselection highlighting** and **Enable selection highlighting**, see the [Preferences Editor](Preferences_Editor#Selection.md).\n\nThe size of the vertices in edit mode is controlled by the **Marker size** [setting](Preferences_Editor#3D_View.md).\n\n## Note\n\nThere is another preference that has an influence on sketches. If the **Transparent objects** preference on the [Display → 3D View](Preferences_Editor#3D_View.md) tab is set to {{Value|Backface pass}}, arrowheads on one end of sketch dimensions are hidden on some systems. When viewed from the rear the dimension value can then also be hidden. Versions 0.19 to 0.21 (except Link branch) are affected. In versions 0.19 and 0.20 the effect only occurs if **Show grid** is deactivated in the [Edit controls](Sketcher_Dialog#Edit_controls.md) section of the [Task panel](Task_panel.md) as shown below.\n\nSee [forum topic](https://forum.freecad.org/viewtopic.php?t=70975&start=10).\n\n \"\" \"\" \n*Front view, grid enabled and grid disabled*\n\n \"\" \"\" \n*Rear view, grid enabled and grid disabled hiding arrowheads on the opposite end as well as the dimension value*\n\n\n---\n⏵ [documentation index](../README.md) > [Preferences](Category_Preferences.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher Preferences\n"} {"id": "freecad-docs:wiki/Sketcher_Scale.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_Scale.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_Scale.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "08b64ee59ec67b755af7971174d678605868c047058cc1b7e42ce48e46019342", "bytes": 2284, "tokens": 729, "text": "---\n GuiCommand:\n Name: Sketcher Scale\n MenuLocation: Sketch , Sketcher tools , Scale transform\n Workbenches: Sketcher_Workbench\n Shortcut: **Z** **P** **S**\n Version: 1.0\n SeeAlso: \n---\n\n# Sketcher Scale\n\n## Description\n\nThe \"\" [Sketcher Scale](Sketcher_Scale.md) tool scales or optionally creates scaled copies of selected elements.\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\nPos-OVP = Positional [On-View-Parameters](Sketcher_Preferences#General.md).\nDim-OVP = Dimensional On-View-Parameters.\n\n1. Select one or more edges and/or [Point objects](Sketcher_CreatePoint.md). Constraints restricted to the selected elements are also processed. If the original elements are scaled, any other constraints associated with them will be deleted.\n2. There are several ways to invoke the tool:\n - Press the ** [Scale transform](Sketcher_Scale.md)** button.\n - Select the **Sketch → Sketcher tools → Scale transform** option from the menu.\n - Right-click in the [3D view](3D_view.md) and select the ** Scale transform** option from the context menu.\n - Use the keyboard shortcut: **Z** then **P**, then **S**.\n3. The cursor changes to a cross with the tool icon.\n4. The **Scale parameters** section is added at the top of the [Sketcher Dialog](Sketcher_Dialog.md).\n5. Optionally press the **U** key or check the **Keep original geometries** checkbox to create scaled copies of the selected elements.\n6. Pick the base point for the scale operation. Or with Pos-OVP: enter its X and/or Y coordinate.\n7. Pick the end point of the first auxiliary line. Its angle and length are arbitrary.\n8. Pick the end point of the second auxiliary line. Its angle is also arbitrary. Its length relative to the length of the first auxiliary line defines the scale factor. Or with Dim-OVP: enter the scale factor.\n9. The original elements are scaled or scaled copies are created. No Pos-OVP or Dim-OVP based constraints are added.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher Scale\n"} {"id": "freecad-docs:wiki/Sketcher_SelectElementsWithDoFs.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_SelectElementsWithDoFs.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_SelectElementsWithDoFs.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "561107feb080e69ffe7bdf565e628e241120876c1a5af3ba47c0f64b7bd766d6", "bytes": 1560, "tokens": 498, "text": "---\n GuiCommand:\n Name: Sketcher SelectElementsWithDoFs\n MenuLocation: Sketch , Sketcher visual , Select unconstrained DoF\n Workbenches: Sketcher_Workbench\n Shortcut: **Z** **F**\n Version: 0.18\n---\n\n# Sketcher SelectElementsWithDoFs\n\n## Description\n\nThe \"\" [Sketcher SelectElementsWithDoFs](Sketcher_SelectElementsWithDoFs.md) tool selects the not fully constrained elements in the sketch.\n\nIf such elements exist in a sketch the [Solver messages section of the Sketcher Dialog](Sketcher_Dialog#Solver_messages.md) displays this message:\n\n- Under constrained: n DoF(s)\n\nWhere *n* is the remaining number of degrees of freedom. Clicking the underlined text will select the under-constrained elements.\n\nPlease note that a sketch can also have redundant constraints if one of the other [solver messages](Sketcher_Dialog#Solver_messages.md) is displayed.\n\n## Usage\n\n1. There are several ways to invoke the tool:\n - Click the underlined text in the Sketcher Dialog as described above.\n - Select the **Sketch → Sketcher visual → Select unconstrained DoF** option from the menu.\n - Use the keyboard shortcut: **Z** then **F**.\n2. The under-constrained sketch elements are selected.\n3. Optionally click in an empty area in the [3D view](3D_view.md) to clear the selection.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher SelectElementsWithDoFs\n"} {"id": "freecad-docs:wiki/Sketcher_ToggleActiveConstraint.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_ToggleActiveConstraint.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_ToggleActiveConstraint.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6f0f315e8473cc51a9a2ea9403046d87c2f3291fcc310c8ddc21401ee936547b", "bytes": 3392, "tokens": 1069, "text": "---\n GuiCommand:\n Name: Sketcher ToggleActiveConstraint\n Workbenches: Sketcher_Workbench\n MenuLocation: Sketch , Sketcher constraints , Activate/deactivate constraint\n Shortcut: **K** **Z**\n Version: 0.19\n SeeAlso: Sketcher_ToggleDrivingConstraint\n---\n\n# Sketcher ToggleActiveConstraint\n\n## Description\n\nThe \"\" [Sketcher ToggleActiveConstraint](Sketcher_ToggleActiveConstraint.md) tool activates or deactivates selected constraints. Deactivating constraints allows you to test other geometry arrangements without deleting constraints.\n\nThis is tool is similar to [Sketcher ToggleDrivingConstraint](Sketcher_ToggleDrivingConstraint.md), but contrary to that tool also works for geometric constraints, and values of deactivated dimensional constraints are preserved.\n\n## Usage\n\n1. Select one or more constraints.\n2. There are several ways to invoke the tool:\n - Press the ** [Activate/deactivate constraint](Sketcher_ToggleActiveConstraint.md)** button.\n\n - Select the **Sketch → Sketcher constraints → Activate/deactivate constraint** option from the menu.\n\n - \n (v1.0) \n \n : Right-click in the [3D view](3D_view.md) and select the ** Activate/deactivate constraint** option from the context menu.\n\n - In the **Constraints** section of the [Sketcher Dialog](Sketcher_Dialog.md) select the **Activate** or **Deactivate** option from the context menu. The offered option depends on the state of the constraint under the cursor.\n\n - Use the keyboard shortcut: **K** then **Z**.\n3. Active selected constraints are deactivated and turn grey (default [color](Sketcher_Preferences#Appearance.md)), while deactivated selected constraints are activated and return to red (default color).\n\n## Example\n\n \"\" \n*A fully constrained sketch.*\n\n \"\" \n*One of the angular constraints has been deactivated, the sketch is no longer fully constrained.*\n\n \"\" \n*The unconstrained geometry can be moved around. The deactivated constraint is still available, and can be re-activated to return to the fully constrained sketch.*\n\n## Scripting\n\n\n**See also:**\n\n[FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe active status of a constraint can be controlled in [macros](macros.md) and from the [Python console](Python_console.md). \n```python\nSketchObject.toggleActive(index)\n```\n\nUse the `toggleActive` method of an existing [Sketcher SketchObject](Sketcher_SketchObject.md), and the `index` of the constraint to activate it or deactivate it. The index starts from `0` all the way to `N-1`, where `N` is the total number of constraints.\n\nExample: \n```python\nimport FreeCAD as App\n\nsketch = App.ActiveDocument.Sketch\nsketch.toggleActive(3)\n```\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher ToggleActiveConstraint\n"} {"id": "freecad-docs:wiki/Sketcher_ViewSketch.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Sketcher_ViewSketch.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Sketcher_ViewSketch.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "90b33c3218f875c4ea53b54d44eef52a4767c373570f79cdbd96ff31c8e27c9f", "bytes": 1198, "tokens": 392, "text": "---\n GuiCommand:\n Name: Sketcher ViewSketch\n MenuLocation: Sketch , View sketch\n Workbenches: Sketcher_Workbench\n Shortcut: **Q** **P**\n---\n\n# Sketcher ViewSketch\n\n## Description\n\nThe \"\" [Sketcher ViewSketch](Sketcher_ViewSketch.md) tool aligns the [3D view](3D_view.md) with the sketch. The view is rotated so that the view direction is perpendicular to the sketch plane, and the X axis of the sketch appears horizontal. It is useful if you have changed the view orientation to examine another aspect of the model and want to return to the default sketch view.\n\n## Usage\n\nSee also: [Sketcher Preferences](Sketcher_Preferences#Display.md).\n\n1. This tool is only available if a sketch is in [edit mode](Sketcher_EditSketch.md).\n2. There are several ways to invoke the tool:\n - Press the ** [View sketch](Sketcher_ViewSketch.md)** button.\n - Select the **Sketch → View sketch** option from the menu.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher ViewSketch\n"} {"id": "freecad-docs:wiki/Spreadsheet_AlignVCenter.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Spreadsheet_AlignVCenter.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Spreadsheet_AlignVCenter.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a20fc51c38ee2e81b14e0ed6ec225e48a7d0b84087b821c0c897b64138a9a2c8", "bytes": 1026, "tokens": 368, "text": "---\n GuiCommand:\n Name: Spreadsheet AlignVCenter\n MenuLocation: Spreadsheet , Alignment , Vertically center-align\n Workbenches: Spreadsheet_Workbench\n Version: 0.17\n---\n\n# Spreadsheet AlignVCenter\n\n## Description\n\nThe \"\" **Spreadsheet AlignVCenter** tool aligns the contents of selected cells to the center vertically.\n\n## Usage\n\n1. Make sure there is an active [spreadsheet](Spreadsheet_CreateSheet.md).\n2. Select one or more cells.\n3. There are several ways to invoke the tool:\n - Press the **[ [Vertically center-align](Spreadsheet_AlignVCenter.md)** button.\n - Select the **Spreadsheet → Alignment → [ Vertically center-align** option from the menu.\n\n\n {{Spreadsheet_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Spreadsheet](Spreadsheet_Workbench.md) > Spreadsheet AlignVCenter\n"} {"id": "freecad-docs:wiki/Std_ActivateNextWindow.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_ActivateNextWindow.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_ActivateNextWindow.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "69254c1c18157d17d2fe72dfbae6532dc915cc22ca3e1cacbb4101744f9e171f", "bytes": 889, "tokens": 276, "text": "---\n GuiCommand:\n Name: Std ActivateNextWindow\n MenuLocation: Windows , Next\n Workbenches: All\n Shortcut: **Ctrl**+**Tab**\n SeeAlso: Std_ActivatePrevWindow, Std_Windows\n---\n\n# Std ActivateNextWindow\n\n## Description\n\nThe **Std ActivateNextWindow** command activates the next window in the [Main view area](Main_view_area.md). The next window is determined by the tabs order in Main view area.\n\n## Usage\n\n1. The Main view area must contain at least two windows.\n2. There are several ways to invoke the command:\n - Select the **Windows → Next** option from the menu.\n - Use the keyboard shortcut: **Ctrl**+**Tab**.\n\n## Notes\n\n- The first 10 Main view area windows are also listed in the **Windows** menu and can be activated from there.\n\n\n---\n⏵ [documentation index](../README.md) > Std ActivateNextWindow\n"} {"id": "freecad-docs:wiki/Std_AxisCross.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_AxisCross.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_AxisCross.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d8abf1539e22ed6c857d6382a61b49066efc6e2aeaa73d0dd567b1c4e5b4a586", "bytes": 1766, "tokens": 559, "text": "---\n GuiCommand:\n Name: Std AxisCross\n MenuLocation: View , Toggle axis cross\n Workbenches: All\n Shortcut: **A** **C**\n---\n\n# Std AxisCross\n\n## Description\n\nThe **Std AxisCross** command toggles the axis cross in the active [3D view](3D_view.md).\n\nThe axis cross consists of three arrows representing the positive X, Y and Z axis of the global coordinate system. Their common start point is the origin of the global coordinate system.\n\n ![](images/Std_AxisCross_example.svg ) \n*The axis cross (the letters are not part of the axis cross)*\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Select the **View → Toggle axis cross** option from the menu.\n - Use the keyboard shortcut: **A** then **C**.\n\n## Notes\n\n- FreeCAD can display a smaller coordinate system indicator in the bottom right corner of 3D views: **Edit → Preferences... → Display → 3D View → Show coordinate system in the corner**. See [Preferences Editor](Preferences_Editor#3D_View.md).\n- The [Navigation Cube](Navigation_Cube.md) also includes a coordinate system indicator.\n\n## Preferences\n\nSee also: [Preferences Editor](Preferences_Editor.md).\n\n- The default for the axis cross can be changed: **Edit → Preferences... → Display → 3D view → Show axis cross by default**.\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nUse the `setAxisCross` method of the View object to toggle the axis cross.\n\n \n```python\nimport FreeCADGui\n\nview = FreeCADGui.ActiveDocument.ActiveView\nview.setAxisCross(True)\nview.hasAxisCross()\n```\n\n\n---\n⏵ [documentation index](../README.md) > Std AxisCross\n"} {"id": "freecad-docs:wiki/Std_MacroStepOver.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_MacroStepOver.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_MacroStepOver.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "85c3c3c40a44871f2ab922ac40381065fd5702701297b78bf1bc8aa495d5b10b", "bytes": 322, "tokens": 114, "text": "---\n GuiCommand:\n Name: Std MacroStepOver\n MenuLocation: Macro , Step over\n Workbenches: All\n Shortcut: **F10**\n SeeAlso: Std_MacroStepInto, Std_ToggleBreakpoint\n---\n\n# Std MacroStepOver\n\n## Description\n\nThis command does not work at this time.\n\n\n---\n⏵ [documentation index](../README.md) > Std MacroStepOver\n"} {"id": "freecad-docs:wiki/Std_RandomColor.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_RandomColor.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_RandomColor.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "673d7569727f5c01dbf72e19ea36571e8273a979e7723f1d46aa80b210687618", "bytes": 881, "tokens": 286, "text": "---\n GuiCommand:\n Name: Std RandomColor\n MenuLocation: View , Random color\n Workbenches: All\n---\n\n# Std RandomColor\n\n## Description\n\nThe **Std RandomColor** command applies a random **Diffuse Color** to the **Shape Appearance** of selected objects.\n\nThis page has been updated for version 1.0.\n\n## Usage\n\n1. Select one or more objects.\n2. There are several ways to invoke the command:\n - Select the **View → Random color** option from the menu.\n - Select the ** Random color** option from the [Tree view](Tree_view.md) context menu or [3D view](3D_view.md) context menu.\n\n## Notes\n\n- The **Shape Appearance** property of objects can also be changed in the [Property editor](Property_editor.md).\n\n\n---\n⏵ [documentation index](../README.md) > Std RandomColor\n"} {"id": "freecad-docs:wiki/Std_SendToPythonConsole.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_SendToPythonConsole.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_SendToPythonConsole.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2d6cf3fe5881f671dbde889228b87b7ce8fa78c97751344316341a6c966d86c4", "bytes": 5888, "tokens": 1249, "text": "---\n GuiCommand:\n Name: Std SendToPythonConsole\n MenuLocation: Edit , Send to Python Console\n Workbenches: All\n Shortcut: **Ctrl**+**Shift**+**P**\n Version: 0.19\n---\n\n# Std SendToPythonConsole\n\n## Description\n\nThe **Std SendToPythonConsole** command creates variables in the [Python console](Python_console.md) referencing a selected object and its selected subshapes, along with some other useful references. The variables and the code involved can be used in the development of Python code.\n\nDepending on the selected object and its selected subshapes, if any, the following variables are created:\n\n+++\n| Variable name | Referenced object(s) |\n+=================+=========================================================================================================================================================+\n| | The document containing the selected object |\n| {{Incode|doc}} | |\n| | |\n+++\n| | The selected Link object (only created if the selected object is a Link) |\n| {{Incode|lnk}} | |\n| | |\n+++\n| | Depending on the selected object: |\n| {{Incode|obj}} | The selected object itself (if the selected object is not a Link) |\n| | The Linked object (if the selected object is a Link) |\n+++\n| | Depending on the type of {{Incode|obj}}: |\n| {{Incode|shp}} | The {{Incode|Shape}} property of {{Incode|obj}} (for objects derived from the {{Incode|Part::Feature}} class) |\n| | The {{Incode|Mesh}} property of {{Incode|obj}} (for Mesh objects) |\n| | The {{Incode|Points}} property of {{Incode|obj}} (for Points objects) |\n+++\n| | The first selected subshape (only created if at least one subshape is selected) |\n| {{Incode|sub}} | |\n| | |\n+++\n| | A list containing all subshapes (only created if two or more subshapes are selected) |\n| {{Incode|subs}} | |\n| | |\n+++\n\n\n>>> ### Begin command Std_SendToPythonConsole\n>>> try:\n>>>     del(doc,lnk,obj,shp,sub,subs)\n>>> except Exception:\n>>>     pass\n>>> \n>>> doc = App.getDocument(\"Unnamed\")\n>>> lnk = doc.getObject(\"Link\")\n>>> obj = lnk.getLinkedObject()\n>>> shp = obj.Shape\n>>> sub = obj.getSubObject(\"Edge10\")\n>>> subs = [obj.getSubObject(\"Edge10\"),obj.getSubObject(\"Face3\"),obj.getSubObject(\"Vertex5\"),]\n>>> ### End command Std_SendToPythonConsole\n\n \n*Example output: an edge, a face, and a vertex of a [Link](Std_LinkMake.md) to a [Part Box](Part_Box.md) were selected*\n\n## Usage\n\n1. Select a single object or one or more subshapes belonging to a single object.\n2. There are several ways to invoke the command:\n - Select the **Edit → Send to Python Console** option from the menu.\n - Select the ** Send to Python Console** option from the [Tree view](Tree_view.md) context menu or [3D view](3D_view.md) context menu.\n - Use the keyboard shortcut: **Ctrl**+**Shift**+**P**.\n3. If required the [Python console](Python_console.md) opens.\n4. The [Python console](Python_console.md) receives the keyboard focus.\n\n## Notes\n\n- All previously created variables are deleted each time the command is run.\n\n- If the selected object is a Link ({{Incode|App::Link}}) and the Linked object is derived from the {{Incode|Part::Feature}} class, the {{Incode|shp}} variable will be the shape of the Linked object. If the Link has been transformed or scaled and you want to access the scaled/transformed shape, you can do so with this code:\n\n\n: \n \n```pythonlnk_shp = Part.getShape(lnk)```\n\n\n---\n⏵ [documentation index](../README.md) > Std SendToPythonConsole\n"} {"id": "freecad-docs:wiki/Std_ToggleObjects.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_ToggleObjects.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_ToggleObjects.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ceb23e630e77f550f2f3f96de073077ffdce340f4ad85dcaa01094555bc63d47", "bytes": 993, "tokens": 340, "text": "---\n GuiCommand:\n Name: Std ToggleObjects\n MenuLocation: View , Visibility , Toggle all objects\n Workbenches: All\n SeeAlso: Std_ToggleVisibility, Std_ShowSelection, Std_HideSelection, Std_ShowObjects, Std_HideObjects\n---\n\n# Std ToggleObjects\n\n## Description\n\nThe **Std ToggleObjects** command toggles the visibility of all objects belonging to the active document in [3D views](3D_view.md). Be careful when you use this command as it will also toggle the visibility of sub-elements of [PartDesign bodies](PartDesign_Body.md) and objects used for [Part Booleans](Part_Boolean.md). In most cases these should stay invisible.\n\n## Usage\n\n1. Select the **View → Visibility → Toggle all objects** option from the menu.\n\n## Notes\n\nSee [Std ToggleVisibility](Std_ToggleVisibility#Notes.md).\n\n## Scripting\n\nSee [Std ToggleVisibility](Std_ToggleVisibility#Scripting.md).\n\n\n---\n⏵ [documentation index](../README.md) > Std ToggleObjects\n"} {"id": "freecad-docs:wiki/Std_ViewGroup.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_ViewGroup.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_ViewGroup.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c72d21f7b192735e6953af0fc854c12aff1ef437addb623793180a98ab247a73", "bytes": 126, "tokens": 57, "text": "# Std ViewGroup\n1. REDIRECT [Std_View_Menu](Std_View_Menu.md)\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewGroup\n"} {"id": "freecad-docs:wiki/Std_ViewIvIssueCamPos.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_ViewIvIssueCamPos.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_ViewIvIssueCamPos.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "43e8311a047b2c5a61e396c5082e74133b28d67d2abe666d8186dcc96e363973", "bytes": 1465, "tokens": 518, "text": "---\n GuiCommand:\n Name: Std ViewIvIssueCamPos\n MenuLocation: View , Stereo , Issue camera position\n Workbenches: All\n SeeAlso: Std_FreezeViews\n---\n\n# Std ViewIvIssueCamPos\n\n## Description\n\nThe **Std ViewIvIssueCamPos** command prints the camera settings of the active [3D view](3D_view.md) in the [Report view](Report_view.md) and the [Python console](Python_console.md).\n\n \n```python OrthographicCamera { viewportMapping ADJUST_CAMERA position 57.73505 -57.73502 57.735027 orientation 0.74290609 0.30772209 0.59447283 1.2171158 nearDistance 81.588844 farDistance 109.60551 aspectRatio 1 focalDistance 100 height 100 } \n``` \n*Example output: camera settings after changing to [isometric view](Std_ViewIsometric.md) in a new document*\n\n## Usage\n\n1. Select the **View → Stereo → Issue camera position** option from the menu.\n\n## Notes\n\n- The camera settings can be used to add frozen views to a ***.cam** file. See [Std FreezeViews](Std_FreezeViews.md).\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe `getCamera` method of the View object returns the same camera settings in a single string.\n\n \n```python\nimport FreeCADGui\n\nview = FreeCADGui.ActiveDocument.ActiveView\nview.getCamera()\n```\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewIvIssueCamPos\n"} {"id": "freecad-docs:wiki/Std_ViewRight.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Std_ViewRight.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Std_ViewRight.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "702093cdf74dd7813de3ec8afb3b27fc328c9c9d633c9ed1cda1401181c62b44", "bytes": 1030, "tokens": 350, "text": "---\n GuiCommand:\n Name: Std ViewRight\n MenuLocation: View , Standard views , Right\n Workbenches: All\n Shortcut: **3**\n SeeAlso: Std_ViewFront, Std_ViewTop\n---\n\n# Std ViewRight\n\n## Description\n\nThe **Std ViewRight** command points the camera in the active [3D view](3D_view.md) in the direction of the negative X axis.\n\n ![](images/FreeCAD_views_front.svg ) \n*Arrow 3 points in the direction of the right view*\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Right](Std_ViewRight.md)** button.\n - Select the **View → Standard views → Right** option from the menu.\n - Select the **Standard views → Right** option from the [3D view](3D_view.md) context menu.\n - Use the keyboard shortcut: **3**.\n\n## Scripting\n\nSee [Std ViewFront](Std_ViewFront#Scripting.md).\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewRight\n"} {"id": "freecad-docs:wiki/TNP.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TNP.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TNP.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0934602663a67cef8df3cd0008568825bf3811a57c3314d08edbe5c18f965d3f", "bytes": 132, "tokens": 51, "text": "# TNP\n1. REDIRECT [Topological naming problem](Topological_naming_problem.md)\n\n\n---\n⏵ [documentation index](../README.md) > TNP\n"} {"id": "freecad-docs:wiki/TechDraw_API.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TechDraw_API.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TechDraw_API.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8b2567e5dc2436a25f8bd0445905f8f7d4a0a580cbffd35cbcc69c9ecfbaaf4b", "bytes": 9534, "tokens": 3851, "text": "# TechDraw API\n**(November 2018) This information may be incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation].** These functions are part of the [TechDraw Workbench](TechDraw_Workbench.md) and can be used in [macros](Macros.md) and from the [Python](Python.md) console once the `TechDraw` module has been imported.\n\nGood examples of basic TechDraw scripting can be found in the [unit test scripts](https://github.com/FreeCAD/FreeCAD/tree/master/src/Mod/TechDraw/TDTest).\n\nSee the [TechDrawGui API](TechDrawGui_API.md) for more functions.\n\nExample:\n\n \n```python\nimport FreeCAD\nimport TechDraw\n\npage = FreeCAD.ActiveDocument.addObject('TechDraw::DrawPage', 'Page')\nFreeCAD.ActiveDocument.addObject('TechDraw::DrawSVGTemplate', 'Template')\nFreeCAD.ActiveDocument.Template.Template = templateFileSpec\nFreeCAD.ActiveDocument.Page.Template = FreeCAD.ActiveDocument.Template\npage.ViewObject.show()\nview = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart', 'View')\nrc = page.addView(view)\n```\n\n {{APIFunction|EdgeWalker|listOfEdges, [bool]|Creates wires from edges in input by planar graph traversal. Optionally exclude the OuterWire by setting optional parameter to false.|List of wires sorted by size (descending)}} {{APIFunction|findOuterWire|listOfEdges|Finds the OuterWire (largest) of a list of edges (that form a planar graph).|Outer wire}} {{APIFunction|findShapeOutline|TopoShape, scale, direction|Project shape in direction and find outer wire of result.|Outline wire}}\n\n\n{{APIFunction|viewPartAsDxf|DrawViewPart|Return the edges of a DrawViewPart in Dxf format.|String}}\n\nExample:\n\n \n```python\nfileSpecDxf = \"fcOut.dxf\"\nv = App.ActiveDocument.View\ns = TechDraw.viewPartAsDxf(v)\ndxfEnd = \"0\\nEOF\\n\"\ndxfFile = open(fileSpecDxf, \"w\")\ndxfFile.write(s)\ndxfFile.write(dxfEnd)\ndxfFile.close()\n```\n\n\n{{APIFunction|viewPartAsSvg|DrawViewPart|Return the edges of a DrawViewPart in Svg format.|String}}\n\nExample:\n\n \n```python\nfileSpecSvg = \"fcOut.svg\"\nv = App.ActiveDocument.View\ns = TechDraw.viewPartAsSvg(v)\nhead = '\\n'\ntail = '\\n'\nsvgFile = open(fileSpecSvg, \"w\")\nsvgFile.write(head)\nsvgFile.write(s)\nsvgFile.write(tail)\nsvgFile.close()\n```\n\n\n{{APIFunction|writeDXFView|DrawViewPart, FileName|Save the DrawViewPart in Dxf.|File}}\n\nExample:\n\n \n```python\nimport TechDraw\nTechDraw.writeDXFView(myPart,myFileName)\n```\n\n\n{{APIFunction|writeDXFPage|DrawPage, FileName|Save the DrawPage in Dxf.|File}}\n\nExample:\n\n \n```python\nimport TechDraw\nTechDraw.writeDXFPage(myPage,myFileName)\n```\n\n### DrawViewPart Cosmetics \n\n#### CosmeticVertex (CV) routines accessible from Python \n\ndvp = App.ActiveDocument.View #CV\\'s belong to views.\nAdd a CosmeticVertex at p1 (View coordinates). Returns unique tag.\ntag = dvp.makeCosmeticVertex(vector p1)\n\nAdd a CosmeticVertex at p1 (3d model coordinates). Returns unique tag.\ntag = dvp.makeCosmeticVertex3d(vector p1)\n\nReturns CosmeticVertex with unique id.\ncv = dvp.getCosmeticVertex(string id)\n\nReturns CosmeticVertex with name (Vertex6). Used in selections.\ncv = dvp.getCosmeticVertexBySelection(string name)\n\nRemoves CosmeticVertex from View. Returns None.\ndvp.removeCosmeticVertex(object cv)\n\nRemoves all CosmeticVertices from the View. Returns None.\ndvp.clearCosmeticVertices()\n\nCosmeticView attributes\nTag: unique identifier. String.\nPoint: location within view. Vector.\n\n\n- - \n\n\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n# Py CosmeticVertex demo\nimport FreeCAD\nimport TechDraw\n\n\nv = App.ActiveDocument.View\np = App.Vector(-3.0, -3.0, 0.0)\n\n\n#make CV\ntag = v.makeCosmeticVertex(p)\nprint(\"t: {}\".format(tag))\n\n\n#retrieve CV\ncv = v.getCosmeticVertex(tag)\nprint(\"cv: {}\".format(cv))\nprint(\"Tag: {}\".format(cv.Tag))\n\n\ncv2 = v.getCosmeticVertexBySelection(\"Vertex4\")\nprint(\"New Point: {}\".format(cv2.Point))\n\n\n#make CV from 3d\np3d = App.Vector(2.0, 2.0, 2.0)\nprint(\"3d point in: {}\".format(p3d))\ntag3d = v.makeCosmeticVertex3d(p3d)\ncv3 = v.getCosmeticVertex(tag3d)\nprint(\"3d point out: {}\".format(cv3.Point))\n```\n\n\n#### CosmeticEdge (CE) routines accessible from Python \n\ndvp = App.ActiveDocument.View #CE\\'s belong to views.\nMake a CosmeticEdge from p1 to p2(View coordinates). Returns unique tag.\ntag = dvp.makeCosmeticLine(p1, p2)\n\nMake a CosmeticEdge at center with radius radius(View coordinates). Returns unique tag.\ntag = dvp.makeCosmeticCircle(center, radius)\n\nMake a CosmeticEdge at center with radius radius(View coordinates) from start angle to end angle. Returns unique tag.\ntag = dvp.makeCosmeticCircleArc(center, radius, start, end)\n\nReturns CosmeticEdge with unique id.\nce = dvp.getCosmeticEdge(id)\n\nReturns CosmeticEdge by name (Edge25). Used in selections.\nce = dvp.getCosmeticEdgeBySelection(name)\n\nRemoves CosmeticEdge ce from View. Returns None.\ndvp.removeCosmeticEdge(ce)\n\nRemoves all CosmeticLines from the View. Returns None.\ndvp.clearCosmeticEdges()\n\nCosmeticEdge attributes\nTag: unique identifier. String.\nFormat: appearance attributes (style, color, weight, visible). Tuple.\n\n\n- - \n\n\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n# Py CosmeticEdge demo\nimport FreeCAD\nimport TechDraw\n\n\n#points\norg = App.Vector(0.0, 0.0, 0.0)\nmidTop = FreeCAD.Vector (1.0, 5.0, 0.0) # middle, top\nmidBot = FreeCAD.Vector(2.0, -5.0, 0.0) # middle, bottom\nstdZ = FreeCAD.Vector(0.0, 0.0, 1.0)\ncenter = FreeCAD.Vector(0.0, 0.0, 0.0)\narcCenter = FreeCAD.Vector(3.0, 3.0, 0.0)\nvPt = FreeCAD.Vector(-3.0, 3.0, 0.0)\ntopRight = FreeCAD.Vector(5.0, 5.0, 0.0)\nbottomLeft = FreeCAD.Vector(-5.0, -5.0, 0.0)\n\n\n#angles\narcStart = -45\narcEnd = 45\n\n\n#styles\nsolid = 1 \ndashed = 2\ndotted = 3\n#weights\nweight15 = 0.15\nweight75 = 0.75\n#colors\npyRed = (1.0, 0.0, 0.0, 0.0)\npyBlue = (0.0, 1.0, 0.0, 0.0)\npyGreen = (0.0, 0.0, 1.0, 0.0)\npyBlack = (0.0, 0.0, 0.0, 0.0)\nshadow = (0.1, 0.1, 0.1, 0.0)\n\n\nradius = 5.0\nstyle = dashed\nweight = weight75\n\n\ndvp = App.ActiveDocument.View\n\n\nprint(dvp)\n\n\nprint(\"making line\")\ntag = dvp.makeCosmeticLine(midTop,midBot,style, weight, pyBlue)\nce = dvp.getCosmeticEdge(tag)\nprint(\"line tag: {}\".format(tag))\n\n\nprint(\"making diagonal\")\ndvp.makeCosmeticLine(bottomLeft,topRight,solid, weight, pyGreen)\n\n\nprint(\"making circle\")\ntag2 = dvp.makeCosmeticCircle(center, radius, style, weight, pyRed)\nce2 = dvp.getCosmeticEdge(tag2)\n\n\nprint(\"making circleArc\")\ndvp.makeCosmeticCircleArc(arcCenter, radius, arcStart, arcEnd, style, weight, shadow)\n\n\n#replace\nprint(\"making new format\")\noldFormat = ce.Format\nnewFormat = (dotted,oldFormat[1], pyRed, True)\nce.Format = newFormat\n\n\nprint(\"removing CE with tag: {}\".format(tag2))\ndvp.removeCosmeticEdge(tag2)\n\n\nprint(\"finished\")\n```\n\n\n#### CenterLine (CL) routines accessible from Python \n\nMakes a new CenterLine\ntag = dvp.makeCenterLine(subObjs, mode)\nRetrieves CenterLine with unique tag.\ncl = dvp.getCenterLine(tag)\n\nRetrieves CenterLine by subobject name. Used in selection.\ncl = dvp.getCenterLine(\\\"Edge5\\\")\n\nRemoves CenterLine cl from View. Returns None.\ndvp.removeCenterLine(cl)\n\nCenterLine Attributes\nTag: unique identifier. String. ReadOnly.\nType: 0 - face, 1 - 2 line, 2 - 2 point. Integer. ReadOnly.\nMode: 0 - vert, 1 - horiz, 2 - aligned. Integer.\nFormat: appearance attributes (style, color, weight, visible). Tuple.\nHorizShift: left/right offset. Float.\nVertShift: up/down offset. Float.\nRotation: rotation in degrees. Float.\nExtension: additional length to be added. Float.\nFlip: reverse the order of points for 2 point CenterLine. Boolean.\nEdges: names of source edges. List of string.\nFaces: names of source faces. List of string.\nPoints: names of source points (Vertices). List of string.\n\n\n- - \n\n\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n# Py CenterLine demo\nimport FreeCAD\nimport Part\nimport TechDraw\n\n\nstart = FreeCAD.Vector (1.0, 5.0, 0.0) # middle, top\nend = FreeCAD.Vector(1.0, -5.0, 0.0) # middle, bottom\nfaceNames = [\"Face0\"]\nedgeNames = [\"Edge2\", \"Edge3\"]\nvertNames = [\"Vertex1\", \"Vertex2\"]\nvMode = 0 #vertical\nhMode = 1 #horizontal\naMode = 2 #aligned\n#styles\nsolid = 1 \ndashed = 2\ndotted = 3\n#weights\nweight15 = 0.15\nweight75 = 0.75\n#colors\npyRed = (1.0, 0.0, 0.0, 0.0)\npyBlue = (0.0, 1.0, 0.0, 0.0)\npyBlack = (0.0, 0.0, 0.0, 0.0)\n#adjustments\nhShift = 1.0\nvShift = 1.0\nextend = 4.0\nrotate = 30.0\nflip = False;\n\n\ndvp = App.ActiveDocument.View\n\n\nprint(\"making face CenterLine\")\ntag = dvp.makeCenterLine(faceNames,vMode)\ncline = dvp.getCenterLine(tag)\nprint(\"cline tag: {}\".format(tag))\n\n\n#replace\nprint(\"making new format\")\noldFormat = cline.Format\nnewFormat = (dotted,oldFormat[1], pyRed, True)\ncline.Format = newFormat\ncline.Extension = 10.0\n\n\nprint(\"making edgeCenterLine\")\ncline2 = dvp.makeCenterLine(edgeNames,hMode)\n\n\nprint(\"making vertexCenterLine\")\ncline3 = dvp.makeCenterLine(vertNames,aMode)\n\n\nprint(\"finished\")\n```\n\n\n### DrawViewPart Geometry \n\n\\[topoShapeEdge\\] = dvp.getVisibleEdges()\n\n\\[topoShapeEdge\\] = dvp.getHiddenEdges()\n\ntopoShapeEdge = dvp.getEdgeByIndex(i)\ntopoShapeEdge = dvp.getEdgeBySelection(\\\"Edge1\\\")\n\ntopoShapeVertex = dvp.getVertexByIndex(i)\ntopoShapeVertex = dvp.getVertexBySelection(\\\"Vertex1\\\")\n\nRedraw the graphic for this View.\ndvp.requestPaint()\n\n {{TechDraw Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [API](Category_API.md) > [Poweruser Documentation](Category_Poweruser%20Documentation.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw API\n"} {"id": "freecad-docs:wiki/TechDraw_ExtensionLineParallel.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TechDraw_ExtensionLineParallel.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TechDraw_ExtensionLineParallel.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "81b01731a6a519f07702ae81f4c62a43c07043b6c6e4e24979a08e286175aa57", "bytes": 1515, "tokens": 480, "text": "---\n GuiCommand:\n Name: TechDraw ExtensionLineParallel\n MenuLocation: TechDraw , Extensions: Centerlines/Threading , Add Cosmetic Parallel Line\n Workbenches: TechDraw_Workbench\n Shortcut: \n Version: 0.20\n SeeAlso: TechDraw_ExtensionLinePerpendicular\n---\n\n# TechDraw ExtensionLineParallel\n\n## Description\n\nThe **TechDraw ExtensionLineParallel** tool adds a cosmetic line parallel to another line through a vertex.\n\n \"\" \n*On the right an added cosmetic parallel line*\n\n## Usage\n\n1. Optionally specify the line attributes with the \"\" [TechDraw ExtensionSelectLineAttributes](TechDraw_ExtensionSelectLineAttributes.md) tool.\n2. Select a straight edge to determine the direction and the length of the line.\n3. Select a vertex to determine the position of the line.\n4. There are several ways to invoke the tool:\n - Press the ** [Add Cosmetic Parallel Line](TechDraw_ExtensionLineParallel.md)** button.\n - Select the **TechDraw → Extensions: Centerlines/Threading → Add Cosmetic Parallel Line** option from the menu.\n5. A cosmetic line is added.\n\n\n {{TechDraw_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw ExtensionLineParallel\n"} {"id": "freecad-docs:wiki/TechDraw_ExtensionThreadHoleBottom.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TechDraw_ExtensionThreadHoleBottom.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TechDraw_ExtensionThreadHoleBottom.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5d3eeae6ee4f8a15c2ff38e01c568c9d3d566649c2c0be9e04f425cc62e64312", "bytes": 1462, "tokens": 478, "text": "---\n GuiCommand:\n Name: TechDraw ExtensionThreadHoleBottom\n MenuLocation: TechDraw , Extensions: Centerlines/Threading , Add Cosmetic Thread Hole Bottom View\n Workbenches: TechDraw_Workbench\n Shortcut: \n Version: 0.20\n SeeAlso: TechDraw_ExtensionThreadBoltBottom\n---\n\n# TechDraw ExtensionThreadHoleBottom\n\n## Description\n\nThe **TechDraw ExtensionThreadHoleBottom** tool adds a cosmetic thread to the top or bottom view of holes.\n\n \"\" \n*On the right a hole with a cosmetic thread*\n\n## Usage\n\n1. Optionally specify the line attributes with the \"\" [TechDraw ExtensionSelectLineAttributes](TechDraw_ExtensionSelectLineAttributes.md) tool.\n2. Select one or more circles.\n3. There are several ways to invoke the tool:\n - Press the ** [Add Cosmetic Thread Hole Bottom View](TechDraw_ExtensionThreadHoleBottom.md)** button.\n - Select the **TechDraw → Extensions: Centerlines/Threading → Add Cosmetic Thread Hole Bottom View** option from the menu.\n4. Cosmetic threads are added.\n\n\n {{TechDraw_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw ExtensionThreadHoleBottom\n"} {"id": "freecad-docs:wiki/TechDraw_NewAnnotation.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TechDraw_NewAnnotation.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TechDraw_NewAnnotation.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "00bf2b634c727ab68d6768632a8ef8cfec9685f4b3c318db3ee4dfd79f427173", "bytes": 192, "tokens": 79, "text": "# TechDraw NewAnnotation\n1. REDIRECT [TechDraw_Annotation](TechDraw_Annotation.md)\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw NewAnnotation\n"} {"id": "freecad-docs:wiki/TechDraw_Quadrants.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TechDraw_Quadrants.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TechDraw_Quadrants.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ba596c044258b365404a54cf77359e0d1604b8cc80202ed59fa39dff597f9e9d", "bytes": 2061, "tokens": 659, "text": "---\n GuiCommand:\n Name: TechDraw Quadrants\n MenuLocation: TechDraw , Add Vertices , Add Quadrant Vertices\n Workbenches: TechDraw_Workbench\n Version: 0.19\n SeeAlso: TechDraw_CosmeticVertex, TechDraw_Midpoints\n---\n\n# TechDraw Quadrants\n\n## Description\n\nThe **TechDraw Quadrant** tool adds three [cosmetic vertices](TechDraw_CosmeticVertex.md) along the length of one or more selected edges. The vertices are placed at 25%, 50% and 75% of the length of the edges. For a circular edge this results in cosmetic vertices at 90°, 180° and 270°, in addition to its geometric vertex at 0°.\n\n \"\" \n*Cosmetic vertices at quadrant points of a circle*\n\n## Usage\n\n1. Select one or more edges in a view. Any edge can be selected, not just circles.\n2. There are several ways to invoke the tool:\n - Press the ** [Add Quadrant Vertices](TechDraw_Quadrants.md)** button.\n - Select the **TechDraw → Add Vertices → Add Quadrant Vertices** option from the menu.\n\n## Notes\n\n- The created cosmetic vertices are not parametrically linked to the selected edges.\n- To delete a cosmetic vertex select it and press **Delete**. (v1.0) \n\n## Properties\n\nCosmetic vertices have no properties of their own, as they are not document objects. They share color and size settings with regular geometry vertices.\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nCosmetic vertices are not accessible from [macros](Macros.md) or the [Python](Python.md) console at this time. This snippet will remove all cosmetic vertices from the view.\n\n \n```python\nv = App.ActiveDocument.View\nv.clearCV()\nApp.ActiveDocument.recompute()\n```\n\n\n {{TechDraw Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw Quadrants\n"} {"id": "freecad-docs:wiki/TechDraw_Symbol.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TechDraw_Symbol.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TechDraw_Symbol.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "25445af6cdecfb5fb7c173b10fd09f01191960d421c499a9d43ccd54125bb9bc", "bytes": 3015, "tokens": 1004, "text": "---\n GuiCommand:\n Name: TechDraw Symbol\n MenuLocation: TechDraw , TechDraw Views , Insert SVG Symbol\n Workbenches: TechDraw_Workbench\n SeeAlso: TechDraw_Templates, Draft_SVG\n---\n\n# TechDraw Symbol\n\n## Description\n\nThe **TechDraw Symbol** tool inserts a Symbol object. A Symbol is a stripped down view that contains only a single [SVG](SVG.md) file complying with the svg-tiny specification (see [TechDraw Templates](TechDraw_Templates#Notes.md)).\n\nA Symbol can be anything that helps annotate a drawing and that doesn\\'t need to be further modified, it may however contain [editable texts](Svg_Namespace#freecad_editable.md).\n\n\n(v1.0) \n\n: The [TechDraw View](TechDraw_View.md) tool can also create a Symbol.\n\n \"\" \n*Compass rose added to the drawing page; this symbol is available by installing the \"symbols_library\" addon with the [Addon Manager](Std_AddonMgr.md)*\n\n## Usage\n\n1. If there are multiple drawing pages in the document: optionally activate the desired page by selecting it in the [Tree view](Tree_view.md).\n2. Select the **TechDraw → TechDraw Views → Insert SVG Symbol** option from the menu.\n3. If there are multiple drawing pages in the document and you have not yet activated a page, the **Page Chooser** dialog box opens:\n 1. Select the desired page.\n 2. Press the **OK** button.\n4. A file browser opens.\n5. Select an SVG file.\n6. A symbol is inserted.\n7. Optionally change its **Scale** property to adjust its size.\n\n## Notes\n\n- **Scale Type**for Symbols is always set to *Custom* at creation. This is for convenience, since symbols are almost always scaled differently from the rest of the objects on the page.\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA Symbol, formally a {{Incode|TechDraw::DrawViewSymbol}} object, has the [properties](TechDraw_View#Properties_Part_View.md) that are common to all View types. It also has the following additional properties:\n\n### Data\n\n\n{{TitleProperty|Drawing view}}\n\n- **Symbol|String|Hidden**: The SVG code defining this symbol.\n\n- **Editable Texts|StringList**: Substitution values for the editable strings in this symbol.\n\n- **Owner|Link**: Feature to which this symbol is attached. (v1.0) \n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe Symbol tool can be used in [macros](Macros.md) and from the [Python](Python.md) console by using the following functions:\n\n \n```python\nsym = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewSymbol','TestSymbol')\nrc = page.addView(anno)\nf = open(unicode(symbolFileSpec,'utf-8'),'r')\nsvg = f.read()\nf.close()\nsym.Symbol = svg\nrc = page.addView(sym)\n```\n\n\n {{TechDraw_Tools_navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw Symbol\n"} {"id": "freecad-docs:wiki/TechDraw_TemplateGenerator.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/TechDraw_TemplateGenerator.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/TechDraw_TemplateGenerator.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "69b42983bea7f2d0c7a6e549861fe0274f561320689cf7c54d3bd2483726cd2a", "bytes": 29032, "tokens": 9501, "text": "---\n TutorialInfo:\n Topic: Create a TechDraw template using a Python macro\n Level: Basic skills of Python and svg-structures are helpful\n FCVersion: 0.21 and later\n Time: \n Author: User:FBXL5\n SeeAlso: Macro_TemplateHelper\n---\n\n# TechDraw TemplateGenerator\n\n \n\n\n## Introduction\n\nThis tutorial describes how to generate a simple template to use with the TechDraw workbench out of some lines of Python code.\n\nAny text editor can be used to code. My choice is Atom, but FreeCAD\\'s built-in editor works well, too.\n\nThe following code examples can be copied and pasted into an empty text file and then saved under a name of your choice as a \\*.py or \\*.FCMacro file.\n\nA template provides a background for the drawing tasks and its dimensions are used by the printer drivers to scale the drawing correctly.\n\nThe templates are svg-files and so a macro has to compose some lines of svg code (which is a subset of xml code).\n\n**Note:** When FreeCAD was migrated from **freecadweb.org** to **freecad.org** this page was updated accordingly and the resulting SVG code is no longer compatible with FreeCAD versions older than v0.21. For those versions you need to manually change {{Incode|freecad.org}} to {{Incode|freecadweb.org}} on the namespace declaration line in the resulting SVG code, otherwise the editable texts are not recognized.\n\n## Structure of a simple blank page \n\nThe SVG format is a subset of the XML format. That is why an SVG file, like any XML file, consists of two parts:\n\n- Head, a format declaration\n- Body, containing the information what to show and where to place it\n\n: (I don\\'t know why there should be a headline, the svg-file is still a valid template file without it\\...)\n\n### Head\n\nThe head is just one line to declare which version of the XML language an interpreter should use to handle the instructions in the body.\n\n {{Code|lang=xml|code=\n\n}}\n\n### Body\n\nThe Body starts with an opening tag which contains information about name spaces and about the size of the template and where to place it. And it finishes with a closing tag.\n\n {{Code|lang=xml|code=\n\n\n}}\n\n: **xmlns=**\\\"\\\": External link to the xml name space to look up standard xml commands\n: **version=**\\\"1.1\\\": Used xml version is 1.1\n: **xmlns:freecad=**\\\"\\...=Svg_Namespace\\\": External link to FreeCAD\\'s [Svg Namespace](Svg_Namespace.md) wiki page. The link is not used to retrieve information or values at runtime, but it is the key to activate the custom attributes, e.g. those for editable texts.\n: \\\"freecad:\\\" will be prefixed to said custom attribute names.\n: **width=**\\\"420mm\\\": Width of the drawing area\n: **height=**\\\"297mm\\\": Height of the drawing area\n: **viewBox=**\\\"0 0 420 297\\\": Position of the upper left corner (0;0) and the lower right corner (420;297) in the svg construction space (in svg units).\n: Width, height, and viewBox in this combination set 1 svg-unit to 1 mm for the whole document. A dimensional unit can be omitted from now on.\n: In this case 420 and 297 give an A3 page. Customise these values to generate other page sizes.\n\nFor a blank page size DIN A3 in landscape orientation that\\'s all.\n\n {{Code|lang=xml|code=\n\n\n\n}}\n\n## Python code\\... \n\nCoding starts with a framework containing a separate main function:\n\n {{Code| |code=\n#! python\n# -*- coding: utf-8 -*-\n# (c) 2024 Your name LGPL\n\n\ndef main():\n \"\"\"Here is where the magic happens\"\"\"\n return\n\nif __name__ == '__main__':\n # This will be true only if the file is \"executed\"\n # but not if imported as module\n main()\n}}\n\n### \\... to create a blank page \n\nThe process of creating a template consists of:\n\n- Locate the template folder.\n- Open a file for writing to create an svg-file from scratch, write the header line and close the file as a first step.\n- And then repeatedly open the file to append further segments, closing it again each time.\n\nThe macro is made of several functions which are called from the main section.\nAdditional functions could be inserted before the EndSvg function and the needed calls are put before the EndSvg() call.\nWe need to have an eye on the number of spaces used with the write operations for a correct indentation.\n\n#### pathToTemplate()\n\nBefore any code is generated a folder is needed to store the new template file, and a file name has to be set.\n\nThe user should have selected a template folder. Its path is then stored in the TechDraw preferences. It is not necessary to know where the preferences are store, because FreeCAD has commands to address needed parameters directly.\n\n {{Code| |code=\ndef pathToTemplate(template_name):\n \"\"\"Link a given template name to the path of the template folder\"\"\"\n #- Get the path to the template folder that is set in the FreeCAD parameters\n parameter_path = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Mod/TechDraw/Files\")\n template_path = parameter_path.GetString(\"TemplateDir\")\n #- Link template_path and template_name for any OS\n path_to_file = os.path.join(template_path, template_name) # to join path segments OS neutral\n return path_to_file\n}}\n\n**parameter_path** receives the path to the \\\"folder\\\" within the configuration file where \\\"TemplateDir\\\" parameter can be found. **template_path** receives the content of \\\"TemplateDir\\\" which is the path to the template directory.\n**template_name** recieves the name of the template to be created.\n\nNow the template name needs to be linked to the template path in a way that is compatible to unix based OSs and Windows. This is done with the \\\"os.path.join\\\" command and stored into the **template_file**. To enable this command an \\\"import os\\\" instruction is required.\n\n#### createSvgFile()\n\nThis creates a new Template file and saves the xml head line.\n\n {{Code| |code=\ndef createSvgFile(file_path):\n # Create a file and insert a header line (with t as the space saving variant of template)\n t = open(file_path, \"w\") # w = write, overwrites existing files\n t.write(\"\")\n t.close\n}}\n\n#### startSvg()\n\nThis appends the template file and creates the svg opening tag including its attributes.\nEach write instruction contains one single line of svg code ending with \\\"\\\\n\\\", the marker for CR/LF.\n\n {{Code| |code=\ndef startSvg(file_path, sheet_width, sheet_height):\n # Create svg-tag including namespace and format definitions\n t = open(file_path, \"a\", encoding=\"utf-8\")\n # a = append, new lines are added at the end of an existing file\n # encoding=\"utf-8\", helps with special characters if the Python interpreter is in ASCII mode\n t.write(\"\\n\" + \"\\n\")\n t.write(\"\\n\")\n # identical values for width and height and Viewbox' width and height\n # will synchronise mm and svg-units\n t.close\n}}\n\n#### endSvg()\n\nThis further appends the template file and creates the svg closing tag; This eventually finishes the template code.\n\n {{Code| |code=\ndef endSvg(file_path):\n # Create closing svg-tag\n t = open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\"\")\n t.close\n}}\n\n#### main()\n\nThe main() function calls the functions and hands over some parameters.\n\n {{Code| |code=\ndef main():\n \"\"\"This one creates an empty A3 template\"\"\"\n #- Set the name of the template file and get its location\n template_file = pathToTemplate(\"MyTemplate.svg\") # Change the template name here\n #- Here starts the compiling of the svg file\n createSvgFile(template_file) # overwrites existing File\n #- Set sheet format (DIN A3)\n format_width = \"420\"\n format_height = \"297\"\n startSvg(template_file, format_width, format_height) # adds svg start tag\n endSvg(template_file) # adds svg end tag\n # At this point a new SVG-file is generated and saved\n return\n}}\n\nIn this example {{Incode|format_width}} and {{Incode|format_height}} are hard coded dimensions, both unnecessary lines mark the points where other means of retrieving format data could put their content.\n\n\n
\n\n#### The complete blank page macro \n\nThis macro consists of the above code segments, ready to run.\n\n\n
\n\n {{Code| |code=\n#! python\n# -*- coding: utf-8 -*-\n# (c) 2024 Your name LGPL\n\nimport os # to enable the use of os.path.join()\n\n\n# - SVG creation -\ndef createSvgFile(file_path):\n # Create a file and insert a header line (with t as the space saving variant of template)\n t = open(file_path, \"w\") # w = write, overwrites existing files\n t.write(\"\")\n t.close\n\ndef startSvg(file_path, sheet_width, sheet_height):\n # Create svg-tag including namespace and format definitions\n t = open(file_path, \"a\", encoding=\"utf-8\")\n # a = append, new lines are added at the end of an existing file\n # encoding=\"utf-8\", helps with special characters if the Python interpreter is in ASCII mode\n t.write(\"\\n\" + \"\\n\")\n t.write(\"\\n\")\n # identical values for width and height and Viewbox' width and height\n # will synchronise mm and svg-units\n t.close\n\ndef endSvg(file_path):\n # Create closing svg-tag\n t = open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\"\")\n t.close\n\ndef pathToTemplate(template_name):\n \"\"\"Link a given template name to the path of the template folder\"\"\"\n #- Get the path to the template folder that is set in the FreeCAD parameters\n parameter_path = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Mod/TechDraw/Files\")\n template_path = parameter_path.GetString(\"TemplateDir\")\n #- Link template_path and template_name for any OS\n path_to_file = os.path.join(template_path, template_name) # to join path segments OS neutral\n return path_to_file\n\ndef main():\n \"\"\"This one creates an empty A3 template\"\"\"\n #- Set the name of the template file and get its location\n template_file = pathToTemplate(\"MyTemplate.svg\") # Change the template name here\n #- Here starts the compiling of the svg file\n createSvgFile(template_file) # overwrites existing File\n #- Set sheet format (DIN A3)\n format_width = \"420\"\n format_height = \"297\"\n startSvg(template_file, format_width, format_height) # adds svg start tag\n endSvg(template_file) # adds svg end tag\n # At this point a new SVG-file is generated and saved\n return\n\nif __name__ == '__main__':\n # This will be true only if the file is \"executed\"\n # but not if imported as module\n main()\n}}\n\n\n
\n\n\n
\n\n### \\... to create a page with some ink \n\nTo make a drawing out of a blank page we need:\n\n- Frames i.e. rectangles created with the **rect** instruction.\n- A title block and more made of lines created with the **path** instruction.\n- Simple texts for indexes and labeling title block cells.\n- Editable texts like part number or part name.\n\nNormally these graphical elements are used repeatedly and so the generating code is put into four functions:\n\n- svgRect() for rectangular frame elements.\n- svgPath() for straight line elements.\n- svgText() for static texts.\n- ediText() for editable texts.\n\nAll functions are placed inside the above macro before the main() function and their related function calls are inserted in the main() function between {{Incode|startSvg(...)}} and {{Incode|endSvg(...)}}.\n\n#### svgRect()\n\nTo draw a rectangle we just need to call the **svgRect** function and hand over the values for width, height, and position of the upper left corner. That is better readable in this place than if svg_line would contain the whole svg code line.\n\n {{Code| |code=\ndef svgRect(width, height, x, y):\n # Generates an svg-instruction to draw a rectangle with the given values\n svg_line = (\n \"\"\n )\n return svg_line\n}}\n\nThe svg instruction is split to stay within the recommended Python line length, it will result in a single svg line nevertheless.\n\n#### svgPath()\n\nTo draw a line we just need to call the **svgPath** function and hand over the coordinates of the start point and the endpoint of a line.\n\nInstead of the end point coordinates we can hand over a tag to draw a horizontal (h) or vertical (v) line followed by the length of the line or the tag to draw a horizontal (H) or vertical (V) line followed by the x or y ordinate of the end point.\n\nEach path starts at the origin and the first action is a movement with \\\"raised pen\\\" (not drawing) to the start point. In this case the relative movement and the absolute movement are the same and so it is irrelevant whether the m-tag is upper or lower case.\n\n {{Code| |code=\ndef svgPath(x1, y1, x2, y2):\n # Generates an svg-instruction to draw a path element (line) with the given values\n if x2 == \"v\" or x2 == \"V\" or x2 == \"h\" or x2 == \"H\":\n svg_line = (\"\")\n else:\n svg_line = (\"\")\n return svg_line\n}}\n\n#### svgText()\n\nTo draw a piece of text we just need to call the **svgText** function and hand over the coordinates of the text\\'s anchor point, the text string itself, and optionally an angle for rotated text. To rotate texts a transformation instruction has to be inserted in each text tag separately; the rotation centers are set to the same coordinates as the related text anchor points.\n\n(The text alignment is controlled by the surrounding group tag or left-aligned as default).\n\n {{Code| |code=\ndef svgText(x, y, str_value, str_angle=\"0\"):\n \"\"\"\n Generates an svg-instruction to place a text element with the given values.\n Optional str_angle enables vertical and arbitrarily rotated texts\n \"\"\"\n if str_angle == \"0\":\n svg_line = (\"\" + str_value + \"\")\n else:\n svg_line = (\n \"\" + str_value + \"\"\n )\n return svg_line\n}}\n\n#### ediText()\n\nTo draw a piece of editable text we just need to call the **ediText** function and hand over a name, the coordinates of the text\\'s anchor point, the text string itself, and optionally an angle for rotated text. To rotate texts a transformation instruction has to be inserted in each text tag separately; the rotation centers are set to the same coordinates as the related text anchor points.\n\nFreeCAD creates a dictionary object with every inserted template, and each entry has a name (key) and a value.\n\n(The text alignment is controlled by the surrounding group tag or left-aligned as default).\n\n {{Code| |code=\ndef ediText(entry_name, x, y, str_value, str_angle=\"0\"):\n \"\"\"\n Generates an svg-instruction to place an editable text element with the given values.\n Optional str_angle enables vertical and arbitrarily rotated editable texts\n \"\"\"\n if str_angle == \"0\":\n svg_line = (\n \" \" + str_value + \" \"\n )\n else:\n svg_line = (\n \" \"\n + str_value + \" \"\n )\n return svg_line\n}}\n\n### createXxxx functions \n\nThese functions start with code to open a file in append mode and to write the group opening tag.\n\nThen follows a section to set and calculate values, and with write instructions that call the above functions to generate svg-code.\n\nAnd finally the group closing tag followed by an instruction to close the file.\n\n {{Code| |code=\ndef createFrame(file_path, sheet_width, sheet_height):\n # Creates rectangles for sheet frame and drawing area\n t = open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n #- upper left corner of inner Frame, drawing area\n frame_x = str(20)\n frame_y = str(10)\n #- frame dimensions\n frame_width = str(int(sheet_width) - 20 - 10)\n frame_height = str(int(sheet_height) - 10 - 10)\n #- frame rectangle\n t.write(\" \" + svgRect(frame_width, frame_height, frame_x, frame_y) + \"\\n\")\n #- upper left corner outer frame, sheet frame\n frame_x = str(15)\n frame_y = str(5)\n #- frame dimensions\n frame_width = str(int(sheet_width)-20)\n frame_height = str(int(sheet_height)-10)\n #- frame rectangle\n t.write(\" \" + svgRect(frame_width, frame_height, frame_x, frame_y) + \"\\n\")\n t.write(\" \\n\\n\")\n t.close\n}}\n\n### Resulting macro \n\n\n
\n\nThis macro adds some basic graphical elements needed for proper templates i.e. line elements, texts, and editable texts.\n\n\n
\n\n {{Code| |code=\n#! python\n# -*- coding: utf-8 -*-\n# (c) 2024 Your name LGPL\n\nimport os # to enable the use of os.path.join()\n\n\n# - SVG creation -\ndef createSvgFile(file_path):\n # Create a file and insert a header line (with t as the space saving variant of template)\n t = open(file_path, \"w\") # w = write, overwrites existing files\n t.write(\"\")\n t.close\n\ndef startSvg(file_path, sheet_width, sheet_height):\n # Create svg-tag including namespace and format definitions\n t = open(file_path, \"a\", encoding=\"utf-8\")\n # a = append, new lines are added at the end of an existing file\n # encoding=\"utf-8\", helps with special characters if the Python interpreter is in ASCII mode\n t.write(\"\\n\" + \"\\n\")\n t.write(\"\\n\")\n # identical values for width and height and Viewbox' width and height\n # will synchronise mm and svg-units\n t.close\n\ndef endSvg(file_path):\n # Create closing svg-tag\n t = open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\"\")\n t.close\n\ndef svgRect(width, height, x, y):\n # Ggenerates an svg-instruction to draw a rectangle with the given values\n svg_line = (\n \"\"\n )\n return svg_line\n\ndef svgPath(x1, y1, x2, y2):\n # Generates an svg-instruction to draw a path element (line) with the given values\n if x2 == \"v\" or x2 == \"V\" or x2 == \"h\" or x2 == \"H\":\n svg_line = (\"\")\n else:\n svg_line = (\"\")\n return svg_line\n\ndef svgText(x, y, str_value, str_angle=\"0\"):\n \"\"\"\n Generates an svg-instruction to place a text element with the given values.\n Optional str_angle enables vertical and arbitrarily rotated texts\n \"\"\"\n if str_angle == \"0\":\n svg_line = (\"\" + str_value + \"\")\n else:\n svg_line = (\n \"\" + str_value + \"\"\n )\n return svg_line\n\ndef ediText(entry_name, x, y, str_value, str_angle=\"0\"):\n \"\"\"\n Generates an svg-instruction to place an editable text element with the given values.\n Optional str_angle enables vertical and arbitrarily rotated editable texts\n \"\"\"\n if str_angle == \"0\":\n svg_line = (\n \" \" + str_value + \" \"\n )\n else:\n svg_line = (\n \" \"\n + str_value + \" \"\n )\n return svg_line\n\ndef createFrame(file_path, sheet_width, sheet_height):\n # Creates rectangles for sheet frame and drawing area\n t = open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n #- calculate upper left corner of inner Frame, drawing area\n frame_x = str(20)\n frame_y = str(10)\n #- frame dimensions\n frame_width = str(int(sheet_width) - 20 - 10)\n frame_height = str(int(sheet_height) - 10 - 10)\n #- frame rectangle\n t.write(\" \" + svgRect(frame_width, frame_height, frame_x, frame_y) + \"\\n\")\n #- calculate upper left corner outer frame, sheet frame\n frame_x = str(15)\n frame_y = str(5)\n #- frame dimensions\n frame_width = str(int(sheet_width)-20)\n frame_height = str(int(sheet_height)-10)\n #- frame rectangle\n t.write(\" \" + svgRect(frame_width, frame_height, frame_x, frame_y) + \"\\n\")\n t.write(\" \\n\\n\")\n t.close\n\ndef createTitleBlock(file_path, sheet_width, sheet_height):\n \"\"\"Creates a title block and transfers it to the position according to the sheet dimensions\"\"\"\n #- calculate title block origin (lower left corner), offset from page origin\n tbX = str(int(sheet_width) - 10 - 180) # 180 according to DIN EN ISO 7200\n tbY = str(int(sheet_height) - 10)\n t = open(file_path, \"a\", encoding=\"utf-8\")\n #- group to transfer all included title block elements at once\n t.write(\" \\n\")\n #- sub-group of title block line framework\n t.write(\" \\n\")\n t.write(\" \" + svgPath(\" 0\",\" 0\",\" 0\",\"-63\") + \"\\n\")\n t.write(\" \" + svgPath(\" 0\",\"-63\",\"180\",\" 0\") + \"\\n\")\n t.write(\" \" + svgPath(\" 0\",\"-30\",\"h\",\"155\") + \"\\n\")\n t.write(\" \" + svgPath(\"155\",\" 0\",\"v\",\"-63\") + \"\\n\")\n t.write(\" \\n\")\n #- sub-group of title block static texts (left-aligned by default)\n t.write(\" \\n\")\n t.write(\" \" + svgText(\" 4.5\",\"-43.5 \",\"Some static text\") + \"\\n\")\n t.write(\" \" + svgText(\" 4.5\",\"-13.5 \",\"More static text\") + \"\\n\")\n t.write(\" \" + svgText(\"162.5\",\"-3.5 \",\"Vertical static text\",\"-90\") + \"\\n\")\n t.write(\" \\n\")\n t.write(\" \\n\\n\")\n t.close\n\ndef createEditableText(file_path, sheet_width, sheet_height):\n \"\"\"Creates editable texts positioned according to the page origin\"\"\"\n #- calculate offset to titleblock origin\n edX = int(sheet_width) - 10 - 180 # 180 according to DIN EN ISO 7200\n edY = int(sheet_height) - 10\n t = open(file_path, \"a\", encoding=\"utf-8\")\n #- group editable texts using the same attributes\n t.write(\" \\n\")\n t.write(\n \" \" + ediText(\"EdiText-1\",str(edX + 60),str(edY - 43.5),\"Some editable text\") + \"\\n\"\n )\n t.write(\n \" \" + ediText(\"EdiText-2\",str(edX + 60),str(edY - 13.5),\"More editable text\") + \"\\n\"\n )\n t.write(\n \" \" + ediText(\"EdiText-3\",str(edX + 173),str(edY - 4.5),\"90° editable text\",\"-90\")\n + \"\\n\"\n )\n t.write(\" \\n\\n\")\n t.close\n\ndef pathToTemplate(template_name):\n \"\"\"Link a given template name to the path of the template folder\"\"\"\n #- Get the path to the template folder that is set in the FreeCAD parameters\n parameter_path = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Mod/TechDraw/Files\")\n template_path = parameter_path.GetString(\"TemplateDir\")\n #- Link template_path and template_name for any OS\n path_to_file = os.path.join(template_path, template_name) # to join path segments OS neutral\n return path_to_file\n\ndef main():\n \"\"\"This one creates an A3 template with simple frame and title block\"\"\"\n #- Set the name of the template file and get its location\n template_file = pathToTemplate(\"MyTemplate.svg\") # Change the template name here\n #- Here starts the compiling of the svg file\n createSvgFile(template_file) # overwrites existing File\n #- Set sheet format (DIN A3)\n format_width = \"420\"\n format_height = \"297\"\n startSvg(template_file, format_width, format_height) # adds svg start tag\n createFrame(template_file, format_width, format_height)\n createTitleBlock(template_file, format_width, format_height)\n createEditableText(template_file, format_width, format_height)\n endSvg(template_file) # adds svg end tag\n # At this point a new SVG-file is generated and saved\n return\n\nif __name__ == '__main__':\n # This will be true only if the file is \"executed\"\n # but not if imported as module\n main()\n}}\n\nAnd this is the svg-code coming out of this macro:\n\n {{Code|lang=xml|code=\n\n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n Some static text\n More static text\n Vertical static text\n \n \n\n \n Some editable text \n More editable text \n 90° editable text \n \n\n\n}}\n\n\n
\n\n\n
\n\nAnd what it should look like when inserted (plus magnified title block):\n\n \"\" \n\nTo color the editable texts in blue is just a personal choice to easier distinguish static and editable texts on the finished drawing.\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw TemplateGenerator\n"} {"id": "freecad-docs:wiki/Web_BrowserNext.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/Web_BrowserNext.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/Web_BrowserNext.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "983914a515d3f54fcba4d5fa3727236527f49fbd72334a8c264b48f78a780362", "bytes": 552, "tokens": 201, "text": "---\n GuiCommand:\n Name: Web BrowserNext\n MenuLocation: \n Workbenches: Web_Workbench, Start_Workbench\n SeeAlso: \n---\n\n# Web BrowserNext\n\n## Description\n\nUse the \"\" **Web BrowserNext** command to go to the next page in the list of visited web pages.\n\n## Usage\n\n1. Press the ** [Next page](Web_BrowserNext.md)** button.\n\n\n {{Web Tools navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Web](Web_Workbench.md) > Web BrowserNext\n"} {"id": "freecad-docs:wiki/translations/en/Arch_Git.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Arch_Git.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Arch_Git.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "18e0426cb151876ff75c1f0a85bfc69f9e15fccca6c8650cd111fa5ddd3b1597", "bytes": 126, "tokens": 59, "text": "# Arch Git/en\n1. REDIRECT [WebTools_Git/en](WebTools_Git/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > Arch Git/en\n"} {"id": "freecad-docs:wiki/translations/en/Arch_JSON.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Arch_JSON.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Arch_JSON.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ab745bb4e8ea09d41aa36b18b61a84ca0396ff1f90992819e0689f54e21a97a2", "bytes": 1178, "tokens": 333, "text": "# Arch JSON/en\n## Description\n\nThe main purpose of this export format is to make it easier to process FreeCAD model data from programming languages. The [JSON](http://json.org/) format is as follows:\n\n {\n \"version\": \"0.0.1\",\n \"description\": \"Mesh data exported from FreeCAD\",\n \"objects\": [\n {\n \"name\": \"\",\n \"description\": \"\",\n \"color\": \"\",\n \"wires\": [[[, , ], . . .], . . .],\n \"vertices\": [[, , ], . . .],\n \"normals\": [[, , ], . . .],\n \"facets\": [[, , ], . . .]\n }, . . .\n ]\n }\n\nNote that facets form triangles and their integer values reference points in the **vertices** array. Facet normals are found at the corresponding position in the **normals** array. **description**, **color** and **wires** are all optional. This format could easily be expanded to include additional model data.\n\n\n---\n⏵ [documentation index](../README.md) > [File_Formats](Category_File_Formats.md) > [BIM](Category_BIM.md) > Arch JSON/en\n"} {"id": "freecad-docs:wiki/translations/en/Arch_Rebar_Dimensioning.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Arch_Rebar_Dimensioning.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Arch_Rebar_Dimensioning.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5edf65c4e1497124ce95b6fd62b5be9c4ef75711c3f23774acb82dbcf8e422a3", "bytes": 252, "tokens": 95, "text": "# Arch Rebar Dimensioning/en\n1. REDIRECT [Reinforcement_DrawingDimensioning/en#Reinforcement_Dimensioning](Reinforcement_DrawingDimensioning/en#Reinforcement_Dimensioning.md)\n\n\n---\n⏵ [documentation index](../README.md) > Arch Rebar Dimensioning/en\n"} {"id": "freecad-docs:wiki/translations/en/Arch_Roof.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Arch_Roof.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Arch_Roof.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7e3dc64d00e64eff5acc9c43d8f5d3c3d1471bbe59063689c0a5d7a844eb0e64", "bytes": 5878, "tokens": 1892, "text": "---\n GuiCommand:\n Name: Arch Roof\n MenuLocation: 3D/BIM , Roof\n Workbenches: BIM_Workbench\n Shortcut: **R** **F**\n SeeAlso: \n---\n\n# Arch Roof/en\n\n## Description\n\nThe **Arch Roof** tool allows for the creation of a sloped roof from a selected wire. The created roof object is parametric, keeping its relationship with the base object. The principle is that each edge is seen allotting a profile of roof (slope, width, overhang, thickness).\n\n**Note:** This tool is still in development, and might fail with very complex shapes.\n\n\"\" \n*View from above a building model showing the roof with certain transparency*\n\n## Usage (wire base) \n\n1. Create a closed wire with following the counter-clockwise direction and select it.\n\n : \"\"\n\n2. Press the ** [Roof](Arch_Roof.md)** button, or press **R** then **F** keys\n\n3. The default roof object could have a strange shape, it\\'s because the tool is missing some necessary information.\n\n4. After creating the default roof, double click on the object in the [tree view](Tree_view.md) to access and edit all the properties. Angle must be between 0 and 90.\n\n : ![](images/RoofTable.png )\n\n5. Each line corresponds to a roof pane. So you can set the properties you want for each roof pane.\n\n6. To help you, you can set `Angle` or `Run` to `0` and define a `Relative Id`, this makes an automatic calculation to find the data relative to the `Relative Id`.\n\n7. It works like this:\n 1. If `Angle = 0` and `Run = 0` then profile is identical to the relative profile.\n 2. If `Angle = 0` then `Angle` is calculated so that the height is the same one as the relative profile.\n 3. If `Run = 0` then `Run` is calculated so that the height is the same one as the relative profile.\n\n8. Finally, set an Angle to 90° to make a gable.\n\n : \"\"\n\n9. \n **Note**: for better comprehension, please see this [youtube clip](https://www.youtube.com/watch?v=4Urwru71dVk).\n\n## Usage (solid base) \n\nIf your roof has a complex shape (e.g. contains pitched windows or other non-standard features) you can create a custom solid object using various other FreeCAD workbenches ([Part](Part_Workbench.md), [Sketcher](Sketcher_Workbench.md) etc.). And then use this solid as the **Base** object of your roof:\n\n1. Select the solid base object.\n2. Press the ** [Arch Roof](Arch_Roof.md)** button, or press **R** then **F** keys.\n\n## Subtracting a roof \n\nRoofs have an automatically generated subtraction volume ((v1.0) for roofs with a solid base). When a roof is [removed](Arch_Remove.md) from the walls of a building, both the roof itself as well as everything above it is subtracted from the walls.\n\n\n(v1.0) \n\n: It is possible to override the automatic subtraction volume by setting the **Subvolume** property of the roof to a custom solid object.\n\n\"\" \"\" \"\" \n*Solid-based roof before (1st image) and after (2nd image) [removing](Arch_Remove.md) it from walls.
\nThe 3rd image shows the generated subtraction volume.*\n\n## Options\n\n- Roofs share the common properties and behaviors of all [Arch Components](Arch_Component.md).\n\n## Properties\n\n### Data\n\n\n{{TitleProperty|Roof}}\n\n- **Angles|FloatList**: The list of angles of the roof segments.\n\n- **Border Length|Length**: The total length of the borders of the roof.\n\n- **Face|Integer**: The face number of the base object used to build the roof (not used).\n\n- **Flip|Bool**: Specifies if the direction of the roof should be flipped.\n\n- **Heights|FloatList**: The list of calculated heights of the roof segments.\n\n- **Id Rel|IntegerList**: The list of IDs of the relative profiles of the roof segments.\n\n- **Overhang|FloatList**: The list of overhangs of the roof segments.\n\n- **Ridge Length|Length**: The total length of the ridges and hips of the roof.\n\n- **Runs|FloatList**: The list of horizontal length projections of the roof segments.\n\n- **Subvolume|Link**: The volume to subtract. If specified it is used instead of the auto-generated subvolume. (v1.0) \n\n- **Thickness|FloatList**: The list of thicknesses of the roof segments.\n\n## Scripting\n\n\n**See also:**\n\n[Arch API](Arch_API.md) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe Roof tool can be used in [macros](Macros.md) and from the [Python](Python.md) console by using the following function:\n\n\n```python\nRoof = makeRoof(baseobj=None, facenr=0, angles=[45.,], run=[], idrel=[0,], thickness=[50.,], overhang=[100.,], name=\"Roof\")\n```\n\n- Creates a `Roof` object from the given `baseobj`, which can be a closed wire or a solid object.\n - If `baseobj` is a wire, you can provide lists for `angles`, `run`, `idrel`, `thickness`, and `overhang`, for each edge in the wire to define the shape of the roof.\n - The lists are automatically completed to match the number of edges in the wire.\n\nExample:\n\n\n```python\nimport FreeCAD as App\nimport Arch, Draft\n\ndoc = App.newDocument()\n\nrect = Draft.makeRectangle(3000, 4000)\ndoc.recompute()\n\nroof = Arch.makeRoof(rect, angles=[30.,])\n\np1 = App.Vector(0, 0, 0)\np2 = App.Vector(1000, 1000, 0)\np3 = App.Vector(0, 2000, 0)\n\nwire = Draft.make_wire([p1, p2, p3], closed=True)\ndoc.recompute()\n\nroof1 = Arch.makeRoof(wire)\n\ndoc.recompute()\n```\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](Category_BIM.md) > Arch Roof/en\n"} {"id": "freecad-docs:wiki/translations/en/Artwork_Inspection.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Artwork_Inspection.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Artwork_Inspection.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "fa282ca13a76977ed46a345930a3462ff9915df905da22ff4f404a4e03f95e91", "bytes": 416, "tokens": 155, "text": "# Artwork Inspection/en\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## src/Mod/Inspection/\n\n### src/Mod/Inspection/Gui/Resources/Icons/\n\n![](images/Workbench_Inspection.svg ) ![](images/inspect_pipette.svg )\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > [Inspection](Category_Inspection.md) > Artwork Inspection/en\n"} {"id": "freecad-docs:wiki/translations/en/Artwork_Mesh.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Artwork_Mesh.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Artwork_Mesh.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5344123244266fa569360ea68d5e5d4f259d1c5f8dc2fd9fce9e78ea982ab669", "bytes": 3258, "tokens": 1380, "text": "# Artwork Mesh/en\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## src/Mod/Mesh/\n\n### src/Mod/Mesh/Gui/Resources/Icons/\n\n\"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n\n### src/Mod/Mesh/Gui/Resources/Icons/RegularSolids/\n\n\"\" \"\" \"\" \"\" \"\" \"\"\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > [Mesh](Category_Mesh.md) > Artwork Mesh/en\n"} {"id": "freecad-docs:wiki/translations/en/Artwork_ReverseEngineering.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Artwork_ReverseEngineering.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Artwork_ReverseEngineering.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b1f5df071c131c970cd34e0816bfb6038d7403f5211d1fb662086adb42bfad8e", "bytes": 534, "tokens": 196, "text": "# Artwork ReverseEngineering/en\nThese icons are in the indicated source path.\n\nFor all icons in the source tree, see [Artwork](Artwork.md).\n\n## src/Mod/ReverseEngineering/\n\n### src/Mod/ReverseEngineering/Gui/Resources/icons/\n\n![](images/Workbench_Reverse_Engineering.svg )\n\n### src/Mod/ReverseEngineering/Gui/Resources/icons/actions/\n\n![](images/FitSurface.svg )\n\n\n---\n⏵ [documentation index](../README.md) > [Artwork](Category_Artwork.md) > [Reverse Engineering](Category_Reverse%20Engineering.md) > Artwork ReverseEngineering/en\n"} {"id": "freecad-docs:wiki/translations/en/Assembly3_ConstraintDiameter.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Assembly3_ConstraintDiameter.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Assembly3_ConstraintDiameter.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d2d91b569fbd5cf18be950dad7a95969eaf700bbffaafe50c31e7e41b1d4127c", "bytes": 1686, "tokens": 610, "text": "---\n GuiCommand:\n Name: Assembly3 ConstraintDiameter\n Icon: Assembly_ConstraintDiameter.svg\n Workbenches: Assembly3_Workbench\n---\n\n# Assembly3 ConstraintDiameter/en\n\n## Description\n\nThe \"\" [Diameter](Assembly3_ConstraintDiameter.md) command constrains the diameter of a 2D circle or arc which is made with \"\" [Draft Workbench](Draft_Workbench.md) tools in relation with a \"\" workplane.\n\nTo set the diameter edit the Diameter parameter in the properties panel.\n\n## Usage\n\n1. Select a 2D **circle** or **arc**\n2. Activate the \"\" [Diameter](Assembly3_ConstraintDiameter.md) command using the:\n - \n ** [Diameter](Assembly3_ConstraintDiameter.md)\n**\n \n button.\n3. Set the **Diameter** value in the (constraint\\'s) properties panel.\n4. Press the ** [Solve constraints](Assembly3_ResolveConstraints.md)** or the ** [Quick solve](Assembly3_QuickSolve.md)** button to recompute\n\n: \n\n : (if ** [Auto recompute](Assembly3_AutoRecompute.md)** and ** [Smart recompute](Assembly3_SmartRecompute.md)** are disabled).\n\n\n---\n⏵ [documentation index](../README.md) > Assembly3 ConstraintDiameter/en\n"} {"id": "freecad-docs:wiki/translations/en/Assembly3_ConstraintLengthEqualPointLineDistance.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Assembly3_ConstraintLengthEqualPointLineDistance.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Assembly3_ConstraintLengthEqualPointLineDistance.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6b7c0e255479fd6380497b52e923249807739d91b3add0d632e67e814a501808", "bytes": 1530, "tokens": 493, "text": "---\n GuiCommand:\n Name: Assembly3 ConstraintLengthEqualPointLineDistance\n Icon: Assembly_ConstraintLengthEqualPointLineDistance.svg\n Workbenches: Assembly3_Workbench\n---\n\n# Assembly3 ConstraintLengthEqualPointLineDistance/en\n\n## Description\n\nThis tool constrains the length of a 2D line like a non-subdivided wire made with the Draft workbench in relation with a work plane.\n\nIt links the length of the 2D line with the distance between a point and another line (2D or 3D).\n\nThe length value of the first selected line equals the shortest distance between the point and the second line.\n\n## Usage\n\n1. Select a point.\n2. Select the 2D line to be constrained.\n3. Select the line that defines the distance to the point.\n4. Press the ** [Length Equal Point Line Distance](Assembly3_ConstraintLengthEqualPointLineDistance.md)** button.\n5. Press the ** [Solve constraints](Assembly3_ResolveConstraints.md)** or the ** [Quick solve](Assembly3_QuickSolve.md)** button to recompute\n\n: \n\n : (if ** [Auto recompute](Assembly3_AutoRecompute.md)** and ** [Smart recompute](Assembly3_SmartRecompute.md)** are disabled).\n\n\n---\n⏵ [documentation index](../README.md) > Assembly3 ConstraintLengthEqualPointLineDistance/en\n"} {"id": "freecad-docs:wiki/translations/en/Assembly3_ConstraintSymmetricHorizontal.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Assembly3_ConstraintSymmetricHorizontal.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Assembly3_ConstraintSymmetricHorizontal.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8c951c4142daade0a5a8d17f4cef0ddb3b666510d10cfef45e9b00867b03839d", "bytes": 1015, "tokens": 293, "text": "---\n GuiCommand:\n Name: Assembly3 ConstraintSymmetricHorizontal\n Icon: Assembly_ConstraintGeneral.svg\n Workbenches: Assembly3_Workbench\n---\n\n# Assembly3 ConstraintSymmetricHorizontal/en\n\n## Description\n\nThis tool builds a link between two objects of an assembly. The selected elements of each object or more precisely their implicit coordinate systems (ICS) are used to position the objects to each other.\n\nBased on one planar element\\'s ICS both other elements\\' ICSs\\' origins are positioned to have identical y- and z-coordinates and the same x-offset in opposite directions.\n\n## Usage\n\n1. Place two objects into an assembly\n2. Select two point elements, two line elements or two planar elements of one object\n3. Select a planar element of the other object\n4. Press the ** [Symmetric horizontal](Assembly3_ConstraintSymmetricHorizontal.md)** button.\n\n\n---\n⏵ [documentation index](../README.md) > Assembly3 ConstraintSymmetricHorizontal/en\n"} {"id": "freecad-docs:wiki/translations/en/Assembly_InsertLink.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Assembly_InsertLink.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Assembly_InsertLink.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a1404b4f4daa36d5d4a9c14f9a2b0bf84bede2b9bc6909aa2babdc408bec52fe", "bytes": 1123, "tokens": 361, "text": "---\n GuiCommand:\n Name: Assembly InsertLink\n MenuLocation: Assembly , Insert Component\n Workbenches: Assembly_Workbench\n Shortcut: **I**\n Version: 1.0\n SeeAlso: \n---\n\n# Assembly InsertLink/en\n\n## Description\n\nThe \"\" [Assembly InsertLink](Assembly_InsertLink.md) tool inserts a component into the active assembly. This creates dynamic links (called components here) to parts, bodies, primitives, and assemblies.\n\n## Usage\n\n1. There are several ways to invoke the tool:\n - Press the ** [Insert Component](Assembly_InsertLink.md)** button.\n - Select the **Assembly → Insert Component** option from the menu.\n - Use the keyboard shortcut: **I**.\n2. The **Insert Component** dialog opens in the [Task panel](Task_panel.md) listing elements available to be used as components.\n3. \\...\n\n\n{{Assembly_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Assembly](Assembly_Workbench.md) > Assembly InsertLink/en\n"} {"id": "freecad-docs:wiki/translations/en/Assembly_InsertNewPart.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Assembly_InsertNewPart.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Assembly_InsertNewPart.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5eb8b26a9544931785d9519e33c2e76525b843d0b8017680e97ff8b4c1eb34a7", "bytes": 947, "tokens": 314, "text": "---\n GuiCommand:\n Name: Assembly InsertNewPart\n MenuLocation: Assembly , Insert a new part\n Workbenches: Assembly_Workbench\n Shortcut: \n Version: 1.1\n SeeAlso: \n---\n\n# Assembly InsertNewPart/en\n\n## Description\n\nThe \"\" [Assembly InsertNewPart](Assembly_InsertNewPart.md) tool inserts a new Part container, optionally embedded in a new document, and adds it to the currently active Assembly.\n\n## Usage\n\n1. There are several ways to invoke the tool:\n - Press the ** [Insert a new part](Assembly_InsertNewPart.md)** button.\n - Select the **Assembly → Insert a new part** option from the menu.\n2. \\...\n\n\n{{Assembly_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Assembly](Assembly_Workbench.md) > Assembly InsertNewPart/en\n"} {"id": "freecad-docs:wiki/translations/en/BIM_ProjectManager.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/BIM_ProjectManager.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/BIM_ProjectManager.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "abdd4d4adac9e168d3635c66fd7df9e4173bde2133660a17cabdb5494fe5dcdc", "bytes": 2827, "tokens": 733, "text": "---\n GuiCommand:\n Name: BIM ProjectManager\n MenuLocation: Manage , Manage project...\n Workbenches: BIM_Workbench\n---\n\n# BIM ProjectManager/en\n\n## Description\n\nThe **BIM Project Setup** dialog allows you to create a basic set of guide objects in the current document or in a new document, that will help you to start modeling a BIM project.\n\n\"\" \n*BIM Project Setup*\n\n## Usage\n\nThe project setup dialog can create:\n\n- A new [document](Document_structure.md). Alternatively, the other objects will be created in the currently opened document.\n- A [site](Arch_Site.md). The Site object represents a piece of terrain, where your project will be located. You can give it a number of useful properties, such as street address and earth coordinates. Upon creation, the site is just an empty container for other BIM objects, but a 3D object representing the actual terrain can be attached to it later on.\n- A [building](Arch_Building.md). The Building object is a container for all the BIM objects that will belong to a same building. You can define a building type, and give it gross rectangular dimensions, that will be represented as a rectangle drawn on the ground (X,Y) plane.\n- A set of [axes](Arch_Axis.md), by defining their number and spacing. Axes are used as guidelines to align 2D and 3D objects. These axes can be modified or new axes introduced later on.\n- A set of [BuildingParts](Arch_BuildingPart.md) to represent levels. BuildingParts are generic BIM container objects that can be used to group other BIM objects in a number of meaningful ways, such as repeatable components or building levels.\n- A set of default [groups](Std_Group.md) inside each level. Groups can be used to organize your BIM objects in clearer categories, such as \\\"Walls\\\" or \\\"Columns\\\". They have no impact on the model itself, but often help to make your model structure clearer when it contains a lot of objects.\n\n## Templates\n\nThe Project tool supports two kinds of templates:\n\n- Once you have filled the different options, the contents of the BIM project setup wizard can be **saved** as a template. These templates can be **restored** and adapted at a later time. Project templates are stored as plain text files in your FreeCAD user folder.\n- Alternatively, you can also save the contents of the current document as a template. This will save the currently opened document as a standard **.FCStd** file, but also include additional BIM settings like the current working plane, or current units. By using the **restore** option anytime, the contents of that template file will be merged into the active document and all settings found in it applied.\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](BIM_Workbench.md) > BIM ProjectManager/en\n"} {"id": "freecad-docs:wiki/translations/en/BIM_SimpleCopy.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/BIM_SimpleCopy.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/BIM_SimpleCopy.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "9e5d4dad81c99b391484160527713bd58c4f9aeef855b1660859cb1b6f67a1b1", "bytes": 170, "tokens": 79, "text": "# BIM SimpleCopy/en\n1. REDIRECT [Part_SimpleCopy/en](Part_SimpleCopy/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > [BIM](BIM_Workbench.md) > BIM SimpleCopy/en\n"} {"id": "freecad-docs:wiki/translations/en/CAM_Area_Workplane.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/CAM_Area_Workplane.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/CAM_Area_Workplane.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7d2c6faa23115d22fd7b62245a3ecf48e339b972d688af8210ee84fda3825749", "bytes": 513, "tokens": 209, "text": "---\n GuiCommand:\n Name: CAM Area Workplane\n MenuLocation: CAM , Area workplane\n Workbenches: CAM_Workbench\n---\n\n# CAM Area Workplane/en\n\n## Description\n\nEmpty\n\n## Usage\n\nEmpty\n\n## Options\n\nEmpty\n\n## Properties\n\n### Data\n\nEmpty\n\n### View\n\nEmpty\n\n## Scripting\n\n\n**See also:**\n\n[FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nExample:\n\n\n```python\n#Place code example here.\n```\n\n\n{{CAM_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [CAM](CAM_Workbench.md) > CAM Area Workplane/en\n"} {"id": "freecad-docs:wiki/translations/en/CAM_Array.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/CAM_Array.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/CAM_Array.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "04381f94e470fba7e4a71221f79f27e621487dfc965015615667e9633781e510", "bytes": 1050, "tokens": 355, "text": "---\n GuiCommand:\n Name: CAM Array\n MenuLocation: CAM , Path Modification , Array\n Workbenches: CAM_Workbench\n---\n\n# CAM Array/en\n\n## Description\n\nThe tool \"\" [Array](CAM_Array.md) creates a new path by duplicating another path several times at a certain interval distance.\n\n## Usage\n\n1. Select the operation you want to repeat\n2. Press the ** [Array](CAM_Array.md)** button\n3. Press **Apply**\n4. Adjust the desired properties at the data box\n\n## Properties\n\n- **Type**: The type array (polar, linear one ore two directions)\n\n- **Offset**: The spacing between the array copies for each direction\n\n- **Copies**: The number of copies (not counting the original) for each direction\n\n## Scripting\n\n\n**See also:**\n\n[FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nExample:\n\n\n```python\n#Place code example here.\n```\n\n\n{{CAM_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [CAM](CAM_Workbench.md) > CAM Array/en\n"} {"id": "freecad-docs:wiki/translations/en/Category_3rd_Party.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Category_3rd_Party.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Category_3rd_Party.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "246af2eb21bc881ef72f5bf64c20d75e132d16763da83aba241687b3cb90bbe9", "bytes": 824, "tokens": 345, "text": "# Category:3rd Party/en\nExternal aka 3rd-Party applications/libraries that FreeCAD depends on or are of some interest to the FC community\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [3Dconnexion input devices/en](3Dconnexion_input_devices/en.md) | [Developing FreeCAD with GitKraken/en](Developing_FreeCAD_with_GitKraken/en.md) | [Developing FreeCAD with KDevelop/en](Developing_FreeCAD_with_KDevelop/en.md) |\n| [Doxygen/en](Doxygen/en.md) | [IfcOpenShell/en](IfcOpenShell/en.md) | [Import/Export IFC - compiling IfcOpenShell/en](Import/Export_IFC_-_compiling_IfcOpenShell/en.md) |\n| [NumPy/en](NumPy/en.md) | [OpenCamLib/en](OpenCamLib/en.md) | [OpenCascade/en](OpenCascade/en.md) |\n| [Std DependencyGraph/en](Std_DependencyGraph/en.md) |\n\n\n---\n⏵ [documentation index](../README.md) > Category:3rd Party/en\n"} {"id": "freecad-docs:wiki/translations/en/Category_Artwork.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Category_Artwork.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Category_Artwork.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "918a18ac9bcf392624bf721866b49daf02c626f1ae9690c17d94ce396a7d2021", "bytes": 1725, "tokens": 720, "text": "# Category:Artwork/en\nThis category collects pages related to artwork existing in the program, like icons and images that are used in different workbenches.\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [Artwork Assembly/en](Artwork_Assembly/en.md) | [Artwork Assembly3/en](Artwork_Assembly3/en.md) | [Artwork BIM/en](Artwork_BIM/en.md) |\n| [Artwork CAM/en](Artwork_CAM/en.md) | [Artwork Draft/en](Artwork_Draft/en.md) | [Artwork Fem/en](Artwork_Fem/en.md) |\n| [Artwork Gui/en](Artwork_Gui/en.md) | [Artwork Guidelines/en](Artwork_Guidelines/en.md) | [Artwork Inspection/en](Artwork_Inspection/en.md) |\n| [Artwork Material/en](Artwork_Material/en.md) | [Artwork Mesh/en](Artwork_Mesh/en.md) | [Artwork MeshPart/en](Artwork_MeshPart/en.md) |\n| [Artwork OpenSCAD/en](Artwork_OpenSCAD/en.md) | [Artwork Part/en](Artwork_Part/en.md) | [Artwork PartDesign/en](Artwork_PartDesign/en.md) |\n| [Artwork Plot/en](Artwork_Plot/en.md) | [Artwork Points/en](Artwork_Points/en.md) | [Artwork Reinforcement/en](Artwork_Reinforcement/en.md) |\n| [Artwork Render/en](Artwork_Render/en.md) | [Artwork ReverseEngineering/en](Artwork_ReverseEngineering/en.md) | [Artwork Robot/en](Artwork_Robot/en.md) |\n| [Artwork SheetMetal/en](Artwork_SheetMetal/en.md) | [Artwork Ship/en](Artwork_Ship/en.md) | [Artwork Sketcher/en](Artwork_Sketcher/en.md) |\n| [Artwork Splash screen/en](Artwork_Splash_screen/en.md) | [Artwork Spreadsheet/en](Artwork_Spreadsheet/en.md) | [Artwork Surface/en](Artwork_Surface/en.md) |\n| [Artwork TechDraw/en](Artwork_TechDraw/en.md) | [Artwork Test/en](Artwork_Test/en.md) | [Artwork Tux/en](Artwork_Tux/en.md) |\n| [Artwork/en](Artwork/en.md) |\n\n\n---\n⏵ [documentation index](../README.md) > Category:Artwork/en\n"} {"id": "freecad-docs:wiki/translations/en/Category_Manual.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Category_Manual.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Category_Manual.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2ac4431676780aaac5bff2445f9c374927143c2f2935ccbb58eff69db314a983", "bytes": 1986, "tokens": 786, "text": "# Category:Manual/en\nThis category contains all the page of the FreeCAD manual (Manual/en)\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [Manual:A gentle introduction/en](Manual_A_gentle_introduction/en.md) | [Manual:All workbenches at a glance/en](Manual_All_workbenches_at_a_glance/en.md) | [Manual:BIM modeling/en](Manual_BIM_modeling/en.md) |\n| [Manual:Creating and manipulating geometry/en](Manual_Creating_and_manipulating_geometry/en.md) | [Manual:Creating FEM analyses/en](Manual_Creating_FEM_analyses/en.md) | [Manual:Creating interface tools/en](Manual_Creating_interface_tools/en.md) |\n| [Manual:Creating parametric objects/en](Manual_Creating_parametric_objects/en.md) | [Manual:Creating renderings/en](Manual_Creating_renderings/en.md) | [Manual:Generating 2D drawings/en](Manual_Generating_2D_drawings/en.md) |\n| [Manual:Import and export to other filetypes/en](Manual_Import_and_export_to_other_filetypes/en.md) | [Manual:Installing/en](Manual_Installing/en.md) | [Manual:Introduction/en](Manual_Introduction/en.md) |\n| [Manual:Modeling for product design/en](Manual_Modeling_for_product_design/en.md) | [Manual:Navigating in the 3D view/en](Manual_Navigating_in_the_3D_view/en.md) | [Manual:Parametric objects/en](Manual_Parametric_objects/en.md) |\n| [Manual:Preparing models for 3D printing/en](Manual_Preparing_models_for_3D_printing/en.md) | [Manual:Summary/en](Manual_Summary/en.md) | [Manual:The Community/en](Manual_The_Community/en.md) |\n| [Manual:The FreeCAD document/en](Manual_The_FreeCAD_document/en.md) | [Manual:The FreeCAD Interface/en](Manual_The_FreeCAD_Interface/en.md) | [Manual:Traditional 2D drafting/en](Manual_Traditional_2D_drafting/en.md) |\n| [Manual:Traditional modeling, the CSG way/en](Manual_Traditional_modeling,_the_CSG_way/en.md) | [Manual:Using spreadsheets/en](Manual_Using_spreadsheets/en.md) | [Manual:What is FreeCAD/en](Manual_What_is_FreeCAD/en.md) |\n|\n\n\n---\n⏵ [documentation index](../README.md) > Category:Manual/en\n"} {"id": "freecad-docs:wiki/translations/en/Category_Tutorials.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Category_Tutorials.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Category_Tutorials.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6e922febef9a3c26be647281829e7860ad934e7c4536217c6001b5c6614fd690", "bytes": 7304, "tokens": 3022, "text": "# Category:Tutorials/en\nThis is a complete list of pages under [:Category:Tutorials](:Category_Tutorials.md).\n\nSee also [Tutorials](Tutorials.md) and [video tutorials](video_tutorials.md)\n\n### Contents\n\n| | | |\n| --- | --- | --- |\n| [Add Button to FEM Toolbar Tutorial/en](Add_Button_to_FEM_Toolbar_Tutorial/en.md) | [Add FEM Constraint Tutorial/en](Add_FEM_Constraint_Tutorial/en.md) | [Add FEM Equation Tutorial/en](Add_FEM_Equation_Tutorial/en.md) |\n| [Advanced Attachment OYX/en](Advanced_Attachment_OYX/en.md) | [Advanced TechDraw Tutorial/en](Advanced_TechDraw_Tutorial/en.md) | [Aeroplane/en](Aeroplane/en.md) |\n| [Analysis of reinforced concrete with FEM/en](Analysis_of_reinforced_concrete_with_FEM/en.md) | [Arch panel tutorial/en](Arch_panel_tutorial/en.md) | [Arch tutorial/en](Arch_tutorial/en.md) |\n| [Basic Attachment Tutorial/en](Basic_Attachment_Tutorial/en.md) | [Basic modeling tutorial/en](Basic_modeling_tutorial/en.md) | [Basic Part Design Tutorial 019/en](Basic_Part_Design_Tutorial_019/en.md) |\n| [Basic Part Design Tutorial/en](Basic_Part_Design_Tutorial/en.md) | [Basic Sketcher Tutorial/en](Basic_Sketcher_Tutorial/en.md) | [Basic TechDraw Tutorial/en](Basic_TechDraw_Tutorial/en.md) |\n| [BIM ingame tutorial/en](BIM_ingame_tutorial/en.md) | [CAM Walkthrough for the Impatient/en](CAM_Walkthrough_for_the_Impatient/en.md) | [Configuration Tables/en](Configuration_Tables/en.md) |\n| [Creating a simple part with Draft and Part WB/en](Creating_a_simple_part_with_Draft_and_Part_WB/en.md) | [Creating a simple part with Part WB/en](Creating_a_simple_part_with_Part_WB/en.md) | [Creating a simple part with PartDesign/en](Creating_a_simple_part_with_PartDesign/en.md) |\n| [Customize Toolbars/en](Customize_Toolbars/en.md) | [Draft ShapeString tutorial/en](Draft_ShapeString_tutorial/en.md) | [Draft tutorial/en](Draft_tutorial/en.md) |\n| [Engine Block Tutorial/en](Engine_Block_Tutorial/en.md) | [Example Combined Footing/en](Example_Combined_Footing/en.md) | [Example Slab Having LShape Rebars Reinforcement Mesh/en](Example_Slab_Having_LShape_Rebars_Reinforcement_Mesh/en.md) |\n| [Example Slab Having Mesh Of Straight Rebars/en](Example_Slab_Having_Mesh_Of_Straight_Rebars/en.md) | [Example Slab Having UShape Rebars Reinforcement Mesh/en](Example_Slab_Having_UShape_Rebars_Reinforcement_Mesh/en.md) | [Example Slab Spanning in One Direction/en](Example_Slab_Spanning_in_One_Direction/en.md) |\n| [Example Slab Spanning in Two Directions/en](Example_Slab_Spanning_in_Two_Directions/en.md) | [Export to STL or OBJ/en](Export_to_STL_or_OBJ/en.md) | [Extend FEM Module/en](Extend_FEM_Module/en.md) |\n| [FEM CalculiX Cantilever 3D/en](FEM_CalculiX_Cantilever_3D/en.md) | [FEM Example Capacitance Two Balls/en](FEM_Example_Capacitance_Two_Balls/en.md) | [FEM Geometry Preparation and Meshing/en](FEM_Geometry_Preparation_and_Meshing/en.md) |\n| [FEM Shear of a Composite Block/en](FEM_Shear_of_a_Composite_Block/en.md) | [FEM Tutorial Python/en](FEM_Tutorial_Python/en.md) | [FEM tutorial/en](FEM_tutorial/en.md) |\n| [FreeCAD-Ship s60 tutorial (II)/en](FreeCAD-Ship_s60_tutorial_(II)/en.md) | [FreeCAD-Ship s60 tutorial/en](FreeCAD-Ship_s60_tutorial/en.md) | [How to install additional workbenches/en](How_to_install_additional_workbenches/en.md) |\n| [How to install macros/en](How_to_install_macros/en.md) | [Import from STL or OBJ/en](Import_from_STL_or_OBJ/en.md) | [Import OpenSCAD code/en](Import_OpenSCAD_code/en.md) |\n| [Import text and geometry from Inkscape/en](Import_text_and_geometry_from_Inkscape/en.md) | [Import/Export IFC - compiling IfcOpenShell/en](Import/Export_IFC_-_compiling_IfcOpenShell/en.md) | [Manual:Creating FEM analyses/en](Manual_Creating_FEM_analyses/en.md) |\n| [Manual:Creating renderings/en](Manual_Creating_renderings/en.md) | [Manual:Generating 2D drawings/en](Manual_Generating_2D_drawings/en.md) | [Manual:Import and export to other filetypes/en](Manual_Import_and_export_to_other_filetypes/en.md) |\n| [Manual:Installing/en](Manual_Installing/en.md) | [Manual:Modeling for product design/en](Manual_Modeling_for_product_design/en.md) | [Manual:Parametric objects/en](Manual_Parametric_objects/en.md) |\n| [Manual:Preparing models for 3D printing/en](Manual_Preparing_models_for_3D_printing/en.md) | [Manual:Traditional 2D drafting/en](Manual_Traditional_2D_drafting/en.md) | [Manual:Traditional modeling, the CSG way/en](Manual_Traditional_modeling,_the_CSG_way/en.md) |\n| [Manual:Using spreadsheets/en](Manual_Using_spreadsheets/en.md) | [Measurement Of Angles On Holes/en](Measurement_Of_Angles_On_Holes/en.md) | [PartDesign Bearingholder Tutorial I/en](PartDesign_Bearingholder_Tutorial_I/en.md) |\n| [PartDesign Bearingholder Tutorial II/en](PartDesign_Bearingholder_Tutorial_II/en.md) | [PartDesign tutorial/en](PartDesign_tutorial/en.md) | [Plot Basic tutorial/en](Plot_Basic_tutorial/en.md) |\n| [Plot MultiAxes tutorial/en](Plot_MultiAxes_tutorial/en.md) | [Post-Processing of FEM Results with Paraview/en](Post-Processing_of_FEM_Results_with_Paraview/en.md) | [Private Preference Packs/en](Private_Preference_Packs/en.md) |\n| [Raytracing tutorial/en](Raytracing_tutorial/en.md) | [Robot 6-Axis/en](Robot_6-Axis/en.md) | [Robot tutorial/en](Robot_tutorial/en.md) |\n| [Scripted Parts: Ball Bearing - Part 1/en](Scripted_Parts__Ball_Bearing_-_Part_1/en.md) | [Scripted Parts: Ball Bearing - Part 2/en](Scripted_Parts__Ball_Bearing_-_Part_2/en.md) | [Scripts/en](Scripts/en.md) |\n| [Sketcher Lecture/en](Sketcher_Lecture/en.md) | [Sketcher Micro Tutorial - Constraint Practices/en](Sketcher_Micro_Tutorial_-_Constraint_Practices/en.md) | [Sketcher requirement for a sketch/en](Sketcher_requirement_for_a_sketch/en.md) |\n| [Sketcher Tutorial/en](Sketcher_Tutorial/en.md) | [TechDraw HowTo Page/en](TechDraw_HowTo_Page/en.md) | [TechDraw Pitch Circle Tutorial/en](TechDraw_Pitch_Circle_Tutorial/en.md) |\n| [TechDraw TemplateGenerator/en](TechDraw_TemplateGenerator/en.md) | [TechDraw TemplateHowTo/en](TechDraw_TemplateHowTo/en.md) | [Thread for Screw Tutorial/en](Thread_for_Screw_Tutorial/en.md) |\n| [Toothbrush Head Stand/en](Toothbrush_Head_Stand/en.md) | [Transient FEM analysis/en](Transient_FEM_analysis/en.md) | [Tutorial custom placing of windows and doors/en](Tutorial_custom_placing_of_windows_and_doors/en.md) |\n| [Tutorial for open windows/en](Tutorial_for_open_windows/en.md) | [Tutorial FreeCAD POV ray/en](Tutorial_FreeCAD_POV_ray/en.md) | [Tutorial KinematicAssembly/en](Tutorial_KinematicAssembly/en.md) |\n| [Tutorial KinematicController/en](Tutorial_KinematicController/en.md) | [Tutorial KinematicSkeleton/en](Tutorial_KinematicSkeleton/en.md) | [Tutorial Render with Blender/en](Tutorial_Render_with_Blender/en.md) |\n| [Tutorials/en](Tutorials/en.md) | [Video tutorials for architectural design/en](Video_tutorials_for_architectural_design/en.md) | [Video tutorials for product design/en](Video_tutorials_for_product_design/en.md) |\n| [VRML Preparation for Robot Simulation/en](VRML_Preparation_for_Robot_Simulation/en.md) | [Whiffle Ball tutorial/en](Whiffle_Ball_tutorial/en.md) | [Wikihouse porting tutorial/en](Wikihouse_porting_tutorial/en.md) |\n|\n\n\n---\n⏵ [documentation index](../README.md) > [Tutorials](Category_Tutorials.md) > [User_Documentation](Category_User_Documentation.md) > Category:Tutorials/en\n"} {"id": "freecad-docs:wiki/translations/en/Changelog.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Changelog.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Changelog.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "dbde1e1075076622cbdbfe80674472ee1955d6bb02fec260275af7b71125b811", "bytes": 276, "tokens": 102, "text": "# Changelog/en\nThe FreeCAD changelog is maintained on our mantis tracker:\n\n\n\n\n---\n⏵ [documentation index](../README.md) > [Administration](Category_Administration.md) > [Developer](Category_Developer.md) > Changelog/en\n"} {"id": "freecad-docs:wiki/translations/en/Console_API.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Console_API.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Console_API.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c31267635f6dd19fa214e7dcecdd6ae6e38fc1c23e7e693c1074af44a37b13c6", "bytes": 1299, "tokens": 399, "text": "# Console API/en\n**(October 2019) Do not edit this page. The information is incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation], or generate the documentation yourself, see [Source documentation](Source_documentation.md).**\n\nThis module is contained inside the FreeCAD module and contains methods to send text to FreeCAD\\'s output console and status bar. The messages will have different color if they are message, warning or error.\n\nExample: \n```python\nimport FreeCAD\nFreeCAD.Console.PrintMessage(\"Hello World!\\n\")\n```\n\n\n{{APIFunction|GetStatus|\"Log\" or \"Msg\" or \"Wrn\" or \"Err\"|Get the status for either Log, Msg, Wrn or Error for an observer|a status string.}}\n\n\n{{APIFunction|PrintError|string|Prints an error message to the output|nothing}}\n\n\n{{APIFunction|PrintLog|string|Prints a log message to the output|nothing}}\n\n\n{{APIFunction|PrintMessage|string|Prints a message to the output|nothing}}\n\n\n{{APIFunction|PrintWarning|string|Prints a warning to the output|nothing}}\n\n\n{{APIFunction|SetStatus|string|Set the stats for either Log, Msg, Wrn or Error for an observer| }}\n\n\n---\n⏵ [documentation index](../README.md) > [API](Category_API.md) > [Poweruser Documentation](Category_Poweruser%20Documentation.md) > Console API/en\n"} {"id": "freecad-docs:wiki/translations/en/Constructive_solid_geometry.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Constructive_solid_geometry.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Constructive_solid_geometry.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "331394b8ce94028e4c5ee989620b06b20a2ee46366799202eb5d1411f15d4079", "bytes": 2745, "tokens": 854, "text": "# Constructive solid geometry/en\n## Introduction\n\n[Constructive solid geometry](https://en.wikipedia.org/wiki/Constructive_solid_geometry) (**CSG**) is a modelling paradigm that is used in many traditional CAD systems. It essentially consists of using primitive solid objects and doing boolean operations with them, such as fusion, subtraction and intersection, in order to create a final shape.\n\nIn FreeCAD, this method is mostly utilized with the \"\" [Part Workbench](Part_Workbench.md), which has the ability of creating primitive objects like \"\" [boxes](Part_Box.md), \"\" [cylinders](Part_Cylinder.md), and \"\" [spheres](Part_Sphere.md) and fuse them together, or use them to cut other objects with tools like ** [Part Cut](Part_Cut.md)**.\n\n\"\"\n\n\n*Constructive solid geometry (CSG) workflow; any number of operations can be done on solid primitives to create other solid objects, and then fuse or cut them until the final shape is produced.*\n\nAlternatively, the \"\" [PartDesign Workbench](PartDesign_Workbench.md) uses a more modern approach than simple CSG; this method is called [feature editing](feature_editing.md), which means creating a base solid, and then adding sequential parametric transformations to obtain a final body.\n\n\n**Note:**\n\nA [PartDesign Body](PartDesign_Body.md) created with the [PartDesign Workbench](PartDesign_Workbench.md) can also be used in a boolean operation with other objects.\n\n## Example\n\n\"\"\n\n\n*Example of constructive solid geometry (CSG) workflow: primitive parts are fused (union); the intersection of two other primitive parts is calculated (common); the difference (cut) of the two previous shapes is obtained.*\n\n## Tutorials\n\nThe [tutorials](tutorials.md) page provides some examples on creating solids with the \"\" [Part Workbench](Part_Workbench.md) that use the **CSG** method.\n\n- [Traditional modeling, the CSG way](Manual:Traditional_modeling,_the_CSG_way.md)\n- [Wiffle ball tutorial](Whiffle_Ball_tutorial.md)\n- [Basic modeling tutorial](Basic_modeling_tutorial.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Common Questions](Category_Common%20Questions.md) > [Part](Category_Part.md) > Constructive solid geometry/en\n"} {"id": "freecad-docs:wiki/translations/en/Curves_IsoCurve.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Curves_IsoCurve.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Curves_IsoCurve.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "62b252802881ec690a98a7f8f6a0dcf4e843b04fe650543e6bb645d9d37f454c", "bytes": 1632, "tokens": 618, "text": "---\n GuiCommand:\n Name: Curves IsoCurve\n MenuLocation: Surfaces , IsoCurve\n Workbenches: Curves_Workbench\n SeeAlso: Curves_JoinCurve\n---\n\n# Curves IsoCurve/en\n\n## Description\n\nThe \"\" [Curves IsoCurve](Curves_IsoCurve.md) tool applies a UV oriented lattice on to a selected surface. This tool is part of the [external workbench](External_workbenches.md) called [Curves](Curves_Workbench.md).\n\n\"\" \n*Above: shows the before (left) and after (right) surface applied IsoCurve*\n\n## Usage\n\n1. Switch to the \"\" [Curves](Curves_Workbench.md) workbench (install from \"\" [Addon Manager](Std_AddonMgr.md) is necessary, if not previously installed)\n2. Select an unique surface on the [3D view](3D_view.md)\n3. To invoke the command, do one of the following:\n - Press the \"\" button\n - Use the **Surfaces → IsoCurve** entry from the Curves menu\n4. A UV oriented lattice on the surface is created.\n5. Change `NumberU` or/and `NumberV` to get more curves.\n\n## Notes\n\n- Curves can be extracted as a subelement (e.g: with [Curves JoinCurves](Curves_JoinCurve.md)) for others uses or just to help to visualize the shape.\n\n## Limitations\n\n## Properties\n\n## Scripting\n\n\n{{Curves Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Curves](Category_Curves.md) > Curves IsoCurve/en\n"} {"id": "freecad-docs:wiki/translations/en/Draft_CircularArray.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Draft_CircularArray.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Draft_CircularArray.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7977d8bacc79fefb3e2d1d06d4b5f409d7baf363fd249f2b903295318edb551e", "bytes": 6165, "tokens": 1818, "text": "---\n GuiCommand:\n Name: Draft CircularArray\n MenuLocation: Modification , Array tools , Circular array\n Workbenches: Draft_Workbench\n Version: 0.19\n SeeAlso: Draft_OrthoArray, Draft_PolarArray, Draft_PathArray, Draft_PathLinkArray, Draft_PointArray, Draft_PointLinkArray\n---\n\n# Draft CircularArray/en\n\n## Description\n\nThe \"\" **Draft CircularArray** command creates an array from a selected object by placing copies along concentric circumferences. The command can optionally create a [Link](App_Link.md) array, which is more efficient than a regular array.\n\nThe command can be used on 2D objects created with the [Draft Workbench](Draft_Workbench.md) or [Sketcher Workbench](Sketcher_Workbench.md), but also on many 3D objects such as those created with the [Part Workbench](Part_Workbench.md), [PartDesign Workbench](PartDesign_Workbench.md) or [BIM Workbench](BIM_Workbench.md).\n\n\"\" \n*Draft CircularArray*\n\n## Usage\n\nSee also: [Draft Snap](Draft_Snap.md).\n\n1. Optionally select one object.\n2. There are several ways to invoke the command:\n - Press the ** [Circular array](Draft_CircularArray.md)** button.\n - Select the **Modification → Array tools → Circular array** option from the menu.\n3. The **Circular array** task panel opens. See [Options](#Options.md) for more information.\n4. If you have not yet selected an object: select one object.\n5. Enter the required parameters in the task panel.\n6. To finish the command do one of the following:\n - Pick a point in the [3D view](3D_view.md) for the **Center of rotation**.\n - Press **Enter**.\n - Press the **OK** button.\n\n## Options\n\n- Enter the **Radial distance** to specify the distance between the circular layers, and between the center and the first circular layer.\n- Enter the **Tangential distance** to specify the distance between the elements on the same circular layer. Must be larger than zero.\n- Enter the **Number of circular layers**. The element at the center counts as one layer. Must be at least {{Value|2}}. The maximum that can be entered in the task panel is {{Value|99}}, but higher values are possible by changing the **Number Circles** property of the array.\n- Enter the **Symmetry** value. This number determines how the elements are distributed. A value of {{Value|3}}, for example, results in a pattern with three equal 120° pie segments. Larger values for the **Symmetry** and the **Tangential distance** result in fewer or even no elements on the inner layers.\n- Pick a point in the [3D view](3D_view.md), note that this will also finish the command, or type coordinates for the **Center of rotation**. The rotation axis of the array will pass through this point. It is advisable to move the pointer out of the [3D view](3D_view.md) before entering coordinates.\n- Press the **Reset point** button to reset the **Center of rotation** to the origin.\n- If the **Fuse** checkbox is checked overlapping elements in the array are fused. This does not work for Link arrays.\n- If the **Link array** checkbox is checked a Link array instead of a regular array is created. A Link array is more efficient because its elements are [App Link](App_Link.md) objects.\n- Press **Esc** or the **Cancel** button to abort the command.\n\n## Notes\n\n- The default rotation axis for the array is the positive Z axis. This can be changed by editing its **Axis** property.\n- A Draft CircularArray can be turned into a [Draft OrthoArray](Draft_OrthoArray.md) or a [Draft PolarArray](Draft_PolarArray.md) by changing its **Array Type** property.\n- A Link array cannot be turned into a regular array or vice versa. The type of array must be decided at creation time.\n\n## Properties\n\nSee [Draft OrthoArray](Draft_OrthoArray#Properties.md).\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nTo create a circular array use the `make_array` method ((v0.19) ) of the Draft module. This method replaces the deprecated `makeArray` method. The `make_array` method can create [Draft OrthoArrays](Draft_OrthoArray.md), [Draft PolarArrays](Draft_PolarArray.md) and Draft CircularArrays. For each array type one or more wrappers are available.\n\nThe main method:\n\n\n```python\narray = make_array(base_object, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None, use_link=True)\n```\n\nThe wrapper for circular arrays is:\n\n\n```python\narray = make_circular_array(base_object,\n r_distance=100, tan_distance=50,\n number=3, symmetry=1,\n axis=App.Vector(0, 0, 1), center=App.Vector(0, 0, 0),\n use_link=True)\n```\n\n- `base_object`is the object to be arrayed. It can also be the `Label` (string) of an object in the current document.\n\n- `r_distance`and `tan_distance` are the radial and tangential distances between the elements.\n\n- `number`is the number of circular layers in the pattern, the original object counts as the first layer.\n\n- `symmetry`is an integer used in some calculations that affect the way the elements are distributed around the circumferences. Usual values are from 1 to 6. Higher values are not recommended and will make the elements in the inner layers disappear.\n\n- `axis`and `center` are vectors that describe the direction of the axis of rotation, and a point through which that axis passes.\n\n- If `use_link` is `True` the created elements are [App Links](App_Link.md) instead of regular copies.\n\n- `array`is returned with the created array object.\n\nExample:\n\n\n```python\nimport FreeCAD as App\nimport Draft\n\ndoc = App.newDocument()\n\ntri = Draft.make_polygon(3, 600)\n\narray = Draft.make_circular_array(tri, 1800, 1200, 4, 1)\ndoc.recompute()\n```\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft CircularArray/en\n"} {"id": "freecad-docs:wiki/translations/en/Draft_ShapeString.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Draft_ShapeString.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Draft_ShapeString.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "32e3902fa2e2a10214a59a0dc16af28be33380cdc8a827daae0a6c90e1124477", "bytes": 9799, "tokens": 3134, "text": "---\n GuiCommand:\n Name: Draft ShapeString\n MenuLocation: Drafting , Shape from text
Annotation , Shape from text\n Workbenches: Draft_Workbench, BIM_Workbench\n Shortcut: \n Version: 0.14\n SeeAlso: Draft_Text, Draft_Label, Part_Extrude\n---\n\n# Draft ShapeString/en\n\n## Description\n\nThe \"\" **Draft ShapeString** command creates a compound shape that represents a text string. This shape can be used to create 3D letters with the [Part Extrude](Part_Extrude.md) command.\n\nThe Draft ShapeString command is not intended for standard text annotations. The [Draft Text](Draft_Text.md) command or the [Draft Label](Draft_Label.md) command should be used for that purpose.\n\n![](images/Draft_ShapeString_Example400.png ) \n*Single point required to position the ShapeString*\n\n## Usage\n\nFor Windows users: please read the [Font file selection on Windows](#Font_file_selection_on_Windows.md) paragraph first.\n\n1. There are several ways to invoke the command:\n - Press the ** [Shape from text](Draft_ShapeString.md)** button.\n - [Draft](Draft_Workbench.md): Select the **Drafting → Shape from text** option from the menu.\n - [BIM](BIM_Workbench.md): Select the **Annotation → Shape from text** option from the menu.\n2. The **ShapeString** task panel opens.\n3. Click a point in the [3D view](3D_view.md), or type coordinates.\n4. Optionally press the **Reset Point** button to reset the point to the origin.\n5. Enter a **String**.\n6. Specify the **Height**.\n7. To select a font do one of the following:\n - Enter a file path in the **Font file** input box.\n - Press the **...** button and select a file.\n8. Press the **OK** button to finish the command.\n9. Optionally change the **Justification** of the ShapeString. See [Properties](#Properties.md).\n\n## Options\n\n- Press **Esc** or the **Cancel** button to abort the command.\n\n## Relative font path \n\n\n(v1.1) \n\nIt is possible to specify a relative path for the font file. For this the FreeCAD document must have been saved at least once.\n\nSome examples:\n\n- **./SomeFont.ttf**: The font file is in the same directory as the document.\n\n- **./MyDirectory/SomeFont.ttf**: The font file is in the **MyDirectory** sub-directory of the document directory.\n\n- **../SomeFont.ttf**: The font file is in the parent directory of the document directory.\n\n## Font file selection on Windows \n\nOn Windows access to the default font folder is restricted. This affects the font file selection for ShapeStrings. There are three cases in FreeCAD where a font file for ShapeStrings can be specified: in the ShapeString task panel, when changing the **Font File** property of a ShapeString, and when specifying the default font file in the [Draft Preferences](Draft_Preferences#Texts_and_dimensions.md).\n\nPressing the **...** button and then selecting a file from the default Windows font folder is not possible when using the native file dialog. There are a number of workarounds:\n\n- Make sure **DontUseNativeFontDialog** is set to {{True}}, which is the default value for this preference. This will only call a different, non-native, file dialog when pressing the **...** button in the ShapeString task panel. With this file dialog the default Windows font folder can be accessed.\n- Change **DontUseNativeDialog** to {{True}}. This instructs FreeCAD to always use the non-native file dialog.\n- Specify the font file in the input box. You can of course type the full path or copy-paste the path from the Windows File Explorer. But there is also another way to enter the path. If you enter {{Value|C:\\}} a dropdown list will appear. Select {{Value|Windows}} from that list and add {{Value|\\F}}. Select {{Value|Fonts}} from the new dropdown list. Finally add {{Value|\\}} and the first letter(s) of the font file, and then select it from the dropdown list.\n- Create a custom folder for your font files.\n\nSee the [Preferences](#Preferences.md) paragraph below for the location of the mentioned preferences.\n\n## Notes\n\n- A Draft ShapeString can be edited by double-clicking it in the [Tree view](Tree_view.md).\n- Supported fonts include TrueType (**.ttf**), OpenType (**.otf**) and Type 1 (**.pfb**).\n- The command is restricted to left-to-right text. Right-to-left and top-to-bottom text are not supported.\n- Very small text heights may result in deformed character shapes due to loss of detail in scaling.\n- Fonts can generate problematic geometry. This is because font contours are allowed to overlap and have small gaps. These conditions are considered errors in wires used to define faces.\n- Draft ShapeStrings can also be created with the [Macro Fonts Win10 PYMP](Macro_Fonts_Win10_PYMP.md).\n- To create Draft ShapeStrings arranged in a circular fashion use the [Macro FCCircularText](Macro_FCCircularText.md).\n\n## Tutorials\n\n- [Draft ShapeString tutorial](Draft_ShapeString_tutorial.md): extrude a ShapeString, position it in 3D space, and create an engraving in another body.\n- [How to use ShapeStrings in PartDesign](https://forum.freecadweb.org/viewtopic.php?f=3&t=36623)\n\n## Preferences\n\nSee also: [Preferences Editor](Preferences_Editor.md), [Draft Preferences](Draft_Preferences.md) and [Std DlgParameter](Std_DlgParameter.md).\n\n- The default font file can be changed in the preferences: **Edit → Preferences... → Draft → Texts and dimensions → Default ShapeString font file**.\n- For Windows users:\n - Set **Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeFontDialog** to {{True}} to use the non-native file dialog when selecting a font file from the ShapeString task panel.\n - Alternatively, set **Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeDialog** to {{True}} to always use the non-native file dialog.\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA Draft ShapeString object is derived from a [Part Part2DObject](Part_Part2DObject.md) and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{TitleProperty|Draft}}\n\n- **Font File|File**: Font file name.\n\n- **Fuse|Bool**: Fuse faces if faces overlap, usually not required (can be very slow). Ignored if **Make Face** is `False`. (v1.0) \n\n- **Justification|Enumeration**: Horizontal and vertical alignment. Options: {{value|Top-Left}}, {{value|Top-Center}}, {{value|Top-Right}}, {{value|Middle-Left}}, {{value|Middle-Center}}, {{value|Middle-Right}}, {{value|Bottom-Left}}, {{value|Bottom-Center}}, {{value|Bottom-Right}}. (v1.0) \n\n- **Justification Reference|Enumeration**: Height reference used for justification. Options: {{value|Cap Height}}, {{value|Shape Height}}. The shape height depends on the characters in **String**. (v1.0) \n\n- **Keep Left Margin|Bool**: Keep left margin and leading white space when justification is left. (v1.0) \n\n- **Make Face|Bool**: Fill letters with faces.\n\n- **Oblique Angle|Angle**: Oblique (slant) angle. Must be in the -80° to +80° range. (v1.0) \n\n- **Scale To Size|Bool**: Scale to ensure cap height is equal to size. If set to `False`, depending on the font, cap height will not match **Size** exactly. (v1.0) \n\n- **Size|Length**: Height of text.\n\n- **String|String**: Text string. A ShapeString can only display a single text line.\n\n- **Tracking|Distance**: Inter-character spacing. (v1.0) : The property type has been updated.\n\n\"\" \n*The height of the red rectangle (solid line) is equal to the cap height.
\nThe height of the green rectangle (dashed line) is equal to the shape height.
\nThe corners, the midpoints of the edges, and the center of the rectangles
\nmatch the 9 justification options: Top-Left to Bottom-Right.*\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nTo create a Draft ShapeString use the `make_shapestring` method ((v0.19) ) of the Draft module. This method replaces the deprecated `makeShapeString` method.\n\n\n```python\nshapestring = make_shapestring(String, FontFile, Size=100, Tracking=0)\n```\n\n- Creates a `shapestring` compound shape using the specified `String` and the full path of a supported `FontFile`.\n\n- `Size`is the height of the resulting text in millimeters.\n\n- `Tracking`is the inter-character spacing in millimeters.\n\nThe placement of the ShapeString can be changed by overwriting its `Placement` attribute, or by individually overwriting its `Placement.Base` and `Placement.Rotation` attributes.\n\nExample:\n\n\n```python\nimport FreeCAD as App\nimport Draft\n\ndoc = App.newDocument()\n\nfont1 = \"/usr/share/fonts/truetype/msttcorefonts/Arial.ttf\"\nfont2 = \"/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf\"\nfont3 = \"/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf\"\n\nS1 = Draft.make_shapestring(\"This is a sample text\", font1, 200)\n\nS2 = Draft.make_shapestring(\"Inclined text\", font2, 200, 10)\n\nzaxis = App.Vector(0, 0, 1)\np2 = App.Vector(-1000, 500, 0)\nplace2 = App.Placement(p2, App.Rotation(zaxis, 45))\nS2.Placement = place2\n\nS3 = Draft.make_shapestring(\"Upside-down text\", font3, 200, 10)\nS3.Placement.Base = App.Vector(0, -1000, 0)\nS3.Placement.Rotation = App.Rotation(zaxis, 180)\n\ndoc.recompute()\n```\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft ShapeString/en\n"} {"id": "freecad-docs:wiki/translations/en/Draft_Slope.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Draft_Slope.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Draft_Slope.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e2c2753ee6ac551999817d5a8c4d3d8be838e022aed061f2faff78af048815fa", "bytes": 1998, "tokens": 680, "text": "---\n GuiCommand:\n Name: Draft Slope\n MenuLocation: Modification , Set slope
Utils , Set slope\n Workbenches: Draft_Workbench, BIM_Workbench\n Version: 0.17\n---\n\n# Draft Slope/en\n\n## Description\n\nThe \"\" **Draft Slope** command slopes selected [Draft Lines](Draft_Line.md) or [Draft Wires](Draft_Wire.md) by increasing, or decreasing, the Z coordinate of all points after the first one. It can also be used to flatten [Draft Wires](Draft_Wire.md). Note that the slope is relative to the XY plane defined by the **Placement** of the objects.\n\n\"\" \n*On the left a horizontal Draft Line. On the right the same line with a slope value of 1 (angle is 45°)*\n\n## Usage\n\n1. Select one or more [Draft Lines](Draft_Line.md) and/or [Draft Wires](Draft_Wire.md).\n2. There are several ways to invoke the command:\n - [Draft](Draft_Workbench.md): Press the ** [Set slope](Draft_Slope.md)** button.\n - Draft: Select the **Modification → Set slope** option from the menu.\n - [BIM](BIM_Workbench.md): Select the **Utils → Set slope** option from the menu.\n3. Enter a **Slope** value. {{Value|0}} means each segment is horizontal, {{Value|0.5}} means the delta height for each segment is {{Value|0.5}} times its length, etc. The value can also be negative.\n4. Press **Enter** or the **OK** button to finish the command.\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThere is no Python method to slope objects. To emulate the results of the Draft Slope command the `Points` property of wire objects has to be modified.\n\n\n---\n⏵ [documentation index](../README.md) > [Draft](Draft_Workbench.md) > Draft Slope/en\n"} {"id": "freecad-docs:wiki/translations/en/FEM_EquationHeat.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/FEM_EquationHeat.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/FEM_EquationHeat.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "434af34ed8e8d44de7263f4e6279fe56874a42e8a4af64d21fb29bb00bb3047c", "bytes": 3262, "tokens": 1034, "text": "---\n GuiCommand:\n Name: FEM EquationHeat\n MenuLocation: Solve , Heat equation\n Workbenches: FEM_Workbench\n Version: 0.17\n SeeAlso: FEM_tutorial\n---\n\n# FEM EquationHeat/en\n\n## Description\n\nThis equation describes the heat transfer in rigid and fluid bodies.\n\nFor info about the math of the equation, see the [Elmer models manual](http://www.elmerfem.org/blog/documentation/), section *Heat Equation*.\n\n## Usage\n\n1. After adding an Elmer solver as described [here](FEM_SolverElmer#Equations.md), select it in the [tree view](Tree_view.md).\n2. Now either use the toolbar button \"\" or the menu **Solve → Heat equation**.\n3. Change the [equation\\'s solver settings](#Solver_Settings.md) or the [general solver settings](FEM_SolverElmer_SolverSettings.md) if necessary.\n\n## Solver Settings \n\nFor the general solver settings, see the [Elmer solver settings](FEM_SolverElmer_SolverSettings.md).\n\nThe heat equation provides these special settings:\n\n- **Bubbles**: There is also a residual-free-bubbles formulation of the stabilized finite-element method. It is more accurate and does not include any ad hoc terms. However, it may be computationally more expensive. If both **Note**: If during the *first solver iteration* you get this error: ERROR:: IterSolve: Numerical Error: System diverged over maximum tolerance.The **Bubbles** method failed. In this case set **[Stabilize](FEM_SolverElmer_SolverSettings#Base.md)** to *true*.\n\nEquation:\n\n- **Convection**: The type of convection to be used in the heat equation.**Note**: If this is not set to *None*, **[Stabilize](FEM_SolverElmer_SolverSettings#Base.md)** must be to *true* otherwise the convection term will not be considered for the heat equation.\n\n- **Phase Change Model**: The model use for phase changes (ice to water etc.). The model *Spatial 1* is the apparent-heat-capacity method, *Spatial 2* and *Temporal* are effective-heat-capacity methods.For more info about the models, see [this paper](https://blog.rwth-aachen.de/gfd/files/2017/07/BT_2013_Schueller_elmer_icemole.pdf) (section 2.5.2.2) (is in German). In the paper it was also shown that *Spatial 1* has numerical problems on larger temperature gradients and that *Spatial 2* was preferred for the phase change ice to water.\n\n## Analysis Feature Information \n\nThe heat equation takes the following analysis features into account if they are set:\n\n- \"\" [Body heat source](FEM_ConstraintBodyHeatSource.md)\n- \"\" [Initial temperature condition](FEM_ConstraintInitialTemperature.md)\n- \"\" [Temperature boundary condition](FEM_ConstraintTemperature.md)\n\n### Note\n\nExcept for calculations in 2D, for all the above analysis features it is important that they act on a face or a body. Features in 3D set to lines or vertices are not recognized by the Elmer solver.\n\n## Result\n\nThe result is the temperature in Kelvin.\n\n\n{{FEM Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [FEM](Category_FEM.md) > FEM EquationHeat/en\n"} {"id": "freecad-docs:wiki/translations/en/FEM_PostCreateFunctions.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/FEM_PostCreateFunctions.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/FEM_PostCreateFunctions.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "bcd261895d4fe1866867cff08d197c41997b86ad25a02c74611237d15eb894cd", "bytes": 206, "tokens": 83, "text": "# FEM PostCreateFunctions/en\n1. REDIRECT [FEM_Workbench/en#FEM_PostCreateFunctions](FEM_Workbench/en#FEM_PostCreateFunctions.md)\n\n\n---\n⏵ [documentation index](../README.md) > FEM PostCreateFunctions/en\n"} {"id": "freecad-docs:wiki/translations/en/FEM_PostFilterDataAtPoint.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/FEM_PostFilterDataAtPoint.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/FEM_PostFilterDataAtPoint.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "cfc3030afc33bf02aaa7db786b92268a4713db840a78bb68d1b9b27d5e2051d3", "bytes": 1212, "tokens": 376, "text": "---\n GuiCommand:\n Name: FEM PostFilterDataAtPoint\n MenuLocation: Results , Data at point clip filter\n Workbenches: FEM_Workbench\n SeeAlso: FEM_PostPipelineFromResult, FEM_tutorial\n---\n\n# FEM PostFilterDataAtPoint/en\n\n## Description\n\nDisplays the value of a selected field at a picked point.\n\n## Usage\n\n1. Select a previously created [result pipeline](FEM_PostPipelineFromResult.md) or another filter (except of a line filter).\n2. Invoke the command either by:\n - Pressing the button ** '''Data at point clip filter'''**.\n - Using the menu **Results → Data at point clip filter**.\n3. Select a result **Field**.\n4. Now\n - either click the **Select Point** button and subsequently pick the desired point in the mesh.\n - change the point coordinate.\n\nThe value at this point for the given **Field** is output to the dialog. The value of the data point is also anytime accessible via the [property](Property_editor.md) **Point Data**.\n\n\n{{FEM Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [FEM](Category_FEM.md) > FEM PostFilterDataAtPoint/en\n"} {"id": "freecad-docs:wiki/translations/en/FEM_Shear_of_a_Composite_Block.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/FEM_Shear_of_a_Composite_Block.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/FEM_Shear_of_a_Composite_Block.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "06caaab564b539c986a0c61edad7cda1f1f8933a293d06e7d5608deeb19fae56", "bytes": 11013, "tokens": 2899, "text": "---\n TutorialInfo:\n Topic: Finite Element Analysis\n Level: Beginner/Intermediate\n Time: 30 minutes\n Author: http://www.freecadweb.org/wiki/index.php?title=User: HarryvL\n FCVersion: 0.17.12960 or above\n---\n\n# FEM Shear of a Composite Block/en\n\n\n## Introduction\n\nIn this tutorial we analyse the shear deformation of a composite block consisting of a stiff core embedded in a soft matrix. It demonstrates the use of BooleanFragments and CompoundFilter to create solids for the block and the matrix from two concentric cubes. This workflow ensures that separate MeshRegions, Materials and Boundary Conditions can be defined for the block and the surrounding matrix. To select internal regions we can make use of the [macro by Markus Hovorka](https://github.com/drhooves/SelectionTools) or choose an alternative approach. The CalculiX results clearly show the effect of the stiff core on the response of the composite block.\n\n## Geometry\n\nFirst we create two concentric cubes, one size 10mm and the other size 5mm. This is done in the [Part Workbench](Part_Workbench.md). By default the cube is placed at the origin \\[0, 0, 0\\], so the smaller cube needs to be scaled down and shifted by changing the settings in the Data tab of the property panel. To make the core visible, the Transparency of the outer block is set to 50 in the View tab of the [Property editor](Property_editor.md). The result is shown below.\n\n\"\"\n\nNext highlight the two blocks in the tree and create a BooleanFragments object (**Part → Split → Boolean Fragments**). In the \\\"Property Window - Data Tab\\\" change Mode to CompSolid. Now highlight the BooleanFragments in the Object tree and create a CompoundFilter (**Part → Compound → Compound Filter**).\n\n\"\"\n\n## Mesh and Mesh Regions \n\nFrom workbench FEM we create an Analysis container. This will contain all definitions required for the CalculiX analysis and its results. Note that this Analysis container needs to be activated (right-click and select \\\"Activate analysis\\\") whenever re-loading the file or after switching back from other analyses. To start the meshing process, highlight the CompoundFilter in the Object Tree and activate the meshing dialog **Mesh → FEM mesh from shape by Gmsh**. Leave the dialog by clicking OK.\n\nA Mesh object is now created in the Object Tree. Highlight this object and create a Mesh Region object via **Mesh → FEM mesh region**. Open the dialog box for this Mesh Region by double clicking and tick the radio button for Solid. Next click the \\\"Add Reference\\\" button and select the CompoundFilter object in the Graphical Window. This should add a reference to \\\"CompoundFilter:Solid1\\\" in the object list of the Mesh Region. Finally specify the maximum element size for this region (5mm in the current analysis). Leave the dialog by clicking OK.\n\n\"\"\n\nNext create a new Mesh object as above and use the selection macro (shortcut S, E) to select the Cube_Core object in the Graphical Window. This time the reference list should show \\\"CompoundFilter:Solid2\\\", as below. Alternatively, you can hide the Compound object and show the Cube_Core object (by expanding the Compound in the tree, selecting each of them and pressing the Spacebar). We chose a maximum element size of 1mm.\n\nNote1: Selection of \\\"CompoundFilter:Solid2\\\" requires selection of one of its faces.\n\nNote2: If you have difficulty selecting \\\"CompoundFilter:Solid2\\\" it may be because you forgot to set the BooleanFragments mode to CompSolid.\n\n\"\"\n\n## Material Assignment \n\nMaterial is assigned to Mesh Regions via a SolidMaterial object. In this tutorial we assign two materials; one for the Matrix and one for the Core.\n\nStart by selecting the CompoundFilter in the object tree. Then create a SolidMaterial object via menu option **Model → FEM material for solid**. Open the dialog and tick the radio button for Solid, press \\\"Add Reference\\\" and select the CompoundFilter object from the Graphical Window. The reference list should now show \\\"CompoundFilter:Solid1\\\", as before. We assign ABS material to the Matrix, with a Young\\'s modulus approximately 1% of that of steel.\n\n\"\"\n\nRepeat the above procedure for the Core (\\\"CompoundFilter:Solid2\\\") with the help of the selection macro or the alternative approach discussed before. This time we assign CalculiX-Steel, which is much stiffer than the ABS material for the Matrix.\n\n## Sliding Support \n\nTo create a \\\"Simple Shear\\\" condition for the composite block the deformations at the boundaries need to be unconstrained. To achieve this, the block is placed on a sliding support. This leaves three degrees of freedom in the plane of the support (2 translations and a rotation) and those will be constrained later. (Note: as the plane prevents warping of the face, it still induces a minor constraint, which could be eliminated by a different choice of boundary conditions). To create a sliding boundary condition add a FemConstraintDisplacement object (**Model → Mechanical boundary conditions and loads → Displacement boundary condition**). With the dialog box open first select the face to which the boundary condition is to be applied and then click the Add button. As the block is allowed to slide in the x-y plane, only the \\\"Fixed\\\" radio button for \\\"Displacement z\\\" is selected and the other radio buttons are all left as \\\"Free\\\".\n\n\"\"\n\n## Fixed Nodes \n\nTo prevent rigid body motion in the plane of sliding, three independent degrees of freedom need to be eliminated. To achieve this, one vertex in the plane of sliding is constrained in x and y direction (eliminating 2 degrees of freedom) and one vertex is fixed in the x direction (eliminating the last degree of freedom). For this purpose two additional FemConstraintDisplacement objects are created and the result is shown below.\n\n\"\"\n\n## Shear Forces \n\nThe final step in the Analysis definition is the application of loads. To create a Simple Shear condition, a set of shear loads is applied as shown below. Each load is chosen as 1000 N and considering the directions of application, force and moment equilibrium is achieved for all translation and rotational degrees of freedom. In FC this requires addition of four FemConstraintForce objects (**Model → Mechanical boundary conditions and loads → Force load**) - one for each face. With the dialog box open first press the Add Reference button and then select the face to which the boundary condition is to be applied (Note: this is a different sequence than with FemConstraintDisplacement). By default, this creates a set of forces perpendicular to the face (i.e. a normal force). To change this to a shear force, press the direction button and select a cube edge that runs in the desired direction. If the resulting force points in opposite direction of what is required, then select the radio button for \\\"Reverse direction\\\".\n\n\"\"\n\n## CalculiX Analysis \n\nNow all mesh regions, material and boundary conditions have been defined we are ready to analyse the deformation of the block with CalculiX. Activate the Analysis by right clicking \\\"Activate analysis\\\", open the CalculiX dialog by double clicking the CalculiXccxTools object and select a directory for the temporary files created by both FC and CCX. Write CCX Input file and check for any warning or error messages.\n\n\"\"\n\nAfter that the analysis can be started by pressing the RunCalculiX button. If all goes well, the CCX output window should show the following messages.\n\n\"\"\n\n## CalculiX Results \n\nUpon completion of the analysis double click the \\\"CalculiX_static_results\\\" object and select the \\\"Abs displacement\\\" option. The maximum displacement of \\~ 0.08mm will show up in the relevant output box. As the maximum displacement is relatively small compared to the dimensions of the block (\\<1% of the block size), the displacements need to be scaled up. This can be done under the heading \\\"Displacement\\\" by ticking the \\\"Show\\\" radio button and scaling the displacement by a factor of -say- 20. The maximum displacement will now be exaggerated to approximately 20% of the box size. After closing the dialog window, the deformed mesh can be made visible again by highlighting the Result_mesh object and pressing the space bar.\n\n\"\"\n\nTo investigate the deformation of the core we have to slice the block. This can be done by creating a clip filter. To activate this functionality, we first need to create a \\\"post processing pipeline\\\" by highlighting the \\\"CalculiX_static_results\\\" object and choosing **Results → Post Pipeline from Result** from the menu. Next, with the Pipeline selected create a Warp Filter (Results → Warp filter), set Vector=Displacement and Value=20 to scale the displacement and Display Mode = \\\"Surface with Edges\\\", Coloring Field = \\\"Displacement\\\", Vector = \\\"Magnitude\\\" to show colored displacement contours. Press Apply and OK. As a final step add a Clip Filter (Results → Clip filter) and create a plane with origin \\[5.0,2.5,5.0\\] and normal \\[0,1,0\\], i.e. at a core face with normal in the y-direction. Tick the \\\"Cut Cells\\\" radio button to create a flat surface. As before set Display Mode = \\\"Surface with Edges\\\", Coloring Field = \\\"Displacement\\\", Vector = \\\"Magnitude\\\" to show colored displacement contours. Press Apply and OK. Finally switch the Warp Filter to invisible to only show the cut block.\n\n\"\"\n\nFrom the result it is clear that the core remains largely undeformed and helps to resist the deformation of the soft matrix (compare the shear angle of the blue colored part to that of the green colored part). What it also highlights though is that under Simple Shear conditions the faces of the composite block do warp, implying that the sliding boundary condition at the base of the cube does provide an undue constraint.\n\n## Further work \n\nThe following challenges may be interesting to take up as a further exercise:\n\n1\\) Correct for the undue constraint imposed by the sliding boundary condition\n\n2\\) Try and create contact boundary conditions between the core and the matrix to see if separation occurs\n\nThe FC file for this tutorial is attached below as a starting point.\n\n\n\nHave fun !\n\n\n{{FEM Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [FEM](Category_FEM.md) > FEM Shear of a Composite Block/en\n"} {"id": "freecad-docs:wiki/translations/en/Fasteners_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Fasteners_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Fasteners_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8374491e794b7c673e04ca0692fb82676fb45b91a1ba0c3c29afb977c8a4476a", "bytes": 33309, "tokens": 13604, "text": "# \"Fasteners Fasteners Workbench/en\n\n\n## Introduction\n\nThe \"\" [Fasteners Workbench](Fasteners_Workbench.md) is an [external workbench](External_workbenches.md) that can add various fasteners to parts.\n\n\"\" \n*The optional single toolbar layout of the workbench.
\nFasteners with metric dimensions have orange icons.
\nFasteners with inch dimensions have green icons.*\n\n## Installation\n\n1. Install the Fasteners Workbench via the \"\" [Addon Manager](Std_AddonMgr.md). For manual installation see [Installing more workbenches](Installing_more_workbenches.md).\n2. Restart FreeCAD.\n3. Select the \"\" [Fasteners Workbench](Fasteners_Workbench.md) from the [Workbench dropdown list](Std_Workbench.md).\n4. Optionally change the toolbar and menu layout:\n 1. Go to: **Edit → Preferences... → Fasteners → General settings**.\n 2. Select one of the available **Toolbar screw icons grouping** options:\n - \n **None**\n \n : All fasteners appear in a single toolbar. To see all available buttons use the **>>** button to expand it.\n\n - \n **Separate toolbars**\n \n : Fasteners are grouped in several toolbars. This is the default layout.\n\n - \n **Dropdown buttons**\n \n : Fasteners are grouped in toolbars with flyouts.\n 3. Optionally uncheck one or more **Fastener standards shown in toolbars** options. Unchecked standards are still available from the menu.\n 4. Restart FreeCAD.\n\n## Usage\n\nFasteners can be attached or unattached. Attached fasteners have a **Base Object**, a circular edge, and their **Placement** is dynamically linked to that object. The \"\" [Fasteners Move](Fasteners_Move.md) command can be used to attach or detach a fastener.\n\n### Unattached fasteners \n\n1. Select the desired fastener by clicking its button or by picking it from the menu.\n2. A fastener is created at the origin.\n3. Optionally change the dimensions and other properties of the fastener:\n 1. Select the fastener.\n 2. Go to the **Data** tab of the [Property editor](Property_editor.md).\n 3. Change the required properties.\n\n### Attached fasteners \n\n\"\" \"\" \n*On the left two selected circular edges. On the right the attached fasteners.*\n\n1. Specify if the selected holes are tap holes or pass holes by selecting \"\" [Fasteners MatchTypeInner](Fasteners_MatchTypeInner.md) or \"\" [Fasteners MatchTypeOuter](Fasteners_MatchTypeOuter.md) respectively (not used for countersunk screws).\n2. Select one or more circular edges and/or faces with circular edges. For countersunk screws the top edge of the chamfered hole must be selected.\n3. Select the desired fastener by clicking its button or by picking it from the menu.\n4. A fastener is attached to each of the selected circular edges.\n5. The default dimensions of each fastener depend on the radius of the circular edge it is attached to. Countersunk screws are matched by their head diameter, other fasteners are matched by their shaft diameter.\n6. Optionally change the dimensions and other properties of the fasteners. See above.\n7. Fasteners that appear upside-down can be inverted with the \"\" [Fasteners Flip](Fasteners_Flip.md) command or by changing their **Invert** property.\n8. Optionally change the **Offset** property to create space between the fasteners and the edges they are attached to.\n\n## Notes\n\n- To generate threads, the **Thread** property of a fastener must be changed to `True`. Generating threads is costly. Recomputes take much longer if there are many fasteners with threads in a document.\n- The **Invert** property and the **Offset** property are ignored for unattached fasteners.\n\n## Commands\n\n- \"\" [Invert fastener](Fasteners_Flip.md): Invert the orientation of attached fasteners.\n\n- \"\" [Move fastener](Fasteners_Move.md): Move and attach a fastener to a circular edge. Can also be used to detach a fastener.\n\n- \"\" [Simplify shape](Fasteners_Simplify.md): Create non-parametric copies of fasteners.\n\n- \"\" [Match for tap hole](Fasteners_MatchTypeInner.md): Consider circular edges to be tap holes when new fasteners are attached to them.\n\n- \"\" [Match for pass hole](Fasteners_MatchTypeOuter.md): Consider circular edges to be pass holes when new fasteners are attached to them.\n\n- \"\" [Generate BOM](Fasteners_BOM.md): Create a spreadsheet with a bill of materials for the fasteners in the document.\n\n- \"\" [Screw calculator](Fasteners_ScrewCalculator.md): Show a calculator to determine the tap hole size of screws.\n\n- \"\" [Change fastener parameters](Fasteners_ChangeParameters.md): Change the parameters of fasteners.\n\n## Fasteners\n\nFasteners with metric dimensions have orange icons. Fasteners with inch dimensions have green icons.\n\n### Hexagon head screws and bolts \n\n- \"\" **ASME B18.2.1.6** UNC hexagon head screw.\n\n- \"\" **ASME B18.2.1.8** UNC hexagon head screw with flange.\n\n- \"\" **DIN 571** Hexagon head wood screw.\n\n- \"\" **DIN 933** Hexagon head screw.\n\n- \"\" **DIN 961** Hexagon head screw.\n\n- \"\" **EN 1662** Hexagon head bolt with flange, small series.\n\n- \"\" **EN 1665** Hexagon head bolt with flange, heavy series.\n\n- \"\" \n**ISO 4014** Hexagon head bolt. *Product grades A and B.*\n\n- \"\" **ISO 4015** Hexagon head bolt with reduced shank.\n\n- \"\" \n**ISO 4016** Hexagon head bolt. *Product grade C.*\n\n- \"\" \n**ISO 4017** Hexagon head screw. *Product grades A and B.*\n\n- \"\" \n**ISO 4018** Hexagon head screw. *Product grade C.*\n\n- \"\" \n**ISO 4162** Hexagon bolt with flange, small series. *Product grade A with driving feature of product grade B.*\n\n- \"\" \n**ISO 8676** Hexagon head screw with fine pitch thread. *Product grades A and B.*\n\n- \"\" **ISO 8765** Hexagon head bolt with fine pitch thread.\n\n- \"\" \n**ISO 15071** Hexagon bolt with flange, small series. *Product grade A.*\n\n- \"\" \n**ISO 15072** Hexagon bolt with flange and fine pitch thread, small series. *Product grade A.*\n\n### Hexagon socket screws \n\n- \"\" **ASME B18.3.1A** UNC hexagon socket head cap screw.\n\n- \"\" **ASME B18.3.1G** UNC hexagon socket head cap screw with low head.\n\n- \"\" **ASME B18.3.2** UNC hexagon socket countersunk head screw.\n\n- \"\" **ASME B18.3.3A** UNC hexagon socket button head screw.\n\n- \"\" **ASME B18.3.3B** UNC hexagon socket button head screw with flange.\n\n- \"\" **ASME B18.3.4** UNC hexagon socket head shoulder screw.\n\n- \"\" **DIN 6912** Hexagon socket head cap screw with low head with center.\n\n- \"\" **DIN 7984** Hexagon socket head cap screw with low head.\n\n- \"\" **ISO 2936** Hexagon socket screw key.\n\n- \"\" **ISO 4762** Hexagon socket head cap screw.\n\n- \"\" **ISO 7379** Hexagon socket head shoulder screw.\n\n- \"\" **ISO 7380-1** Hexagon socket button head screw.\n\n- \"\" **ISO 7380-2** Hexagon socket button head screw with flange.\n\n- \"\" **ISO 10642** Hexagon socket countersunk head screw.\n\n### Hexalobular socket head screws \n\n- \"\" **ISO 14579** Hexalobular socket head cap screw.\n\n- \"\" **ISO 14580** Hexalobular socket cheese head screw.\n\n- \"\" **ISO 14581** Hexalobular socket countersunk flat head screw.\n\n- \"\" **ISO 14582** Hexalobular socket countersunk head screw, high head.\n\n- \"\" **ISO 14583** Hexalobular socket pan head screw.\n\n- \"\" **ISO 14584** Hexalobular socket raised countersunk head screw.\n\n### Slotted head screws \n\n- \"\" **ASME B18.6.1.2** Slotted flat countersunk head wood screw.\n\n- \"\" **ASME B18.6.1.4** Slotted oval countersunk head wood screw.\n\n- \"\" **ASME B18.6.3.1A** UNC slotted countersunk flat head screw.\n\n- \"\" **ASME B18.6.3.4A** UNC slotted oval countersunk head screw.\n\n- \"\" **ASME B18.6.3.9A** UNC slotted pan head screw.\n\n- \"\" **ASME B18.6.3.10A** UNC Slotted fillister head screw.\n\n- \"\" **ASME B18.6.3.12A** UNC Slotted truss head screws.\n\n- \"\" **ASME B18.6.3.16A** UNC Slotted round head screw.\n\n- \"\" \n**DIN 84 (superseded by ISO 1207)** Slotted cheese head screw. *Product grade A.*\n\n- \"\" **DIN 96** Slotted half round head wood screw.\n\n- \"\" **GOST 1144-1** Slotted half round head wood screw.\n\n- \"\" **GOST 1144-2** Slotted half round head wood screw.\n\n- \"\" \n**ISO 1207** Slotted cheese head screw. *Product grade A.*\n\n- \"\" \n**ISO 1580** Slotted pan head screw. *Product grade A.*\n\n- \"\" \n**ISO 2009** Slotted countersunk flat head screw. *Product grade A.*\n\n- \"\" \n**ISO 2010** Slotted raised countersunk head screw. *Product grade A.*\n\n### H cross head screws \n\n- \"\" **ASME B18.6.1.3** Flat countersunk head wood screw.\n\n- \"\" **ASME B18.6.1.5** Oval countersunk head wood screw.\n\n- \"\" **ASME B18.6.3.1B** UNC flat countersunk head screw.\n\n- \"\" **ASME B18.6.3.4B** UNC oval countersunk head screw.\n\n- \"\" **ASME B18.6.3.9B** UNC pan head screw.\n\n- \"\" **ASME B18.6.3.10B** UNC fillister head screw.\n\n- \"\" **ASME B18.6.3.12C** UNC truss head screws.\n\n- \"\" **ASME B18.6.3.16B** UNC round head screw.\n\n- \"\" **DIN 967** Pan head screw with collar.\n\n- \"\" **DIN 7996** Pan head wood screw.\n\n- \"\" **GOST 1144-3** Pan head wood screw.\n\n- \"\" **GOST 1144-4** Pan head wood screw.\n\n- \"\" \n**ISO 7045** Pan head screw. *Product grade A.*\n\n- \"\" \n**ISO 7046** Countersunk flat head screw. *Product grade A.*\n\n- \"\" \n**ISO 7047** Raised countersunk head screw. *Product grade A.*\n\n- \"\" **ISO 7048** Cheese head screw.\n\n- \"\" **ISO 7049-C** Pan head self tapping screws with conical point.\n\n- \"\" **ISO 7049-F** Pan head self tapping screws with flat point.\n\n- \"\" **ISO 7049-R** Pan head self tapping screws with rounded point.\n\n### Other head bolts \n\n- \"\" **ASME B18.2.1.1** UNC square head bolt.\n\n- \"\" **ASME B18.5** UNC Round head square neck bolt.\n\n- \"\" **DIN 478** Square head bolt with collar.\n\n- \"\" **DIN 603** Round head square neck bolt.\n\n- \"\" **ISO 2342** Headless screw with shank\n\n### Set screws \n\n- \"\" **ASME B18.3.5A** UNC hexagon socket set screw with flat point.\n\n- \"\" **ASME B18.3.5B** UNC hexagon socket set screw with cone point.\n\n- \"\" **ASME B18.3.5C** UNC hexagon socket set screw with dog point.\n\n- \"\" **ASME B18.3.5D** UNC hexagon socket set screw with cup point.\n\n- \"\" **ISO 4026** Hexagon socket set screw with flat point.\n\n- \"\" **ISO 4027** Hexagon socket set screw with cone point.\n\n- \"\" **ISO 4028** Hexagon socket set screw with dog point.\n\n- \"\" **ISO 4029** Hexagon socket set screw with cup point.\n\n- \"\" **ISO 4766** Slotted socket set screw with flat point.\n\n- \"\" **ISO 7434** Slotted socket set screw with cone point.\n\n- \"\" **ISO 7435** Slotted socket set screw with long dog point.\n\n- \"\" **ISO 7436** Slotted socket set screw with cup point.\n\n### Thumb screws \n\n- \"\" **DIN 464** Knurled thumb screw, high type.\n\n- \"\" **DIN 465** Slotted knurled thumb screw, high type.\n\n- \"\" **DIN 653** Knurled thumb screw, low type.\n\n### Nuts\n\n- \"\" **ASME B18.2.2.1A** UNC hexagon machine screw nut.\n\n- \"\" **ASME B18.2.2.1B** UNC square machine screw nut.\n\n- \"\" **ASME 18.2.2.2** UNC square nut.\n\n- \"\" **ASME B18.2.2.4A** UNC hexagon nut.\n\n- \"\" **ASME B18.2.2.4B** UNC hexagon thin nut.\n\n- \"\" **ASME 18.2.2.5** UNC hexagon castle nut.\n\n- \"\" **ASME 18.2.2.12** UNC hexagon nut with flange.\n\n- \"\" **ASME 18.2.2.13** UNC hexagon coupling nut.\n\n- \"\" **ASME 18.6.9A** Wing nut, type A.\n\n- \"\" **DIN 315** Wing nut.\n\n- \"\" **DIN 557** Square nut.\n\n- \"\" **DIN 562** Square nut.\n\n- \"\" **DIN 917** Cap nut, low form.\n\n- \"\" **DIN 928** Square weld nut.\n\n- \"\" **DIN 929** Hexagon weld nut.\n\n- \"\" \n**DIN 934 (superseded by ISO 4035 and ISO 8673)** Hexagon thin nut chamfered. *Product grades A and B.*\n\n- \"\" **DIN 935** Hexagon castle nut.\n\n- \"\" **DIN 985** Nyloc nut.\n\n- \"\" **DIN 1587** Cap nut.\n\n- \"\" **DIN 6330** Hexagon nut 1.5d high.\n\n- \"\" **DIN 6331** Hexagon with collar 1.5d high.\n\n- \"\" **DIN 6334** Hexagon coupling nut.\n\n- \"\" **DIN 7967** Self-locking counter nut.\n\n- \"\" **EN 1661** Hexagon nut with flange.\n\n- \"\" **GOST 11860-1** Cap nut.\n\n- \"\" \n**ISO 4032** Hexagon nut, style 1. *Product grades A and B.*\n\n- \"\" \n**ISO 4033** Hexagon high nut, style 2. *Product grades A and B.*\n\n- \"\" **ISO 4034** Hexagon nut, style 1.\n\n- \"\" \n**ISO 4035** Hexagon thin nut chamfered, style 0. *Product grades A and B.*\n\n- \"\" **ISO 4161** Hexagon nut with flange.\n\n- \"\" **ISO 7040** Prevailing torque type hexagon nut (with non-metallic insert).\n\n- \"\" **ISO 7041** Prevailing torque type hexagon nut (with non-metallic insert), style 2.\n\n- \"\" **ISO 7043** Prevailing torque type hexagon nut with flange (with non-metallic insert).\n\n- \"\" **ISO 7044** Prevailing torque type all-metal hexagon nut with flange.\n\n- \"\" **ISO 7719** Prevailing torque type all-metal hexagon nut.\n\n- \"\" **ISO 7720** Prevailing torque type all-metal hexagon nut, style 2.\n\n- \"\" \n**ISO 8673** Hexagon nut with fine pitch thread, style 1. *Product grades A and B.*\n\n- \"\" \n**ISO 8674** Hexagon high nut with fine pitch thread, style 2. *Product grades A and B.*\n\n- \"\" \n**ISO 8675** Hexagon thin nut with fine pitch thread, style 0. *Product grades A and B.*\n\n- \"\" **ISO 10511** Prevailing torque type hexagon thin nut (with non-metallic insert).\n\n- \"\" **ISO 10512** Prevailing torque type hexagon nut with fine pitch thread (with non-metallic insert).\n\n- \"\" **ISO 10513** Prevailing torque type all-metal hexagon nut with fine pitch thread.\n\n- \"\" **ISO 10663** Hexagon nut with flange and fine pitch thread.\n\n- \"\" **ISO 12125** Prevailing torque type hexagon nut with flange and fine pitch thread (with non-metallic insert).\n\n- \"\" **ISO 12126** Prevailing torque type all-metal hexagon nut with flange and fine pitch thread.\n\n- \"\" **ISO 21670** Hexagon weld nut with flange.\n\n- \"\" **SAE J483a 1** Low cap nut.\n\n- \"\" **SAE J483a 2** High cap nut.\n\n### T-slot fasteners \n\n- \"\" **DIN 508** T-slot nut.\n\n- \"\" **GN 505** Serrated quarter-turn T-slot nut.\n\n- \"\" **GN 505.4** Serrated T-slot bolt.\n\n- \"\" **GN 506** T-Slot swivel nut.\n\n- \"\" **GN 507** T-slot nut.\n\n- \"\" **ISO 299** T-Slot nut.\n\n### Washers\n\n- \"\" **ASME B18.21.1.12A** UN washer, narrow series.\n\n- \"\" **ASME B18.21.1.12B** UN washer, regular series.\n\n- \"\" **ASME B18.21.1.12C** UN washer, wide series.\n\n- \"\" **DIN 6319C** Spherical washer.\n\n- \"\" **DIN 6319D** Conical seat.\n\n- \"\" **DIN 6319G** Conical seat.\n\n- \"\" **DIN 6340** Washer for clamping devices.\n\n- \"\" \n**ISO 7089** Plain washer, normal series. *Product grade A.*\n\n- \"\" \n**ISO 7090** Plain washer chamfered, normal series. *Product grade A.*\n\n- \"\" \n**ISO 7092** Plain washer, small series. *Product grade A.*\n\n- \"\" \n**ISO 7093-1** Plain washer, large series. *Product grade A.*\n\n- \"\" \n**ISO 7094** Plain washer, extra large series. *Product grade C.*\n\n- \"\" **ISO 8738** Plain washer for clevis pins.\n\n- \"\" **NFE27-619** Countersunk washer.\n\n### Rods, taps and dies \n\n- \"\" Inch threaded rod for tapping holes.\n\n- \"\" Tool object for cutting external inch threads.\n\n- \"\" UNC inch threaded rod.\n\n- \"\" DIN 975 metric threaded rod.\n\n- \"\" Metric threaded rod for tapping holes.\n\n- \"\" Tool object for cutting external metric threads.\n\n### Inserts\n\n- \"\" Heat staked insert.\n\n- \"\" Self-clinching nut.\n\n- \"\" Self-clinching standoff.\n\n- \"\" Self-clinching stud.\n\n- \"\" PCB spacer female/female.\n\n- \"\" PCB standoff female/male.\n\n- \"\" 4 prong threaded wood insert (DIN 1624 Tee nuts).\n\n### Retaining rings \n\n- \"\" **DIN 471** External retaining ring.\n\n- \"\" **DIN 472** Internal retaining ring.\n\n- \"\" **DIN 6799** E-clip retaining ring.\n\n### Nails\n\n- \"\" **DIN 1143** Round plain head nail for use in automatic nailing machines.\n\n- \"\" **DIN 1144-A** Nail for the installation of wood wool composite panels, 20mm round head.\n\n- \"\" **DIN 1151-A** Round plain head wire nail.\n\n- \"\" **DIN 1151-B** Round countersunk head wire nail.\n\n- \"\" **DIN 1152** Round lost head wire nail.\n\n- \"\" **DIN 1160-A** Clout or slate nail.\n\n- \"\" **DIN 1160-B** Clout or slate wide head nail.\n\n### Pins\n\n- \"\" **ISO 1234** Split pin.\n\n- \"\" **ISO 2338** Parallel pin.\n\n- \"\" **ISO 2339** Taper pin.\n\n- \"\" **ISO 2340A** Clevis pin.\n\n- \"\" **ISO 2340B** Clevis pin without head (with split pin holes).\n\n- \"\" **ISO 2341A** Clevis pin with head.\n\n- \"\" **ISO 2341B** Clevis pin with head (with split pin hole).\n\n- \"\" **ISO 8733** Parallel pin with internal thread, unhardened.\n\n- \"\" **ISO 8734** Dowel pin.\n\n- \"\" **ISO 8735** Parallel pin with internal thread, hardened.\n\n- \"\" **ISO 8736** Taper pin with internal thread, unhardened.\n\n- \"\" **ISO 8737** Taper pin with external thread, unhardened.\n\n- \"\" **ISO 8739** Full-length grooved pin with pilot.\n\n- \"\" **ISO 8740** Full-length grooved pin with chamfer.\n\n- \"\" **ISO 8741** Half-length reverse taper grooved pin.\n\n- \"\" **ISO 8742** Third-length center grooved pin.\n\n- \"\" **ISO 8743** Half-length center grooved pin.\n\n- \"\" **ISO 8744** Full-length taper grooved pin.\n\n- \"\" **ISO 8745** Half-length taper grooved pin.\n\n- \"\" **ISO 8746** Grooved pin with round head.\n\n- \"\" **ISO 8747** Grooved pin with countersunk head.\n\n- \"\" **ISO 8748** Coiled spring pin, heavy duty.\n\n- \"\" **ISO 8750** Coiled spring pin, standard duty.\n\n- \"\" **ISO 8751** Coiled spring pin, light duty.\n\n- \"\" **ISO 8752** Slotted spring pin, heavy duty.\n\n- \"\" **ISO 13337** Slotted spring pin, light duty.\n\n## Obsolete\n\n- \"\" [Make countersunk](Fasteners_ChamferHole.md): Chamfer holes for countersunk screws. Not available in (v0.5.13) .\n\n## References\n\n- Author: [shaise](http://theseger.com/projects/author/shaise/)\n - ScrewMaker: Ulrich Brammer\n - Workbench wrapper: Shai Seger\n- Source code: \n- Bug reports and feature requests: \n- Forum topic: \n\n## Links\n\n- [BOLTS](https://github.com/jreinhardt/BOLTS): An open library for technical specifications.\n\n\n{{Fasteners_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [User_Documentation](Category_User_Documentation.md) > [External_Workbenches](Category_External_Workbenches.md) > [Fasteners](Category_Fasteners.md) > Fasteners Workbench/en\n"} {"id": "freecad-docs:wiki/translations/en/FreeCAD_API.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/FreeCAD_API.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/FreeCAD_API.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a3d37a817e4e16d7c51109168279d641c6c6f284201e421196253c991dce6cbf", "bytes": 3659, "tokens": 1001, "text": "# FreeCAD API/en\n**(October 2019) Do not edit this page. The information is incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation], or generate the documentation yourself, see [Source documentation](Source_documentation.md).**\n\nThis is the principal (root) module of FreeCAD. It can also be called by \\\"App\\\" from the FreeCAD interpreter. It contains everything that is needed to manipulate documents and their contents (objects).\n\nExample: \n```python\nimport FreeCAD\nprint FreeCAD.listDocuments()\nmydoc = FreeCAD.activeDocument()\n```\n\n\n{{APIFunction|ConfigDump| |Prints a dictionary containing all the FreeCAD configuration environment.| }}\n\n\n{{APIFunction|ConfigGet|[string]|Returns the value of the given key. If no key is given, the complete configuration is returned|A string.}}\n\n\n{{APIFunction|ConfigSet|string, string|Set the given key (first string) to the given value (second string).| }}\n\n\n{{APIFunction|Version| |Prints the FreeCAD version.| }}\n\n\n{{APIFunction|activeDocument| |Return the active document or None if there is no active document.|A FreeCAD Document.}}\n\n\n{{APIFunction|addExportType|string, string|Adds a new export file type to FreeCAD. The first string must be formatted like this example: \"Word Document (*.doc)\". The second string is the name of a python script/module containing an export() function.| }}\n\n\n{{APIFunction|addImportType|string, string|Adds a new import file type to FreeCAD, works the same way as addExportType, the handling python module must contain an open() and/or an import() function.| }}\n\n\n{{APIFunction|closeDocument|Document name|Closes the given document| }}\n\n\n{{APIFunction|getDocument|Document name|Returns a document or raise an exception if there is no document with the given name.| }}\n\n\n{{APIFunction|getExportType|string|Returns the name of the module that can export the specified filetype.| A string.}}\n\n\n{{APIFunction|getImportType|string|Returns the name of the module that can import the specified filetype.|A string.}}\n\n\n{{APIFunction|listDocuments| |Returns a dictionary of names and object pointers of all documents.|A dictionary of names and object pointers.}}\n\n\n{{APIFunction|newDocument|[string], [hidden=False]|Creates and returns a new document with a given name. The document name must be unique, which is checked automatically. If no name is supplied, the document will be named \"Untitled\". If hidden=True is passed, then FreeCAD in GUI mode won't display the document and won't show a tab for the document; this allows performing automatic operations on a temporary document (or create a document and save it) without disrupting the user interface.|The newly created document.}}\n\n\n{{APIFunction|open|string|See openDocument| }}\n\n\n{{APIFunction|openDocument|filepath, [hidden]|Creates and returns a document and load a project file into the document. The string argument must point to an existing file. If the file doesn't exist or the file cannot be loaded an I/O exception is thrown. In this case the created document is kept, but will be empty. If hidden=True is passed, then FreeCAD in GUI mode won't display the document and won't show a tab for the document; this allows performing automatic operations on a document and close it without disrupting the user interface.|The opened FreeCAD Document.}}\n\n\n{{APIFunction|setActiveDocument|Document name|Set the active document by its name.| }}\n\n\n---\n⏵ [documentation index](../README.md) > [API](Category_API.md) > [Poweruser Documentation](Category_Poweruser%20Documentation.md) > FreeCAD API/en\n"} {"id": "freecad-docs:wiki/translations/en/FreeGrid_StorageGrid.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/FreeGrid_StorageGrid.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/FreeGrid_StorageGrid.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "024179a4b2625c8a96f09cd99d2fa061f59db77d92bd959ddd8c6d6804060eba", "bytes": 2265, "tokens": 725, "text": "---\n GuiCommand:\n Name: FreeGrid StorageGrid\n MenuLocation: FreeeGrid , Storage grid\n Workbenches: FreeGrid_Workbench\n Version: \n SeeAlso: \n---\n\n# FreeGrid StorageGrid/en\n\n## Description\n\nThe [FreeGrid StorageGrid](FreeGrid_StorageGrid.md) tool creates a storage grid.\n\nThis tool is part of the [FreeGrid Workbench](FreeGrid_Workbench.md), an [external workbench](External_workbenches.md) that can be installed with the \"\" [Addon Manager](Std_AddonMgr.md).\n\n## Usage\n\n1. There are several ways to invoke the tool:\n - Press the ** [Storage grid](FreeGrid_StorageGrid.md)** button.\n - Select the **FreeGrid → Storage grid** option from the menu.\n2. A storage grid is created with properties based on the current preferences.\n3. Optionally select the object and change its properties in the [Property editor](Property_editor.md).\n\n## Properties\n\nA FreeGrid StorageBox object is derived from a [Part Feature](Part_Feature.md) object and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{Properties_Title|Grid features}}\n\n- **Corner Connectors|Bool**: Default is `True`. Add cavities for corner connectors.\n\n- **Extra Bottom Material|Length**: Default is {{Value|16 mm}}. Extra thickness under the grid.\n\n- **Is Subtractive|Bool**: Default is `False`. Create a grid suitable for subtractive manufacturing.\n\n\n{{Properties_Title|Magnet mount}}\n\n- **Include Magnets|Bool**: Default is `True`. Include magnet receptacles.\n\n- **Magnet Diameter|Length**: Default is {{Value|6 mm}}. Diameter of the magnets.\n\n- **Magnet Height|Length**: Default is {{Value|2 mm}}. Height of the magnets.\n\n\n{{Properties_Title|Size}}\n\n- **Depth|IntegerConstraint**: Default is {{Value|2}}. Number of 50 mm units in the Y direction of the object.\n\n- **Width|IntegerConstraint**: Default is {{Value|3}}. Number of 50 mm units in the X direction of the object.\n\n\n---\n⏵ [documentation index](../README.md) > [External_Command_Reference](Category_External_Command_Reference.md) > [FreeGrid](Category_FreeGrid.md) > FreeGrid StorageGrid/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_Cabinets32.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_Cabinets32.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_Cabinets32.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "046433b437b9719d6db671752cc06cbf9d9055e9973bbba31ae7521cf0b2dfa0", "bytes": 19643, "tokens": 6743, "text": "# Macro Cabinets32/en\n{{Macro\n|Name=Cabinets32\n|Icon=Macro_Cabinets32.png\n|Description=This macro creates Top/Bottom and sidewalls for a cabinet with System32 specification.\nThe defaults in the Macro are for parts of manufacturer Hettich.\n|Author=Berner\n|Version=1.0\n|Date=2015-01-22\n|FCVersion=All\n|Download=[https://www.freecadweb.org/wiki/images/6/64/Macro_Cabinets32.png ToolBar Icon]\n}}\n\n## Description\n\nThis macro creates Top/Bottom and sidewalls for a cabinet with System32 specification. The defaults in the Macro are for parts of manufacturer Hettich.\n\n\"\" \n*cabinetside*\n\n\"\" \n*cabinettop*\n\n## Usage\n\n- Launch the macro and change length, height and width of your cabinet-board.\n- The Gui ask to drill one or two-hole connectors.\n- You can drill the hole board with holes in 32 mm distance.\n- You can drill holes for top/bottom boards of your cabinet.\n\n## Script\n\nToolBar Icon ![](images/Macro_Cabinets32.png )\n\n**Cabinets32.FCMacro**\n\n\n{{MacroCode|code=\n\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# ***************************************************************************\n# * *\n# * Copyright (c) 2015 Bruno Bueckmann reset12 at gmx.de *\n# * http://home.bb-24.net *\n# * This program is free software; you can redistribute it and/or modify *\n# * it under the terms of the GNU Lesser General Public License (LGPL) *\n# * as published by the Free Software Foundation; either version 2 of *\n# * the License, or (at your option) any later version. *\n# * for detail see the LICENCE text file. *\n# * *\n# * This program is distributed in the hope that it will be useful, *\n# * but WITHOUT ANY WARRANTY; without even the implied warranty of *\n# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n# * GNU Library General Public License for more details. *\n# * *\n# * You should have received a copy of the GNU Library General Public *\n# * License along with this program; if not, write to the Free Software *\n# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n# * USA *\n# * *\n# ***************************************************************************\n\n\n# Macro Begin: cabinets32.FCMacro ++++++++++++++++++++++++++++++++++++++++++++++\n# This Macro generates holes and a groove for the side Base cabinet\n# Top and Bottom Wall are OUTSIDE the side base\n# like :\n# \n# | |\n# | |\n# \n\nfrom __future__ import division\n\nimport FreeCAD as App\nimport FreeCADGui as Gui\nfrom PySide import QtGui\n\n# GUI\ndebug = False # debugging on\nguiok = True # flag for abort input\n\nwidth, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Thickness', 'Thickness of cabinet-side', 19, 0, 50, 2)\nif ok:\n length, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Depth', 'Depth of cabinet-side', 600, 0, 2000, 2)\nelse:\n guiok = False\n\nif ok and guiok:\n height, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Height', 'Height of cabinet-side', 2000, 0, 3000, 2)\nelse:\n guiok = False\n\nif ok and guiok:\n bradius, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Bradius', 'Radius of drill holes in cabinet-side',\n 2.5, 0, 50, 2)\nelse:\n guiok = False\n\nif ok:\n bdeep, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Bdeep', 'Depth of drill holes in cabinet-side',\n 12, 0, 50, 2)\nelse:\n guiok = False\n\nif ok:\n fdist, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Fdist', 'Distance to Front of cabinet-side',\n 37, 0, 50, 2)\nelse:\n guiok = False\n\nif ok:\n hole1, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Hole1',\n 'Distance first hole from top or bottom of cabinet-side', 10, 0, 50, 2)\nelse:\n guiok = False\n\nif ok:\n holedistance, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Holedistance',\n 'Distance from hole to hole (System 32)', 32, 1, 50, 2)\nelse:\n guiok = False\n\nif ok:\n groovethickness, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Groovethickness', 'Thickness of backpanel',\n 3, 1, 50, 2)\nelse:\n guiok = False\n\nif ok:\n groovedeep, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Groovedeep',\n 'Overlapping of backpanel in cabinet-side', 12, 1, 50, 2)\nelse:\n guiok = False\n\nif guiok:\n # VB 35 / 18 or VB 36 M /19 from Hettich\n connector, ok = QtGui.QInputDialog.getInt(\n QtGui.QWidget(), 'Connectortype',\n 'Zerohole(0) Singlehole(1) or Doublehole(2) Connector', 2, 0, 2, 1)\n\nif ok:\n fillwithholes, ok = QtGui.QInputDialog.getItem(None,\n \"Fillwithholes\",\n \"Fill Board with holes?\",\n [\"no\", \"yes\"],\n editable=False)\nelse:\n guiok = False\n\nendhole = 9.5\n\nif ok and guiok:\n endholes, ok = QtGui.QInputDialog.getItem(None,\n \"Endholes\",\n \"Drill Holes on Top/Bottom vertical for Connectors\",\n ['no', 'yes'],\n editable=False)\n\nif ok and guiok and endholes == 'yes':\n endhole, ok = QtGui.QInputDialog.getDouble(\n QtGui.QWidget(), 'Endhole',\n 'Endhole distance from inner cabinet-side', 9.5, 1, 50, 2)\nif debug:\n App.Console.PrintMessage(\"ok?: {}\\n\".format(ok))\n App.Console.PrintMessage(\"width = {}\\n\".format(width))\n App.Console.PrintMessage(\"length = {}\\n\".format(length))\n App.Console.PrintMessage(\"bradius = {}\\n\".format(bradius))\n App.Console.PrintMessage(\"bdeep = {}\\n\".format(bdeep))\n App.Console.PrintMessage(\"fdist = {}\\n\".format(fdist))\n App.Console.PrintMessage(\"hole1 = {}\\n\".format(hole1))\n App.Console.PrintMessage(\"holedistance = {}\\n\".format(holedistance))\n App.Console.PrintMessage(\"groovethickness = {}\\n\".format(groovethickness))\n App.Console.PrintMessage(\"groovedeep = {}\\n\".format(groovedeep))\n App.Console.PrintMessage(\"connector = {}\\n\".format(connector))\n App.Console.PrintMessage(\"fillwithholes = {}\\n\".format(fillwithholes))\n App.Console.PrintMessage(\"endholes = {}\\n\".format(endholes))\n App.Console.PrintMessage(\"endhole = {}\\n\".format(endhole))\n App.Console.PrintMessage(\"guiok = {}\\n\".format(guiok))\n# End GUI\n\nif guiok:\n # width= 19 # thickness of korpus\n # length= 600 # width of korpus\n # height= 2000 # height of korpus\n #\n # bradius = 2.5 # Radius drill hole\n # bdeep = 12 # deepness of drill hole\n # fdist = 37 # Distance to Front\n # hole1 = 9.5 # Distance first hole from top or bottom of korpus\n # holedistance = 32 # System 32\n # groovethickness = 3 # 3 mm backpanel\n # groovedeep = width-8 # deep of groovedeep\n if int(width) > 16:\n # First hole depends on specs for VB36 M / 19 for 19 mm boards from\n # Hettich.\n holetop = 9.5 # holedistance for screw of vb36\n hole1 = 9.5 + 0.5 # distance hole 1 from end of board\n hole1r = 10 # radius first hole\n hole1d = 14 # deepness first hole\n hole2r = 5 # radius 2. hole\n hole2d = 10.5 # deepness 2. hole\n else:\n # First hole depends on specs for VB36 M / 16 for 16 mm boards from\n # Hettich.\n holetop = 9.5 # holedistance for screw of vb36\n hole1 = 9.5 + 0.5 # distance hole 1 from end of board\n hole1r = 10 # radius first hole\n hole1d = 12.5 # deepness first hole\n hole2r = 5 # radius 2. hole\n hole2d = 10.5 # deepness 2. hole\n\n if debug:\n App.Console.PrintMessage(\"hole1d = {}\\n\".format(hole1d))\n\n # functions\n def cut(tool):\n global cutsnr\n global cuts\n # cuts objects defined in string cuts\n if debug:\n App.Console.PrintMessage(\"cuts = {}, cutsnr = {}\\n\".format(\n cuts, cutsnr))\n data = 'App.activeDocument().addObject(\"Part::Cut\",\"' + str(cuts.split(\" \")[cutsnr + 1]) + '\")'\n if debug:\n App.Console.PrintMessage(str(data) + \"\\n\")\n exec(data)\n data = \"App.activeDocument().\" + str(cuts.split(\" \")[cutsnr + 1])\n data = data + \".Base = App.activeDocument().\" + str(cuts.split(\" \")[cutsnr])\n if debug:\n App.Console.PrintMessage(str(data) + \"\\n\")\n exec(data)\n data = \"App.activeDocument().\" + str(cuts.split(\" \")[cutsnr + 1])\n data = data + \".Tool = App.activeDocument().\" + str(tool)\n if debug:\n App.Console.PrintMessage(str(data) + \"\\n\")\n exec(data)\n cutsnr = cutsnr + 1\n cuts = cuts + \" Cut%03d\" % cutsnr\n return 0\n\n # end functions\n\n doc = App.activeDocument()\n\n # Korpus\n box = doc.addObject(\"Part::Box\", \"Box\")\n box.Label = \"Cube\"\n box.Length = length\n box.Width = width\n box.Height = height\n # Change Color of Object.\n box.ViewObject.DiffuseColor = (0.67, 0.67, 0.0)\n if debug:\n doc.recompute()\n # Groove\n groove = doc.addObject(\"Part::Box\", \"Groove\")\n groove.Label = \"Groove\"\n groove.Length = groovethickness\n groove.Width = groovedeep\n groove.Height = height - (2 * groovedeep)\n groove.ViewObject.DiffuseColor = (0.67, 0.67, 0.0)\n groove.Placement = App.Placement(\n App.Vector(length - groovethickness, 0, groovedeep),\n App.Rotation())\n if debug:\n doc.recompute()\n\n # make endholes\n cylinders = \"\" # labels of cylinders to cut\n if endholes == 'y':\n # Bottom holes\n cylendl = doc.addObject(\"Part::Cylinder\", \"Cylinderendl\")\n cylendl.Label = \"Cylinderendl001\"\n cylendl.Radius = bradius\n cylendl.Height = bdeep\n cylendl.Angle = 360\n cylinders = cylinders + \" \" + cylendl.Name\n cylendl.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n doc.ActiveObject.Placement = App.Placement(\n App.Vector(fdist, bdeep, holetop),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n cylendr = doc.addObject(\"Part::Cylinder\", \"Cylinderendr\")\n cylendr.Label = \"Cylinderendr001\"\n cylendr.Radius = bradius\n cylendr.Height = bdeep\n cylendr.Angle = 360\n cylinders = cylinders + \" \" + cylendr.Name\n cylendr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylendr.Placement = App.Placement(\n App.Vector(length - fdist, bdeep, holetop),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n # Top holes\n cylendl = doc.addObject(\"Part::Cylinder\", \"Cylinderendl\")\n cylendl.Label = \"Cylinderendl002\"\n cylendl.Radius = bradius\n cylendl.Height = bdeep\n cylendl.Angle = 360\n cylinders = cylinders + \" \" + cylendl.Name\n cylendl.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylendl.Placement = App.Placement(\n App.Vector(fdist, bdeep, height - holetop),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n cylendr = doc.addObject(\"Part::Cylinder\", \"Cylinderendr\")\n cylendr.Label = \"Cylinderendr002\"\n cylendr.Radius = bradius\n cylendr.Height = bdeep\n cylendr.Angle = 360\n cylinders = cylinders + \" \" + cylendr.Name\n cylendr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylendr.Placement = App.Placement(\n App.Vector(length - fdist, bdeep, height-holetop),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n if fillwithholes == 'no':\n n = 0\n else:\n n = int(height / 2 / holedistance)\n\n # drill holes from bottom to half height\n # reduce holes for test to 2 alternative use n\n # Holes for Hettich VB36\n # Bohrloecher\n x = -1 # init value\n if connector >= 1:\n x = 0\n App.Console.PrintMessage(\"x=\"+str(x) + \" \" + \"\\n\")\n cyll = doc.addObject(\"Part::Cylinder\", \"Cylinderl\")\n cyll.Label = \"Cylinderl%03d\" % x\n cyll.Radius = hole1r\n cyll.Height = hole1d\n cyll.Angle = 360\n cylinders = cylinders + \" \" + cyll.Name\n cyll.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cyll.Placement = App.Placement(\n App.Vector(fdist, hole1d, hole1 + x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n cylr = doc.addObject(\"Part::Cylinder\", \"Cylinderr\")\n cylr.Label = \"Cylinderr%03d\" % x\n cylr.Radius = hole1r\n cylr.Height = hole1d\n cylr.Angle = 360\n cylinders = cylinders + \" \" + cylr.Name\n cylr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylr.Placement = App.Placement(\n App.Vector(length - fdist, hole1d, hole1 + x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n\n if connector == 2:\n x = 1\n cyll = doc.addObject(\"Part::Cylinder\", \"Cylinderl\")\n cyll.Label = \"Cylinderl%03d\" % x\n cyll.Radius = hole2r\n cyll.Height = hole2d\n cyll.Angle = 360\n cylinders = cylinders + \" \" + cyll.Name\n cyll.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cyll.Placement = App.Placement(\n App.Vector(fdist, hole2d, hole1 + x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n cylr = doc.addObject(\"Part::Cylinder\", \"Cylinderr\")\n cylr.Label = \"Cylinderr%03d\" % x\n cylr.Radius = hole2r\n cylr.Height = hole2d\n cylr.Angle = 360\n cylinders = cylinders + \" \" + cylr.Name\n cylr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylr.Placement = App.Placement(\n App.Vector(length - fdist, hole2d, hole1 + x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n xs = x + 1\n for x in range(xs, n):\n # Bohrloecher\n cyll = doc.addObject(\"Part::Cylinder\", \"Cylinderl\")\n cyll.Label = \"Cylinderl%03d\" % x\n cyll.Radius = bradius\n cyll.Height = bdeep\n cyll.Angle = 360\n cylinders = cylinders + \" \" + cyll.Name\n cyll.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cyll.Placement = App.Placement(\n App.Vector(fdist, bdeep, hole1 + x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n cylr = doc.addObject(\"Part::Cylinder\", \"Cylinderr\")\n cylr.Label = \"Cylinderr%03d\" % x\n cylr.Radius = bradius\n cylr.Height = bdeep\n cylr.Angle = 360\n cylinders = cylinders + \" \" + cylr.Name\n cylr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylr.Placement = App.Placement(\n App.Vector(length - fdist, bdeep, hole1 + x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n # drill holes from Top to half height\n # # Holes for Hettich VB36\n x = -1 # init value\n if connector >= 1:\n x = 0\n cyll = doc.addObject(\"Part::Cylinder\", \"Cylinderl\")\n cyll.Label = \"Cylinderl%03d\" % x\n cyll.Radius = hole1r\n cyll.Height = hole1d\n cyll.Angle = 360\n cylinders = cylinders + \" \" + cyll.Name\n cyll.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cyll.Placement = App.Placement(\n App.Vector(fdist, hole1d, height - hole1 - x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n cylr = doc.addObject(\"Part::Cylinder\", \"Cylinderr\")\n cylr.Label = \"Cylinderr%03d\" % x\n cylr.Radius = hole1r\n cylr.Height = hole1d\n cylr.Angle = 360\n cylinders = cylinders + \" \" + cylr.Name\n cylr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylr.Placement = App.Placement(\n App.Vector(length - fdist, hole1d, height-hole1 - x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n if connector == 2:\n x = 1\n cyll = doc.addObject(\"Part::Cylinder\", \"Cylinderl\")\n cyll.Label = \"Cylinderl%03d\" % x\n cyll.Radius = hole2r\n cyll.Height = hole2d\n cyll.Angle = 360\n cylinders = cylinders + \" \" + cyll.Name\n cyll.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cyll.Placement = App.Placement(\n App.Vector(fdist, hole2d, height - hole1 - x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n cylr = doc.addObject(\"Part::Cylinder\", \"Cylinderr\")\n cylr.Label = \"Cylinderr%03d\" % x\n cylr.Radius = hole2r\n cylr.Height = hole2d\n cylr.Angle = 360\n cylinders = cylinders + \" \" + cylr.Name\n cylr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylr.Placement = App.Placement(\n App.Vector(\n length - fdist, hole2d, height - hole1 - x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n xs = x + 1\n for x in range(xs, n):\n # Drillholes\n cyll = doc.addObject(\"Part::Cylinder\", \"Cylinderl\")\n cyll.Label = \"Cylinderl%03d\" % x\n cyll.Radius = bradius\n cyll.Height = bdeep\n cyll.Angle = 360\n cylinders = cylinders + \" \" + cyll.Name\n cyll.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cyll.Placement = App.Placement(\n App.Vector(fdist, bdeep, height - hole1 - x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n cylr = doc.addObject(\"Part::Cylinder\", \"Cylinderr\")\n cylr.Label = \"Cylinderr%03d\" % x\n cylr.Radius = bradius\n cylr.Height = bdeep\n cylr.Angle = 360\n cylinders = cylinders + \" \" + cylr.Name\n cylr.ViewObject.DiffuseColor = (0.0, 0.0, 0.0)\n cylr.Placement = App.Placement(\n App.Vector(\n length - fdist, bdeep, height - hole1 - x * holedistance),\n App.Rotation(App.Vector(1, 0, 0), 90))\n if debug:\n doc.recompute()\n\n if debug:\n App.Console.PrintMessage(\"cylinders = \")\n App.Console.PrintMessage(cylinders + \"\\n\")\n\n # cut all holes\n cuts = \"Box Cut\" # cut labels\n cutsnr = 0 # index number in cuts\n # cut groove\n cut(\"Groove\")\n cyls = cylinders.split() # number of words\n if debug:\n App.Console.PrintMessage(\"n=\" + str(cyls) + \"\\n\")\n for x in cyls:\n if debug:\n App.Console.PrintMessage(\"cylinder(\" + x + \")=\" + str(x) + \"\\n\")\n cut(str(x))\n doc.recompute()\n Gui.SendMsgToActiveView('ViewFit')\n\n# OS: Ubuntu 14.04.1 LTS\n# Word size of OS: 32-bit\n# Word size of FreeCAD: 32-bit\n# Version: 0.15.4410 (Git)\n# Branch: master\n# Hash: 9ee08a97ea81304e2690694f76ee2dc013556a5d\n# Python version: 2.7.6\n# Qt version: 4.8.6\n# Coin version: 4.0.0a\n\n}}\n\n## Links\n\n- [Macro_PartsLibrary](Macro_PartsLibrary.md) FreeCAD Library\n\n\n---\n⏵ [documentation index](../README.md) > Macro Cabinets32/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_FC_Convert_Lines.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_FC_Convert_Lines.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_FC_Convert_Lines.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a59eab79b7ab3b2b0d33d4d5a779857ef6a36bcc407216cd60d857401c574428", "bytes": 8517, "tokens": 2876, "text": "# Macro FC Convert Lines/en\n{{Macro\n|Name=Macro FC Convert Lines\n|Icon=Macro_FCConvertLines.png\n|Description=This macro convert the object line, wire in line Dash, DashDot or DashDotDot with the dimensions given.\n|Author=mario52\n|Version=00.07b\n|Date=2020-11-09\n|FCVersion=All\n|Download=[https://www.freecadweb.org/wiki/images/e/e2/Macro_FCConvertLines.png ToolBar Icon]\n}}\n\n## Description\n\nThis macro convert the object line, wire in line Dash, DashDot, DashDotDot, ZigZag, Hand with the dimensions given. {{Codeextralink|https://gist.githubusercontent.com/mario52a/3d719574089a5f9044ec/raw/812769b6b296a1da2e9c8cd8153ad7266fe80f8d/Macro_FCConvertLines.FCMacro}}\n\n\"\" \n*ConvertLines Dash, Dash dot, Dash dot dot*\n\n## Usage\n\nCopy the macro in your macros folder and launch FCConvertLines Gui\n\n![FCConvertLines Gui](images/Macro_FCConvertLines_01.png )\n\n\nFirst section :\n\nCut line (Checked by default) ![FCConvertLines](images/Macro_FCConvertLines_02.png )\n\n- Select one or more lines in the 3D View\n- **SpinBox** : for enter number Cuts or cut to length \\... (Default number cut suffix displayed \\\"x Cut\\\")\n- **Create L.** : if this checkbox is checked the line is created\n- **Dimension** : if this checkbox is checked the number tipped is on length the definition change by tree decimal and the suffix displayed is \\\"x.000 Dim\\\"\n- **Bicolor** : if this checkbox is checked the lines created are colored alternately Red White if is not checked the color is the color defined with the button **Color**\n- **Points** : if this checkbox is checked one point is created and the color is the color defined Bicolor or \\* The options **Options lines** are available\n\nColor \n\nSecond section :\n\nType line : Dash ![FCConvertLines](images/Macro_FCConvertLines_03.png )\n\n- The screen at the bottom of the macro change in line Dash\n- Select one or more lines in the 3D View\n- **Line A** : dimension of the dash (see **A** in the screen)\n- **Space B** : dimension of the space (see **B** in the screen)\n- The lines have created the configuration specifications set in options lines\n\n\nThird section :\n\nType line : DashDot ![FCConvertLines](images/Macro_FCConvertLines_04.png )\n\n- The screen at the bottom of the macro change in line DashDot\n- Select one or more lines in the 3D View\n- **Line A** : dimension of the dash (see **A** in the screen)\n- **Space B** : dimension of the space (see **B** in the screen) (May be different D)\n- **Line 2 C** : dimension of the dash (see **C** in the screen)\n- **Space 2 D** : dimension of the space (see **D** in the screen) (May be different B)\n\n\nFourth section :\n\nType line : DashDotDot ![FCConvertLines](images/Macro_FCConvertLines_05.png )\n\n- The screen at the bottom of the macro change in line DashDotDot\n- Select one or more lines in the 3D View\n- **Line A** : dimension of the dash (see **A** in the screen)\n- **Space B** : dimension of the space (see **B** in the screen)\n- **Line 2 C** : dimension of the dash (see **C** in the screen)\n- **Space 2 D** : dimension of the space (see **D** in the screen)\n\n\nFifth section :\n\nType line : ZigZag ![FCConvertLines](images/Macro_FCConvertLines_06.png )\n\n- The screen at the bottom of the macro change in line ZigZag\n- This line are created\n- **Number heads** : number of heads for the total line\n- ****_____140.0_____**** : The length total of the line are calculate in real time and displayed in this window\n- **Begin A** : dimension of begin line until first head, this section line hare same in the end line (see **A** in the screen)\n- **Dimension B** : dimension between the end and begin head (see **B** in the screen)\n- **Gap C** : dimension of the head (see **C** in the screen)\n- **Height D** : height dimension of the the head (see **D** in the screen)\n- **Number E** : number of heads contiguous (see **E** in the screen)\n- The options **Plane** and **Options lines** are available\n\n\nSixth section :\n\nType line : Hand ![FCConvertLines](images/Macro_FCConvertLines_07.png )\n\n- This line are created\n- **Length A** : The length total of the line (see **A** in the screen)\n- **Height B** : Height of the line (see **B** in the screen)\n- **Wave** : compression or uncompress of the wave (see **Wave** in the screen)\n- The options **Plane** and **Options lines** are available\n\n\nSeventh section :\n\nOptions line : ![FCConvertLines](images/Macro_FCConvertLines_08.png ) This options are available for all menu\n\n- **__2,00 Width__**: dimension of the width of the line(s)\n\n- **__2,00 Point S__**: dimension of the points of the line(s)\n\n- **Color**: color of the line(s) this button are colored with the color selected (if the checkbox \\\"Bicolor\\\" in the menu \\\"Cut line\\\" is checked this option are not used for this menu)\n\n\nEighth section :\n\nOption Plane\n\nThis option are available only for **\\\"ZigZag\\\"** and **\\\"Hand\\\"** ![FCConvertLines](images/Macro_FCConvertLines_09.png )\n\n- **XY** : Plane XY\n- **YZ** : Plane YZ\n- **XZ** : Plane XZ\n\n\nNinth section :\n\nButton ![FCConvertLines](images/Macro_FCConvertLines_10.png ) \n\n- **Save type**: the line configured is saved in one file (one file for one type line). While saving a file header is predetermined depending on the chosen menu (example : Dash is saved, in the save window is displayed \\\"Dash\\_.FCConvertL\\\" you can modify to \\\"Dash_my_config_10.FCConvertL\\\" or the name you want\\... this method allow sharpens clear)\n\n- **Load type**: load one file configured\n\n- **Name type line________________**: name of the type configured this name is saved in the file\n\n- **Reset**: reset the data\\'s in the original configuration\n\n- **Create Comp**: this button create on compound with the lines created (ten lines selected = one compound)\n\n- **Create**: create the lines separately (ten lines selected = ten lines created)\n\n- **Quit**: quit the macro\n\n\n## The files to copy in your directory with the macro (10 files images) \n\n**The icon for the toolBar** ![Macro_FCConvertLines](images/Macro_FCConvertLines.png ) **Title** ![ConvertLines_Title](images/Macro_FCConvertLines_Title.png ) **Line Dash** : ![ConvertLines_Dash](images/Macro_FCConvertLines_Dash.png ) **Line DashDot** : ![ConvertLines Dash dot](images/Macro_FCConvertLines_DashDot.png_‎ ) **Line DashDotDot** : ![ConvertLines Dash dot dot](images/Macro_FCConvertLines_DashDotDot.png ) **Line Zigzag** : ![ConvertLines_Zigzag](images/Macro_FCConvertLines_Zigzag.png ) **Line Hand** : ![ConvertLines_Hand](images/Macro_FCConvertLines_Hand.png ) **View** : ![ConvrtLines_View-front](images/Macro_FCConvrtLines_View-front.png ) ![ConvrtLines_View-right](images/Macro_FCConvrtLines_View-right.png ) ![ConvrtLines_View-right](images/Macro_FCConvrtLines_View-top.png ) \n\n## Script\n\nCopy the macro **Macro_FCConvertLines.FCMacro** in your macros folder.\n\nThe script on Gist [Macro_FCConvertLines.FCMacro](https://gist.github.com/mario52a/3d719574089a5f9044ec)\n\nToolBar icon ![](images/Macro_FCConvertLines.png )\n\n**Macro_FCConvertLines.FCMacro**\n\n## Examples\n\nExample dot, dash dot, dash dot, dash dot dot \"\" Example hand, zigzag \"\" Example hand \"\" All lines created the configuration specifications set in this Option lines Example hand can make beautiful sine wave or totally anarchic \"\" \n\nExample convert ShapeString to sketch (the curves hare not authorized for convert Shape to Sketch) ![](images/ShapeString_To_Sketch.gif )\n\n\n## Version\n\nver 00.07b 09/11/2020 correct bug \\# (ajoute recompute() pour corriger)# Cannot compute Inventor representation for the shape of Shape. And Line by Label\n\nver 00.07 13/05/2017 correct bug after create \\\"Alternate \\....\\\" the dimension of lines stay with the dimension alternative and not restitution the desired dimensions\n\nver 00.06 20/02/2017 correction of precision cut (replace \\\"numberOfPoints = longueur\\\" to \\\"numberOfPoints = (longueur + 1)\\\")\n\nver 00.05 11/01/2017 replace de search method macro path\n\nver 00.04 05/09/2016 setPointSize(8.0)\n\nver 00.02 18/02/2016\n\nver 00.01 19/01/2016\n\nver 00.00 19/01/2016\n\n\n---\n⏵ [documentation index](../README.md) > Macro FC Convert Lines/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_Fonts_Win10_PYMP.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_Fonts_Win10_PYMP.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_Fonts_Win10_PYMP.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2a8c0dfd3ea779bc98421dd62e9ad0429016849216a146b90631469f0097a08d", "bytes": 50097, "tokens": 17264, "text": "# Macro Fonts Win10 PYMP/en\n{{Macro\n|Name=Macro Fonts Win10 PYMP\n|Icon=Macro_Fonts_Win10_PYMP.png\n|Description= {{ColoredText|#ff0000|#ffffff|New version GUI modified for the HD dpi (QGridLayout) runs only FC version 0.18 and more (PySide2 Qt5)}}

For the previous version see [https://gist.githubusercontent.com/mario52a/e7aa19a9dc8ea28ad4f03944ffc8f731/raw/0f5d54209d6c242b49519c83e96c548b06a8f4c6/Macro_Fonts_Win10_PYMP.FCMacro Macro Fonts Win10 PYMP] and install it manually. This little macro is dedicate to users of Windows 10. The explorer fonts for use the ShapeString is empty and this little macro can help you see easily the font to use.\n|Author=Mario52\n|Version=02.00\n|Date=2020-06-06\n|FCVersion=0.18 and more\n|Download=[https://www.freecadweb.org/wiki/images/f/fa/Macro_Fonts_Win10_PYMP.png ToolBar Icon]\n}}\n\n## Description\n\nThis little macro is dedicate to users of Windows 10. The explorer fonts for use the ShapeString is empty and this little macro can help you see easily the font to use.\n\n![](images/Macro_Fonts_Win10_PYMP_00.png ) \n*Macro Fonts Win10 PYMP*\n\n## Uses\n\nLaunch the macro select the font and apply.\n\n![Macro Fonts Win10 PYMP](images/Macro_Fonts_Win10_PYMP_01.png ) \n*Macro Fonts Win10 PYMP window *\n\n- **Text edit** : Window for your text\n\n- **Line edit** : for visualise your path and file used\n\n- **Combobox** : for choice your font\n\n- **Color**: choice the text color\n\n- {{SpinBox|10.00}}: dimension of text in 3D view\n\n- {{CheckBox|Text}}: create one text with the ShapeString\n\n- {{SpinBox|20.00}}: dimension of text displayed in the window macro\n\n- **Exit**: quit Fonts Win10 PYMP\n\n- **Ok**: validate your text\n\n- **New folder**: other choice path files font\n\n- **Origin**: return of the original directory font (system)\n\n- **Help**: display the wiki page in the FreeCAD browser\n\n## Configuration\n\nAfter the first launch, see :\n\n\n{{Incode|Menu → Tools → User parameter : BaseApp/Preferences/Macros/FCMmacros/Fonts Win10 PYMP}}\n\n- **switchModeTextList**\n - \n `False`\n \n normal (and black) text mode cuts the switchFontComBox\n\n - \n `True`\n \n permit the switchFontComBox\n- **switchFontComBox**\n - \n `False`\n \n (and switchModeTextList= `True`) faster text mode (in color) in ComboBox list\n\n - \n `True`\n \n (and switchModeTextList= `True`) list in ComboBox is displayed to fontFamily, slower but more beautiful!\n- **setSystemFonts**\n - \n `False`\n \n matplotlib.font_manager.findSystemFonts(\\\"C:/\\\", \\\"ttf\\\")\n\n - do all the fonts (in all the folders and sub-folders of the DD) time !!\n\n - \n `True`\n \n fontman.findSystemFonts(self.pathFont)\n\n - do all the fonts in the directory (and in all the sub-folders)\n- **seTtextAlignement**\n - 0 = AlignLeft (default)\n - 1 = AlignCenter\n - 2 = AlignRight\n- **setFontByDefault**\n - the last font used is saved in this field\n- **setLastFontPath**\n - the last path used is saved in this field\n\n## Script\n\nToolBar Icon ![](images/Macro_Fonts_Win10_PYMP.png )\n\n**Macro Fonts Win10 PYMP.FCMacro**\n\n\n{{MacroCode|code=\n\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\"\"\"\n***************************************************************************\n* Copyright (c) 2019 2020 *\n* *\n* This file is a supplement to the FreeCAD CAx development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n** **\n* Use at your own risk. The author assumes no liability for data loss. *\n* It is advised to backup your data frequently. *\n* If you do not trust the software do not use it. *\n** **\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n***************************************************************************\n* WARNING! All changes in this file will be lost and * \n* may cause malfunction of the program *\n***************************************************************************\n\"\"\"\n#Macro_Fonts_Win10_PYMP 10/05/2019, 06/06/2020\n#\n###############################################################################################\n#OS: Windows 10 (10.0) #OS: Ubuntu 20.04 LTS\n#Word size of OS: 64-bit #Word size of OS: 64-bit\n#Word size of FreeCAD: 64-bit #Word size of FreeCAD: 64-bit\n#Version: 0.19.21280 (Git) #Version: 0.18.16131 (Git) AppImage\n#Build type: Release #Build type: Release\n#Branch: master #Branch: (HEAD detached at 0.18.3)\n#Hash: 6f3160db3e88733536c7eaf97ad7d6ebd21baccd#Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3\n#Python version: 3.6.8 #Python version: 3.6.7\n#Qt version: 5.12.1 #Qt version: 5.6.2\n#Coin version: 4.0.0a #Coin version: 4.0.0a\n#OCC version: 7.3.0 #OCC version: 7.3.0\n#Locale: French/Mars (fr_MA) #\n################################################################################################\n#\n__title__ = \"Fonts Win10 PYMP\"\n__author__ = \"Mario52\"\n__url__ = \"https://wiki.freecadweb.org/Macro_Fonts_ Win10_PYMP\"\n__version__ = \"02.00\"\n__date__ = \"2020/06/06\" #YYYY/MM/DD\n__icon__ = \"https://wiki.freecadweb.org/images/f/fa/Macro_Fonts_Win10_PYMP.png\"\n__Gist__ = \"https://gist.github.com/mario52a/e7aa19a9dc8ea28ad4f03944ffc8f731\"\n#\n#### Test FreeCAD.Version simple ############################################################################################################\nif int(FreeCAD.Version()[1]) < 18: # Version de FreeCAD\n FreeCAD.Console.PrintMessage(\"This version \" + __title__ + \" rmu work with the FreeCAD 0.18 or higher.\" + \"\\n\\n\")\n FreeCAD.Console.PrintMessage(\"For the precedent version see the page \" + \"\\n\\n\")\n FreeCAD.Console.PrintMessage(\"https://gist.githubusercontent.com/mario52a/e7aa19a9dc8ea28ad4f03944ffc8f731/raw/0f5d54209d6c242b49519c83e96c548b06a8f4c6/Macro_Fonts_Win10_PYMP.FCMacro\" + \"\\n\\n\")\n#### Test FreeCAD.Version simple ############################################################################################################\n\nimport PySide2\nfrom PySide2 import (QtWidgets, QtCore, QtGui)\nfrom PySide2.QtWidgets import (QWidget, QApplication, QSlider, QGraphicsView, QGraphicsScene, QVBoxLayout, QStyle)\nfrom PySide2.QtGui import (QPainter, QColor, QIcon)\nfrom PySide2.QtSvg import *\n\nimport Draft, Part, PartGui, FreeCADGui, FreeCAD, FreeCADGui\nfrom FreeCAD import Base\nimport os, time, sys\n\nimport math\nfrom math import sqrt, pi, sin, cos, asin\n\nApp=FreeCAD\nGui=FreeCADGui\nimport WebGui\n \nglobal ui ; ui = \"\"\n\n#path#################################################################\nglobal path #\n#path = FreeCAD.ConfigGet(\"AppHomePath\") # path FreeCAD installation\n#path = FreeCAD.ConfigGet(\"UserAppData\") # path FreeCAD User data\n#path = \"your path\" # your directory path\nparam = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macro\") # macro path\npath = param.GetString(\"MacroPath\",\"\") + \"/\" # macro path\npath = path.replace(\"\\\\\",\"/\") # convert the \"\\\" to \"/\"\n#FreeCAD.Console.PrintMessage( \"Path for the icons : \" + path + \"\\n\")# \n######################################################################\n\n#### matplotlib debut 1/5 #################################################################\n#import PySide2\n#from PySide2 import (QtWidgets, QtCore, QtGui)\n#from PySide2.QtWidgets import (QWidget, QApplication, QSlider, QGraphicsView, QGraphicsScene, QVBoxLayout, QStyle)\n\nimport re\nimport operator\nfrom operator import itemgetter #, attrgetter, methodcaller # pour sort \nimport platform\n\nglobal newPolicePath\nglobal PolicePath\nglobal originalFontName\nglobal originalFontPath\nglobal searchFontName\n\nif platform.system() == \"Windows\" :\n PolicePath = newPolicePath = originalFontPath = \"C:/Windows/Fonts/\"\n originalFontName = \"ARIAL\"\nelif platform.system() == \"Linux\" :\n PolicePath = newPolicePath = originalFontPath = \"/usr/share/fonts/\"\n originalFontName = \"UBUNTU-M\"\nelif platform.system() == \"Darwin\":\n PolicePath = newPolicePath = originalFontPath = \"/Library/Fonts/\"\n originalFontName = \"Arial\"\n\n#import glob\n#files_TTF = glob.glob(self.pathFont + \"/*.TTF\") \n##################################\nimport matplotlib\nimport matplotlib.font_manager\nimport matplotlib.font_manager as fontman\nimport matplotlib.font_manager as fontconfig\nfrom matplotlib.font_manager import FontProperties\n#from matplotlib.ft2font import FT2Font\n##################################\n\n#### Config Begin matplotlib font #######################\n # # https://en.wikipedia.org/wiki/Web_colors\nglobal setColorTTF ; setColorTTF = \"blue\" # .TTF color by \"extension name\" or hexa \"#0000FF\" \nglobal setColorFON ; setColorFON = \"orange\" # .FON color by \"extension name\" or hexa \"#FFA500\"\nglobal setColorOTF ; setColorOTF = \"green\" # .OTF color by \"extension name\" or hexa \"#008000\"\nglobal setColorPOL ; setColorPOL = \"black\" # .OTHER color by \"extension name\" or hexa \"#000000\"\n #####\nglobal switchModeTextList; switchModeTextList= 1 # 0 = mode text normal (et noir) coupe le switchFontComBox\n # 1 = permet le switchFontComBox 1 (default)\n #####\nglobal switchFontComBox ; switchFontComBox = 0 # 0 = (et switchModeTextList= 1) mode texte (en couleur) dans liste ComboBox plus rapide (default)\n # 1 = (et switchModeTextList= 1) fontFamily dans liste ComboBox plus lent mais plus beau!\n #####\nglobal setSystemFonts ; setSystemFonts = 1 # 0 = matplotlib.font_manager.findSystemFonts(\"C:/\", \"ttf\") \n # fait toutes les fontes (dans tous les dossiers et sous dossiers du DD) time !!\n # 1 = fontman.findSystemFonts(self.pathFont)\n # fait toutes les fontes du repertoire (et dans tous les sous dossiers) (default)\n #####\nglobal seTtextAlignement ; seTtextAlignement = 0 # 0 = AlignLeft (default)\n # 1 = AlignCenter\n # 2 = AlignRight\n #####\nglobal setFontByDefault ; setFontByDefault = \"ARIAL\" # Font by Default\n #####\nglobal setLastFontPath ; setLastFontPath = PolicePath#directory font by start\n #####\n#### Config End matplotlib font #########################\n\n###### Read Configuration begin ####\nseTtextAlignement = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).GetInt(\"seTtextAlignement\")\nsetSystemFonts = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).GetBool(\"setSystemFonts\")\nswitchFontComBox = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).GetBool(\"switchFontComBox\")\nswitchModeTextList = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).GetBool(\"switchModeTextList\")\nsetFontByDefault = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).GetString(\"setFontByDefault\")\nsetLastFontPath = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).GetString(\"setLastFontPath\")\n\nif setLastFontPath == \"\":\n setLastFontPath = PolicePath\nelse:\n PolicePath = setLastFontPath\n\nif setFontByDefault == \"\":\n if platform.system() == \"Windows\" :\n setFontByDefault = \"ARIAL\"\n elif platform.system() == \"Linux\" :\n setFontByDefault = \"UBUNTU-M\"\n elif platform.system() == \"Darwin\":\n setFontByDefault = \"Arial\"\nsearchFontName = setFontByDefault\n###### Read Configuration end ####\n\nhomeIcon = [\n\"24 24 14 1\",\n\" c None\",\n\". c #EF2929\",\n\"+ c #A40000\",\n\"@ c #DDDFDC\",\n\"# c #888A85\",\n\"$ c #DDDEDB\",\n\"% c #DCDEDB\",\n\"& c #DCDEDC\",\n\"* c #DBDDDA\",\n\"= c #BABDB6\",\n\"- c #555753\",\n\"; c #729FCF\",\n\"> c #3465A4\",\n\", c #8191AA\",\n\" \",\n\" \",\n\" .+ \",\n\" ..++ \",\n\" ....++ \",\n\" .....+++ \",\n\" ....@#++++ \",\n\" ....@@@#++++ \",\n\" ....@@@@@#++++ \",\n\" ....@@@@$@@#++++ \",\n\" ....@@@$@@%@@#++++ \",\n\" ....@@@@@@@@%@@#++++ \",\n\" ...@@@%%%%&%%*@@#+++ \",\n\" ..@@@@@@@@@@@@@@@#++ \",\n\" #@@=#---@@=====@# \",\n\" #@@=#---@@;>>>;@# \",\n\" #@@,#---@@;>>>;@# \",\n\" #@@,#---@@;>>>;@# \",\n\" #@@=#---@@@# \",\n\" #@@=#---@@@@@@@@# \",\n\" #@@=##--@@@@@@@@# \",\n\" ################# \",\n\" \",\n\" \"]\n\nfolderNewIcon = [\n\"24 24 11 1\",\n\" c None\",\n\". c #FCE94F\",\n\"+ c #EDD400\",\n\"@ c #555753\",\n\"# c #BABDB6\",\n\"$ c #2B4F89\",\n\"% c #D3D7CF\",\n\"& c #5479AB\",\n\"* c #B8BBB5\",\n\"= c #B6BAB4\",\n\"- c #2E5089\",\n\" ...... \",\n\"........ \",\n\"........ \",\n\".+++++++ \",\n\".+.....+@@@@@@@@@@@@ \",\n\".+......###########@ \",\n\".+....$$$$$########@ \",\n\" +....$%%%$$$$$$$$$$$$& \",\n\" @####$$$$$$$$$$$$$$$$& \",\n\" @####$$$$$$$$$$$$$$$$& \",\n\" @###$$$$$$$$$$$$$$$$& \",\n\" @#*$$$$$$$$$$$$$$$$$& \",\n\" @#=$$$$$$$$$$$$$$$$$& \",\n\" @#=$$$$$$$$$$$$$$$$$& \",\n\" @#=$$$$$$$$$$$$$$$&&& \",\n\" @##$$$$$$$$$$$$$$$& \",\n\" @$$$$$$$$$$$$$$$$& \",\n\" @$-$$$$$$$$$$$$$$& \",\n\" @$$$$$$$$$$$$$$$&& \",\n\" &&&&&&&&&&&&&&&&& \",\n\" \",\n\" \",\n\" \",\n\" \"]\n\nhelpIcon = [\n\"24 24 4 1\",\n\" c None\",\n\". c #016AC5\",\n\"+ c #F8F8FF\",\n\"@ c #FFFFFF\",\n\"........................\",\n\".++++++++++++++++++++++.\",\n\".++++++++++++++++++++++.\",\n\".++..................++.\",\n\".++..................++.\",\n\".++......@@@@@@......++.\",\n\".++.....@@@@@@@@.....++.\",\n\".++.....@@@..@@@.....++.\",\n\".++.....@@....@@.....++.\",\n\".++.....@@....@@.....++.\",\n\".++...........@@.....++.\",\n\".++..........@@@.....++.\",\n\".++.........@@@......++.\",\n\".++........@@@.......++.\",\n\".++........@@........++.\",\n\".++........@@........++.\",\n\".++..................++.\",\n\".++........@@........++.\",\n\".++........@@........++.\",\n\".++..................++.\",\n\".++..................++.\",\n\".++++++++++++++++++++++.\",\n\".++++++++++++++++++++++.\",\n\"........................\"]\n\nvalidIcon = [\n\"24 24 3 1\",\n\" c None\",\n\". c #4E9A06\",\n\"+ c #FFFFFF\",\n\" \",\n\" \",\n\" \",\n\" . \",\n\" .+. \",\n\" .+.+. \",\n\" .+...+. \",\n\" .+.....+. \",\n\" . .+.......+.\",\n\" .+. .+.......+. \",\n\" .+.+. .+.......+. \",\n\" .+...+. .+.......+. \",\n\" .+.....+.+.......+. \",\n\".+.......+.......+. \",\n\" .+.............+. \",\n\" .+...........+. \",\n\" .+.........+. \",\n\" .+.......+. \",\n\" .+.....+. \",\n\" .+...+. \",\n\" .+.+. \",\n\" .+. \",\n\" . \",\n\" \"]\n\npaintIcon = [\n\"24 24 9 1\",\n\" c None\",\n\". c #16D0D2\",\n\"+ c #D3D7CF\",\n\"@ c #C17D11\",\n\"# c #EDD400\",\n\"$ c #73D216\",\n\"% c #F57900\",\n\"& c #3465A4\",\n\"* c #CC0000\",\n\" .... \",\n\" +++ .... @@@@ \",\n\" ++#### .... $$$ @@@@ \",\n\" ++####%%%...&&$$$ @@@@ \",\n\" ####%%% &&&&$$$ @@@@ \",\n\" ####%%%+&&&&** \",\n\" $$$$ ++&&&&**##%%% \",\n\"@@@@$$$$ ++++ ***##%%% \",\n\"@@@@$$$$ ++++ ####%%% \",\n\"@@@@ &&&$$$$## \",\n\"@@@$$$$ %%&&&$$$$ %%%% \",\n\" $$$$ %%&***$$$ %%%% \",\n\"...$$$$ %%%***$$$ %%%% \",\n\"...$$$$*** ***&&&+%%%% \",\n\"....%%%***### &&&+++@@@@\",\n\"....%%%***### &&&+++@@@@\",\n\" +++%% ### .... @@@@\",\n\" +++ &&& $$$..####@@@@\",\n\" +++ &&****$$..#### \",\n\" #### &&****$&&&###**** \",\n\" ####+++**...&&&###**** \",\n\" ####+++**...&&&& **** \",\n\" ####+++ ...&&&& **** \",\n\" .... \"]\n\nquitIcon = [\n\"24 24 3 1\",\n\" c None\",\n\". c #FFFFFF\",\n\"+ c #CC0000\",\n\" .... \",\n\"++++++++++....++++++++++\",\n\"+.......++....++.......+\",\n\"+.......++....++.......+\",\n\"+.......++....++.......+\",\n\"+...++++++....++++++...+\",\n\"+...++++++....++++++...+\",\n\"+...+++++......+++++...+\",\n\"+...+++++......+++++...+\",\n\"+...+++++......+++++...+\",\n\"+...+++++......+++++...+\",\n\"+...+++++......+++++...+\",\n\"+...+++++......+++++...+\",\n\"+...++++++++++++++++...+\",\n\"+...++++++++++++++++...+\",\n\"+...++++++++++++++++...+\",\n\"+...++++++++++++++++...+\",\n\"+...++++++++++++++++...+\",\n\"+...++++++++++++++++...+\",\n\"+...++++++++++++++++...+\",\n\"+......................+\",\n\"+......................+\",\n\"+......................+\",\n\"++++++++++++++++++++++++\"]\n\nsetIconTTF = [\n\"16 16 6 1\",\n\" c None\",\n\". c #204A87\",\n\"+ c None\",\n\"@ c #729FCF\",\n\"# c #CC0000\",\n\"$ c #EDD400\",\n\".+++++++++++@@@@\",\n\".++++++++@+@++@@\",\n\".++#####++++@@+@\",\n\".+++$#$$$++@+@+@\",\n\".++++#$+++++++@+\",\n\".++++#$#####++++\",\n\".++++#$+$#$$$+++\",\n\".++++#$++#$+++++\",\n\".@++++$++#$+###+\",\n\".@@++++++#$+#$$$\",\n\"..@@+++++#$+#$++\",\n\"...@@+++++$+###+\",\n\"....@@++++++#$$$\",\n\".....@@+++++#$++\",\n\"......@@+++++$++\",\n\"................\"]\n\nsetIconFON = [\n\"16 16 6 1\",\n\" c None\",\n\". c #204A87\",\n\"+ c None\",\n\"@ c #F57900\",\n\"# c #CC0000\",\n\"$ c #EDD400\",\n\".+++++++++++@@@@\",\n\".++++++++@+@++@@\",\n\".++###++++++@@+@\",\n\".++#$$$++++@+@+@\",\n\".++#$+++++++++@+\",\n\".++###+###++++++\",\n\".++#$$$#$#$+++++\",\n\".++#$++#$#$+++++\",\n\".@++$++#$#$##+#+\",\n\".@@++++#$#$##$#$\",\n\"..@@+++###$#$##$\",\n\"...@@+++$$$#$##$\",\n\"....@@+++++#$+#$\",\n\".....@@++++#$+#$\",\n\"......@@++++$++$\",\n\"................\"]\n\nsetIconOTF = [\n\"16 16 6 1\",\n\" c None\",\n\". c #204A87\",\n\"+ c None\",\n\"@ c #4E9A06\",\n\"# c #CC0000\",\n\"$ c #EDD400\",\n\".+++++++++++@@@@\",\n\".++++++++@+@++@@\",\n\".++###++++++@@+@\",\n\".++#$#$++++@+@+@\",\n\".++#$#$+++++++@+\",\n\".++#$#$###++++++\",\n\".++#$#$+#$$+++++\",\n\".++###$+#$++++++\",\n\".@++$$$+#$+###++\",\n\".@@+++++#$+#$$$+\",\n\"..@@++++#$+#$+++\",\n\"...@@++++$+###++\",\n\"....@@+++++#$$$+\",\n\".....@@++++#$+++\",\n\"......@@++++$+++\",\n\"................\"]\n\nsetIconPOL = [\n\"16 16 12 1\",\n\" c None\",\n\". c #204A87\",\n\"+ c None\",\n\"@ c #06989A\",\n\"# c #73D216\",\n\"$ c #000000\",\n\"% c #75507B\",\n\"& c #729FCF\",\n\"* c #CC0000\",\n\"= c #F57900\",\n\"- c #EDD400\",\n\"; c #4E9A06\",\n\".+++++++++++@#$%\",\n\".++++++++$+#++&$\",\n\".++***++++++=@+%\",\n\".++*-*-++++*+&+$\",\n\".++*-*-+++++++*+\",\n\".++***-***++++++\",\n\".++*---*-*-+++++\",\n\".++*-++*-*-+++++\",\n\".$++-++*-*-*++++\",\n\".*@++++*-*-*-+++\",\n\"..#*+++***-*-+++\",\n\"...;#+++---*-+++\",\n\"....%=+++++*-+++\",\n\".....;$++++****+\",\n\"......@%++++\",\n\"................\"]\n\ndef createSpace(texte): # detecte majuscule et ajoute un espace devant la lettre\n # return createSpace(TexTe) = Tex Te , if createSpace(TEXTE) = TEXTE\n if texte.isupper():\n stringSpace = texte\n else:\n try:\n stringSpace = texte[0]\n for i in texte[1:]:\n if re.search(r\"[A-Z]\", i): i = \" \" + i\n stringSpace += i\n except Exception:\n stringSpace = texte\n return stringSpace\n\ndef family(chaine):\n # return family(chaine)[1] = Family , family(chaine)[2] = typeCar (form [a, b, c ...]\n famille = typeCar = \"\"\n try:\n if chaine.find('-') != -1:\n famille = chaine[:chaine.find('-')]\n typeCar = chaine[chaine.find('-')+1:]\n else:\n famille = chaine\n typeCar = \"\"\n except Exception:\n famille = chaine\n typeCar = \"\"\n typeCar = str(createSpace(typeCar)).split()\n return [createSpace(famille), typeCar]\n\nclass MyLabelPatience(): # fenetre image d'attente de chargement\n global path\n label = QtWidgets.QLabel()\n label.setText(\"
Wait please
\\n\\n
i search the fonts !\\n\\n\")\n ecran = FreeCADGui.getMainWindow().frameGeometry()\n xF = 250; yF = 250\n xW = (ecran.width()/2) - (xF/2)\n yW = (ecran.height()/2)- (yF/2)\n label.setGeometry(xW, yW, xF, yF)\n label.setStyleSheet(\"QLabel {background-color : #F0C300;font: 12pt; }\");\n label.setWindowFlags(PySide2.QtCore.Qt.WindowFlags(PySide2.QtCore.Qt.FramelessWindowHint)) # pas de bords\n label.setWindowFlags(PySide2.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenetre en avant\n#### matplotlib fin 1/5 #################################################################\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\n\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\nclass Ui_MainWindow(object):\n\n def __init__(self ):\n self.window = MainWindow\n global path #\n self.path = path\n\n #### matplotlib font textEdit\n self.nomPolice = \"Arial\"\n self.FontTextSize = 20\n self.fonteComp = \"\"\n self.font = QtGui.QFont()\n ####font textEdit\n self.FontSize = 10.0\n self.red = (204.0 / 255.0)\n self.green = (204.0 / 255.0)\n self.blue = (204.0 / 255.0)\n self.alpha = 1.0 # 1.0 = visibility max (opacity)\n\n self.tableau = [] #Index (), [chemin plus nom fichier (nomPathPolice), nom sans extension (nomSimple), nomSimpleExt (nomSimple + Ext)]\n self.index = 0 #Index ()\n #### matplotlib font textEdit\n\n def searchFont(self,pathSearch):\n global ui\n global setSystemFonts\n global seTtextAlignement\n global switchFontComBox\n global switchModeTextList\n global setFontByDefault\n global searchFontName\n\n MyLabelPatience.label.show()\n FreeCADGui.updateGui() # rafraichi l'ecran\n\n files_All_Fonts = \"\"\n ##https://matplotlib.org/_modules/matplotlib/font_manager.html\n\n if setSystemFonts == 0:\n files_All_Fonts = matplotlib.font_manager.findSystemFonts(pathSearch, \"ttf\") # fait toutes les fontes ? ()\n else:\n files_All_Fonts = fontman.findSystemFonts(pathSearch) # fait toutes les fontes (et dans tous les sous dossiers)\n\n if len(files_All_Fonts) > 0: \n self.tableau = []\n self.index = 0\n\n for fonte in files_All_Fonts:\n ####\n nomPathPolice = nomFichier = nomSimpleExt = nomSimple = nomExtension = nameName = \"\"\n\n nomPathPolice = fonte.replace(\"\\\\\",\"/\") # convert the \"\\\" to \"/\"\n nomFichier = nomPathPolice.split(\"/\") # complet split\n nomSimpleExt = nomFichier[-1] # nom avec extension\n nomSimple = nomFichier[-1][:-4] # nom sans extension\n nomExtension = nomSimpleExt[nomSimpleExt.rfind('.')+1:].upper() # extension\n\n ####\n try:\n# nameFamily = matplotlib.font_manager.FontProperties(fname=fonte).get_family() ##['sans-serif']\n# nameStyle = matplotlib.font_manager.FontProperties(fname=fonte).get_style() #normal\n# nameVariant = matplotlib.font_manager.FontProperties(fname=fonte).get_variant() #normal\n# nameWeight = matplotlib.font_manager.FontProperties(fname=fonte).get_weight() #normal\n# nameStretch = matplotlib.font_manager.FontProperties(fname=fonte).get_stretch() #normal\n# nameFileComp = matplotlib.font_manager.FontProperties(fname=fonte).get_file() ##c:\\windows\\fonts\\NotoNaskhArabicUI-Regular.ttf\n# nameSize = matplotlib.font_manager.FontProperties(fname=fonte).get_size() #10.0\n nameName = matplotlib.font_manager.FontProperties(fname=fonte).get_name() ##Noto Naskh Arabic UI\n# nameSizePoint = matplotlib.font_manager.FontProperties(fname=fonte).get_size_in_points() #10.0\n# nameSlant = matplotlib.font_manager.FontProperties(fname=fonte).get_slant() #normal\n# namePattern = matplotlib.font_manager.FontProperties(fname=fonte).get_fontconfig_pattern() #:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:file=c:\\windows\\fonts\\NotoNaskhArabicUI-Regular.ttf:size=10.0\n except Exception:\n nameFamily = nameStyle = nameVariant = nameWeight = nameStretch = nameFileComp = nameSize = nameName = nameSizePoint = nameSlant = namePattern = \"\"\n ####\n if nameName == \"\" :\n nameName = nomSimple\n self.tableau.append([0, nomPathPolice, nomSimple, nomSimpleExt.upper(), nomExtension.upper(), nameName])\n self.tableau = sorted(self.tableau, key=itemgetter(3)) # sorted by nomSimple.upper()\n\n try:\n for line in range(len(self.tableau)): # enleve les doubles (bon)\n if self.tableau[line][2] == self.tableau[line + 1][2]: # enleve les doubles (bon)\n del(self.tableau[line + 1]) # enleve les doubles (bon)\n except Exception:\n None\n self.comboBoxPy.clear()\n\n for line in range(len(self.tableau)): \n try:\n self.tableau[line][0] = line # ajoute le numero de ligne\n if self.tableau[line][2].upper() == searchFontName.upper(): # detecte la fonte de base\n self.index = line\n PolicePath = self.tableau[line][1]\n ####Section common color and font begin ######################\n model = self.comboBoxPy.model()\n\n if switchModeTextList == 1:\n if self.tableau[line][4] == \"TTF\":\n item = QtGui.QStandardItem(QtGui.QPixmap(setIconTTF), str(line))\n item.setForeground(QtGui.QColor(setColorTTF))\n elif self.tableau[line][4] == \"FON\":\n item = QtGui.QStandardItem(QtGui.QPixmap(setIconFON), str(line))\n item.setForeground(QtGui.QColor(setColorFON))\n elif self.tableau[line][4] == \"OTF\":\n item = QtGui.QStandardItem(QtGui.QPixmap(setIconOTF), str(line))\n item.setForeground(QtGui.QColor(setColorOTF))\n else:\n item = QtGui.QStandardItem(QtGui.QPixmap(setIconPOL), str(line))\n item.setForeground(QtGui.QColor(setColorPOL))\n\n if seTtextAlignement == 0:\n item.setTextAlignment(QtCore.Qt.AlignLeft)\n elif seTtextAlignement == 1:\n item.setTextAlignment(QtCore.Qt.AlignCenter)\n elif seTtextAlignement == 2:\n item.setTextAlignment(QtCore.Qt.AlignRight)\n else:\n self.comboBoxPy.addItem(self.tableau[line][2]) \n model.appendRow(item)\n else:\n self.comboBoxPy.addItem(\"\")\n self.comboBoxPy.setItemText(line, self.tableau[line][2])\n ####Section item color and font end ########################## ####Section setfont Family switchFontComBox begin#############\n if (switchFontComBox == 1) and (switchModeTextList == 1):\n typeCar = font = \"\"\n font = QtGui.QFont()\n #font = item.font()\n \n typeCar = family(self.tableau[line][2])[1]\n font.setBold(False)\n font.setItalic(False)\n \n if len(typeCar) > 0:\n for option in typeCar:\n if option == \"Bold\":\n font.setBold(True)\n if (option == \"Italic\") or (option == \"It\") or (option == \"Slanted\"):\n font.setItalic(True)\n if option == \"Oblique\":\n font.setItalic(True)\n #'Bold''Regular''Slanted''Italic''Medium''Extra''Light''Condensed''Black''It''Semibold'\n \n font.setFamily(self.tableau[line][5])\n font.setPixelSize(15)\n if switchModeTextList == 1:\n item.setFont(font)\n else:\n self.comboBoxPy.addItem(\"\")\n ####Section setfont Family switchFontComBox end###############\n except Exception:\n FreeCAD.Console.PrintMessage(\"searchFont()\")\n None\n #for i in self.tableau: print(i)\n font = QtGui.QFont()\n font.setFamily(self.tableau[self.index][5])\n font.setPointSize(self.FontTextSize)\n self.textEditFont.setFont(font)\n self.textEditFont.setToolTip(\"Your text here\" + \"\\n\"\n \"Title (\" + str(self.index + 1) + \"/\" + str(len(self.tableau)) + \") = (index file, number file font)\" + \"\\n\"\n \"Version \" + __version__ + \" : \" + __date__ + \") of \" + __title__ + \")\" + \"\\n\\n\"\n \"It is possible that a font is not visible in its normal design,\" + \"\\n\"\n \"but it is normal in the 3DView, sorry !\")\n self.lineEdit_NameFile.setText(\"(\" + str(self.index + 1) + \"/\" + str(len(self.tableau)) + \") \" + self.tableau[self.index][1])\n self.comboBoxPy.setCurrentIndex(self.index)\n self.fonteComp = self.tableau[self.index][1]\n else:\n self.PB_systemPath.setStyleSheet(\"background-color: rgb(0, 224, 0)\")\n self.PB_newPathFont.setStyleSheet(\"background-color: rgb(0, 224, 0)\")\n MyLabelPatience.label.close()\n\n def setupUi(self, MainWindow):\n global ui\n global PolicePath \n \n self.window = MainWindow\n MainWindow.setObjectName((\"MainWindow\"))\n MainWindow.resize(470, 250)\n# MainWindow.setMinimumSize(QtCore.QSize(470, 250))\n# MainWindow.setMaximumSize(QtCore.QSize(470, 250))\n self.centralwidget = QtWidgets.QWidget(MainWindow)\n self.centralwidget.setObjectName((\"centralwidget\"))\n\n self.groupBox_00 = QtWidgets.QGroupBox()\n self.groupBox_01 = QtWidgets.QGroupBox()\n self.groupBox_02 = QtWidgets.QGroupBox()\n\n self.textEditFont = QtWidgets.QTextEdit(self.centralwidget)\n self.lineEdit_NameFile = QtWidgets.QLineEdit(self.centralwidget)\n\n self.PB_color = QtWidgets.QPushButton(self.centralwidget)\n self.PB_color.setIcon(QtGui.QIcon(QtGui.QPixmap(paintIcon))) # icone dans une variable \n self.PB_color.clicked.connect(self.on_PB_color) # \"\"\n \n self.doubleSpinBox_1 = QtWidgets.QDoubleSpinBox(self.centralwidget)\n self.doubleSpinBox_1.setMinimum(0.0)\n self.doubleSpinBox_1.setMaximum(10000.0)\n self.doubleSpinBox_1.setSingleStep(1.0)\n self.doubleSpinBox_1.setValue(self.FontSize)\n self.doubleSpinBox_1.valueChanged.connect(self.on_doubleSpinBox_1_valueChanged)# \"\"\n\n self.checkBox_1 = QtWidgets.QCheckBox(self.centralwidget)\n self.checkBox_1.setChecked(False)\n# self.checkBox_1.clicked.connect(self.on_checkBox_1_clicked)\n\n self.doubleSpinBox_2 = QtWidgets.QDoubleSpinBox(self.centralwidget)\n self.doubleSpinBox_2.setMinimum(0.0)\n self.doubleSpinBox_2.setMaximum(10000.0)\n self.doubleSpinBox_2.setSingleStep(1.0)\n self.doubleSpinBox_2.setValue(self.FontTextSize)\n self.doubleSpinBox_2.valueChanged.connect(self.on_doubleSpinBox_2_valueChanged)#connect on def \"on_doubleSpinBox_2_valueChanged\"\n\n self.PU_Exit = QtWidgets.QPushButton(self.centralwidget)\n self.PU_Exit.setIcon(QtGui.QIcon(QtGui.QPixmap(quitIcon))) # icone dans une variable \n self.PU_Exit.clicked.connect(self.on_PU_Exit)\n\n self.PB_OK = QtWidgets.QPushButton(self.centralwidget)\n self.PB_OK.setIcon(QtGui.QIcon(QtGui.QPixmap(validIcon))) # icone dans une variable \n self.PB_OK.clicked.connect(self.on_PB_OK)\n \n self.PB_newPathFont = QtWidgets.QPushButton(self.centralwidget)\n self.PB_newPathFont.setIcon(QtGui.QIcon(QtGui.QPixmap(folderNewIcon)))# icone dans une variable \n self.PB_newPathFont.clicked.connect(self.on_PB_newPathFont)\n\n self.PB_systemPath = QtWidgets.QPushButton(self.centralwidget)\n self.PB_systemPath.setIcon(QtGui.QIcon(QtGui.QPixmap(homeIcon))) # icone dans une variable \n self.PB_systemPath.clicked.connect(self.on_PB_systemPath)\n\n self.PB_Help = QtWidgets.QPushButton()\n self.PB_Help.setIcon(QtGui.QIcon(QtGui.QPixmap(helpIcon))) # icone dans une variable \n self.PB_Help.clicked.connect(self.on_PB_Help)\n ####\n self.comboBoxPy = QtWidgets.QComboBox(self.centralwidget)\n ui.searchFont(PolicePath)\n# ui.on_fontComboBoxPython(self.index)\n QtCore.QObject.connect(self.comboBoxPy, QtCore.SIGNAL(\"currentIndexChanged(int)\"), self.on_fontComboBoxPython)\n ####\n\n ####Layout#########################################################\n gridLayout_00_Font = QtWidgets.QGridLayout(self.centralwidget) # cadre principal\n gridLayout_00_Font.addWidget(self.groupBox_00) # cadre groupbox principal\n gridLayout_01_Font = QtWidgets.QGridLayout(self.groupBox_00) # groupBox_00\n\n self.gridLayout_Font_Font = QtWidgets.QGridLayout(self.groupBox_01)\n self.gridLayout_Font_Font.setContentsMargins(10, 10, 10, 10)\n self.gridLayout_Font_Font.addWidget(self.textEditFont, 0, 0, 1, 1)\n self.gridLayout_Font_Font.addWidget(self.lineEdit_NameFile, 1, 0, 1, 1)\n self.gridLayout_Font_Font.addWidget(self.comboBoxPy, 2, 0, 1, 1)\n gridLayout_01_Font.addWidget(self.groupBox_01, 0, 0, 1, 1)\n ####\n self.gridLayout_Command_Font = QtWidgets.QGridLayout(self.groupBox_02)\n self.gridLayout_Command_Font.setContentsMargins(10, 10, 10, 10)\n self.gridLayout_Command_Font.addWidget(self.PB_color, 0, 0, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.doubleSpinBox_1, 0, 1, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.checkBox_1, 0, 3, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.doubleSpinBox_2, 0, 4, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.PU_Exit, 1, 0, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.PB_OK, 1, 1, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.PB_newPathFont, 1, 2, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.PB_systemPath, 1, 3, 1, 1)\n self.gridLayout_Command_Font.addWidget(self.PB_Help, 1, 4, 1, 1)\n gridLayout_01_Font.addWidget(self.groupBox_02, 1, 0, 1, 1)\n ####Layout#########################################################\n\n MainWindow.setCentralWidget(self.centralwidget)\n self.retranslateUi(MainWindow)\n QtCore.QMetaObject.connectSlotsByName(MainWindow)\n\n def retranslateUi(self, MainWindow):\n\n MainWindow.setWindowTitle(_fromUtf8(__title__))\n MainWindow.setWindowFlags(PySide2.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenetre en avant\n MainWindow.setWindowIcon(QtGui.QIcon(_fromUtf8(self.path + \"Macro_Fonts_Win10_PYMP.png\"))) # change l'icone de la fenetre principale\n\n self.groupBox_00.setTitle(_fromUtf8(\"ver : \" + __version__ + \" : \" + __date__ + \" (rmu)\"))\n self.groupBox_01.setTitle(_fromUtf8(\"Font\"))\n self.textEditFont.setText(\"Your text here\")\n self.textEditFont.setToolTip(\"Your text here\" + \"\\n\"\n \"Title (\" + str(self.index + 1) + \"/\" + str(len(self.tableau)) + \") = (index file, number file font)\" + \"\\n\"\n \"Version \" + __version__ + \" : \" + __date__ + \") of \" + __title__ + \")\" + \"\\n\\n\"\n \"It is possible that a font is not visible in its normal design,\" + \"\\n\"\n \"but it is normal in the 3DView, sorry !\")\n self.lineEdit_NameFile.setToolTip(\"Complete path and name of Font file\")\n self.comboBoxPy.setToolTip(\"Choice your Font\" + \"\\n\" +\n \"\\n\" +\n \"You must modify the configuration of display\" + \"\\n\" +\n \"Menu Edit parameter: User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__ + \":\" + \"\\n\" +\n \"####\" + \"\\n\" +\n \"switchModeTextList= 1\\t# 0 = mode text normal (the switchFontComBox is enabled)\" + \"\\n\"\n \"\\t\\t\\t# 1 = switchFontComBox authorized (default)\" + \"\\n\"\n \"\\t\\t\\t#####\" + \"\\n\"\n \"switchFontComBox = 1\\t# 0 = mode text in color .. faster\" + \"\\n\"\n \"\\t\\t\\t# 1 = fontFamily listed ComboBox slower but beautiful (default)\" + \"\\n\"\n \"\\t\\t\\t#####\" + \"\\n\"\n \"setSystemFonts = 1\\t# 0 = matplotlib.font_manager.findSystemFonts\" + \"\\n\"\n \"\\t\\t\\t# all fonts in System font\" + \"\\n\"\n \"\\t\\t\\t# 1 = fontman.findSystemFonts(self.pathFont) (default)\" + \"\\n\"\n \"\\t\\t\\t# all fonts in all directory and sub directory\" + \"\\n\"\n \"\\t\\t\\t#####\" + \"\\n\"\n \"seTtextAlignement = 0\\t# 0 = AlignLeft (default)\" + \"\\n\"\n \"\\t\\t\\t# 1 = AlignCenter\" + \"\\n\"\n \"\\t\\t\\t# 2 = AlignRight\" + \"\\n\"\n \"\\t\\t\\t#####\" + \"\\n\"\n \"setFontByDefault = \"\"ARIAL\"\"\\t # ARIAL\" + \"\\n\"\n \"\\t\\t\\t#####\" + \"\\n\"\n \"setLastFontPath = PolicePath# directory font by start\" + \"\\n\"\n \"####\" + \"\\n\"\n \"Actual configuration : \" + str(switchModeTextList) + \", \" + str(switchFontComBox) + \", \" + str(setSystemFonts) + \", \"\n + str(seTtextAlignement) + \", \" + setFontByDefault + \", \" + setLastFontPath + \"\\n\"\n \"####\" + \"\\n\" +\n \"Read the info\")\n ####\n self.groupBox_02.setTitle(_fromUtf8(\"Command\"))\n self.PB_OK.setText(_fromUtf8(\"Ok\"))\n self.PB_OK.setToolTip(_fromUtf8(\"Validate\"))\n self.PB_color.setText(_fromUtf8(\"Color\"))\n self.PB_color.setToolTip(_fromUtf8(\"Text color\"))\n self.doubleSpinBox_1.setToolTip(_fromUtf8(\"Dimension of the Shape\"))\n self.doubleSpinBox_1.setSuffix(\" mm\")\n self.checkBox_1.setText(_fromUtf8(\"Text\"))\n self.checkBox_1.setToolTip(_fromUtf8(\"Create text\"))\n self.PB_newPathFont.setText(_fromUtf8(\"New folder\"))\n self.PB_newPathFont.setToolTip(_fromUtf8(\"New directory font\"))\n self.doubleSpinBox_2.setToolTip(_fromUtf8(\"Dimension of text in window macro\"))\n self.PU_Exit.setText(_fromUtf8(\"Exit\"))\n self.doubleSpinBox_2.setSuffix(\" mm\")\n self.PU_Exit.setToolTip(_fromUtf8(\"Quit Fonts Win10 PYMP by by\"))\n self.PB_Help.setText(_fromUtf8(\"Help\"))\n self.PB_Help.setToolTip(_fromUtf8(\"Help on line \" + __version__ + \" \" + __date__ + \" rmu\"))\n self.PB_systemPath.setText(_fromUtf8(\"Origin\"))\n self.PB_systemPath.setToolTip(_fromUtf8(\"Return origin font system\"))\n\n def on_doubleSpinBox_1_valueChanged(self,value): # \n\n self.FontSize = value\n\n def on_doubleSpinBox_2_valueChanged(self,value):\n\n self.FontTextSize = value\n self.font.setPointSize(self.FontTextSize)\n self.textEditFont.setCurrentFont(self.font)\n self.textEditFont.setFont(self.font)\n\n def on_fontComboBoxPython(self,indeX): # 0: for fontComboBoxPython\n global setFontByDefault\n\n self.index = indeX\n self.lineEdit_NameFile.setText(\"(\" + str(self.index + 1) + \"/\" + str(len(self.tableau)) + \") \" + self.tableau[self.index][1])\n\n famille = typeCar = self.font = \"\"\n self.font = QtGui.QFont()\n typeCar = family(self.tableau[self.index][2])[1]\n self.font.setBold(False)\n self.font.setItalic(False)\n\n if len(typeCar) > 0:\n for option in typeCar:\n if option == \"Bold\":\n self.font.setBold(True)\n if (option == \"Italic\") or (option == \"It\") or (option == \"Slanted\"):\n self.font.setItalic(True)\n if option == \"Oblique\":\n self.font.setItalic(True)\n #'Bold''Regular''Slanted''Italic''Medium''Extra''Light''Condensed''Black''It''Semibold'#+\n \n self.font.setFamily(self.tableau[self.index][5])\n self.font.setPointSize(self.FontTextSize)\n\n self.textEditFont.setCurrentFont(self.font)\n self.textEditFont.setFont(self.font)\n ####\n self.fonteComp = self.tableau[self.index][1]\n setFontByDefault = self.tableau[self.index][2]\n# FreeCAD.Console.PrintMessage(str(self.index) + \" , \" + self.tableau[self.index][1] + \" , \" + self.tableau[self.index][2] + \" , ' \" + famille + \"' , ' \" + typeCar + \" ' \\n\")\n\n def on_PB_OK(self):\n texte = self.textEditFont.toPlainText()\n if texte != \"\":\n tx = Draft.makeShapeString(String=texte, FontFile = self.fonteComp, Size = self.FontSize, Tracking = 0.0)\n tx.Label = self.tableau[self.index][2]\n tx.ViewObject.ShapeColor = (self.red, self.green, self.blue) # color of ShapeString\n\n ## section Texte\n if self.checkBox_1.isChecked():\n tx2 = Draft.makeText([texte],point=FreeCAD.Vector(0.0,0.0,0.0))\n tx2.ViewObject.FontName = self.tableau[self.index][1]\n tx2.ViewObject.TextColor = (self.red, self.green, self.blue) # color of text\n tx2.ViewObject.FontSize = self.FontSize\n tx2.Label = self.tableau[self.index][2]\n \n FreeCAD.Console.PrintMessage(\"___________________\" + \"\\n\")\n FreeCAD.Console.PrintMessage(texte + \"\\n\")\n FreeCAD.Console.PrintMessage(self.tableau[self.index][1] + \"\\n\")\n FreeCAD.Console.PrintMessage(self.tableau[self.index][2] + \"\\n\")\n FreeCAD.Console.PrintMessage(str(self.FontSize) + \"\\n\")\n FreeCAD.Console.PrintMessage(\"___________________\" + \"\\n\")\n FreeCAD.ActiveDocument.recompute()\n else:\n FreeCAD.Console.PrintMessage(\"Not string\" + \"\\n\")\n\n def on_PB_color(self):\n self.PB_color.setStyleSheet(\"background-color: QPalette.Base\")\n self.window.hide()\n couleur = QtWidgets.QColorDialog.getColor()\n if couleur.isValid():\n self.red = couleur.redF()\n self.green = couleur.greenF()\n self.blue = couleur.blueF()\n self.alpha = couleur.alphaF()\n self.PB_color.setStyleSheet(\"background-color: \" + couleur.name())\n self.window.show()\n\n def on_PB_newPathFont(self):\n global ui\n global newPolicePath\n global setSystemFonts\n global setLastFontPath\n\n self.PB_systemPath.setStyleSheet(\"background-color: QPalette.Base\")\n self.PB_newPathFont.setStyleSheet(\"background-color: QPalette.Base\")\n newPolicePath = str(QtWidgets.QFileDialog.getExistingDirectory(None, \"Select new font directory\", newPolicePath, QtWidgets.QFileDialog.ShowDirsOnly))\n if newPolicePath:\n setLastFontPath = newPolicePath\n ui.searchFont(newPolicePath)\n setSystemFonts = 1\n\n def on_PB_systemPath(self):\n global ui\n global setSystemFonts\n global originalFontPath\n global originalFontName\n global setLastFontPath\n global searchFontName\n \n self.PB_systemPath.setStyleSheet(\"background-color: QPalette.Base\")\n self.PB_newPathFont.setStyleSheet(\"background-color: QPalette.Base\")\n setSystemFonts = 1\n setLastFontPath = originalFontPath\n searchFontName = originalFontName\n ui.searchFont(originalFontPath)\n\n def on_PB_Help(self):\n WebGui.openBrowser(\"https://wiki.freecadweb.org/Macro_Fonts_Win10_PYMP\")\n App.Console.PrintMessage(\"https://wiki.freecadweb.org/Macro_Fonts_ Win10_PYMP\" + \"\\n\")\n\n def on_PU_Exit(self): # Exit\n global switchModeTextList\n global switchFontComBox\n global setSystemFonts\n global seTtextAlignement\n global setFontByDefault\n global setLastFontPath\n\n ###### Write Configuration begin ####\n FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).SetString(\"setLastFontPath\", setLastFontPath) # \"PolicePath\"\n FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).SetString(\"setFontByDefault\", setFontByDefault) # \"Arial\"\n FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).SetBool(\"switchModeTextList\", switchModeTextList) # True or False\n FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).SetBool(\"switchFontComBox\", switchFontComBox) # True or False\n FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).SetBool(\"setSystemFonts\", setSystemFonts) # True or False\n FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).SetInt(\"seTtextAlignement\", seTtextAlignement) # 0, 1, 2\n ###### Write Configuration end ####\n App.Console.PrintMessage(\"Fin \" + __title__ + \"\\n\")\n self.window.hide()\n####\nFreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Macros/FCMmacros/\" + __title__).SetString(\"Version\",__version__ + \" (\" + __date__ + \")\")# \n\ndoc = FreeCAD.ActiveDocument\nif doc == None:\n doc = FreeCAD.newDocument()\n\nMainWindow = QtWidgets.QMainWindow()\nui = Ui_MainWindow()\nui.setupUi(MainWindow)\nMainWindow.show()\n\n\n}}\n\n## Link\n\nThe forum [TTF Text Font](https://forum.freecadweb.org/viewtopic.php?t=28900)\n\nMy macros on [mario52a](https://gist.github.com/mario52a) gists\n\n## Version\n\nVersion = \\\"2.0 Date = 2020/06/06 : Layout adding button and icon\n\nVersion = \\\"00.01\\\" Date = \\\"2019/05/10\\\"\n\n\n---\n⏵ [documentation index](../README.md) > Macro Fonts Win10 PYMP/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_Normal_Vector.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_Normal_Vector.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_Normal_Vector.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5f099eb62cd15ef59828a65ca7b66f4c2f13330f6ba476da83c299ae7b054710", "bytes": 1032, "tokens": 377, "text": "# Macro Normal Vector/en\n{{Macro\n|Name=Normal Vector Macro\n|Icon=Macro_Normal_Vector.png\n|Description=Get normal vector of preselected face\n|Author=ulrich1a\n|Version=1.0\n|Date=2016-09-26\n|FCVersion=All\n|Download=[https://www.freecadweb.org/wiki/images/8/8b/Macro_Normal_Vector.png ToolBar Icon]\n}}\n\n## Description\n\nSimple macro to extract normal vector of previously within the 3D-View chosen face and give the output to the python console\n\n## Usage\n\n- Choose Face in 3D View.\n- Copy Macro code to python console.\n- FreeCAD will then display normal vector information in python console.\n- Use these values for setting up direction when creating a drawing view.\n\n## Script\n\nToolBar Icon ![](images/Macro_Normal_Vector.png )\n\n**Macro_Normal_Vector.FCMacro**\n\n\n{{MacroCode|code=\nGui.Selection.getSelectionEx()[0].SubObjects[0].Faces[0].normalAt(0,0)\n}}\n\n## Link\n\n[Link to dicussion thread (german)](http://forum.freecadweb.org/viewtopic.php?f=13&t=10959)\n\n\n---\n⏵ [documentation index](../README.md) > Macro Normal Vector/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_Parametric_Defeaturing.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_Parametric_Defeaturing.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_Parametric_Defeaturing.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c4a52623422ccd17e0bbea931aac08d31576fc1d716ec5f446aa5365b45ba91d", "bytes": 2952, "tokens": 962, "text": "# Macro Parametric Defeaturing/en\n{{Macro\n|Name=Macro Parametric Defeaturing\n|Icon=parametric_defeaturing.svg\n|Description=This macro is similar to the [defeaturing tool](Part_Defeaturing.md) in the [Part Workbench](Part_Workbench.md), but it's parametric and it also works in [PartDesign](PartDesign_Workbench.md). To use: select the faces of the features you wish to remove from the model and run the macro. Faces are used in defeaturing, not edges or vertices. The faces used may be edited later and the object will rebuild itself automatically.
\n\nParametric is generally a good thing in 3D modeling, but because defeaturing relies upon face names: Face1, Face2, etc. it is vulnerable to topological naming issues and might break if changes are made to the original source object being defeatured when those changes result in the face names getting renumbered. Defeaturing is also a somewhat finicky process, not guaranteed to always succeed.
\n\nFull documentation can be found on github: [https://github.com/mwganson/parametric_defeaturing Parametric Defeaturing].
\n\n|Author=TheMarkster\n|Version=0.2021.10.10.rev2\n|Date=2021-10-10.rev2\n|FCVersion=python 3 versions\n|Download=[https://wiki.freecadweb.org/File:parametric_defeaturing.svg ToolBar Icon]\n|Links=[https://github.com/mwganson/parametric_defeaturing Full Documentation on Github]\n}}\n\n## Description\n\nThis macro is similar to the [defeaturing tool](Part_Defeaturing.md) in the [Part Workbench](Part_Workbench.md), but it\\'s parametric and it also works in [PartDesign](PartDesign_Workbench.md). To use: select the faces of the features you wish to remove from the model and run the macro. Faces are used in defeaturing, not edges or vertices. The faces used may be edited later and the object will rebuild itself automatically.\n\nParametric is generally a good thing in 3D modeling, but because defeaturing relies upon face names: Face1, Face2, etc. it is vulnerable to topological naming issues and might break if changes are made to the original source object being defeatured when those changes result in the face names getting renumbered. Defeaturing is also a somewhat finicky process, not guaranteed to always succeed.\n\nFull documentation can be found on github: [Parametric Defeaturing](https://github.com/mwganson/parametric_defeaturing).\n\n\"\" \n*Macro Parametric Defeaturing screenshot‎*\n\n## Legend\n\n\n{{Codeextralink|https://gist.github.com/mwganson/0d55a5c51b1d6ff488b7a2f62bf50656/raw/140e9118deb955981a1ea499778cbf2521818e40/parametric_defeaturing.FCMacro|parametric_defeaturing.FCMacro}}\n\nToolBar Icon ![](images/parametric_defeaturing.svg )\n\n## Script\n\n**Macro parametric_defeaturing.FCMacro**\n\n\n{{CodeDownload|https://gist.github.com/mwganson/0d55a5c51b1d6ff488b7a2f62bf50656|parametric_defeaturing.FCMacro}}\n\n\n---\n⏵ [documentation index](../README.md) > Macro Parametric Defeaturing/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_Remove_parametric_history.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_Remove_parametric_history.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_Remove_parametric_history.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "99945fd15e0524cf634375b5649c6dde32a8ccdde93253fd6f050c9f84fe552e", "bytes": 1083, "tokens": 389, "text": "# Macro Remove parametric history/en\n{{Macro\n|Name=Remove parametric history\n|Icon=Macro_Remove_parametric_history.png\n|Description=This will remove all parametric associativity from an object, leaving it as a \"dumb\" shape\n|Author=Yorik\n|Version=1.0\n|Date=2011-08-01\n|FCVersion=All\n|Download=[https://www.freecadweb.org/wiki/images/b/b7/Macro_Remove_parametric_history.png ToolBar Icon]\n}}\n\n## Description\n\nThis will remove all parametric associativity from an object, leaving it as a \\\"dumb\\\" shape\n\nBefore and after:\n\n![](images/RPH_before.png )\n\n![](images/RPH_after.png )\n\n## Script\n\nToolBar Icon ![](images/Macro_Remove_parametric_history.png )\n\n**Remove parametric history.FCMacro**\n\n\n{{MacroCode|code=\n\noriginalObject = FreeCAD.ActiveDocument.ActiveObject\nnewShape = originalObject.Shape.copy()\nnewName = FreeCAD.ActiveDocument.ActiveObject.Name\nFreeCAD.ActiveDocument.removeObject(newName)\nnewObject = FreeCAD.ActiveDocument.addObject(\"Part::Feature\",newName)\nnewObject.Shape = newShape\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > Macro Remove parametric history/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_Rotate_To_Point.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_Rotate_To_Point.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_Rotate_To_Point.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "57cee4974743cb8f593c4b03be056df8ed2592a92e6c6e2f2011e99a31292205", "bytes": 8950, "tokens": 3027, "text": "# Macro Rotate To Point/en\n{{Macro\n|Name=Macro Rotate To Point\n|Icon=Macro_Rotate_To_Point.svg\n|Description=Macro to rotate an object on itself with the axis of rotation the: boundbox center, center of mass, direction of wire, or last point clicked. You must save in a file all coordinate worked and save it in a file \"Coordinate [(0.06,1.30,0.0),(85.0,0.0,0.0)],\" or in a complete macro with different options (Create serial image) for create one animation, increase/decrease, pause, yoyo ....\n|Author=Mario52\n|Version=00.11\n|Date=2022/10/17\n|FCVersion=0.19 and more\n|Download=[https://www.freecadweb.org/wiki/images/d/d1/Macro_Rotate_To_Point.svg ToolBar Icon]\n}}\n\n## Description\n\nMacro to rotate an object on itself with the axis of rotation the: boundbox center, center of mass, direction, path of wire, or last point clicked. You must save in a file all coordinate worked and save it in a file \\\"Coordinate \\[(0.06,1.30,0.0),(85.0,0.0,0.0)\\],\\\" or in a complete macro with different options (Create serial image) for create one animation, increase/decrease, pause, yoyo \\....\n\n\n{{Codeextralink|https://gist.githubusercontent.com/mario52a/2fc48333deca5a31e6232c29a9db5e4c/raw/d9419d4bb13e36940eb2f56c3c469ea4182827ee/Macro%2520Rotate%2520To%2520Point.FCMacro}}\n\n## Usage\n\n1. Download the macro from the [Addon Manager](Std_AddonMgr.md)\n2. Execute the macro\n3. Select one object\n4. Choose one of the following orientations:\n\n![Interface Rotate to point](images/Macro_Rotate_To_Point_00.png )\n\n### \\[1\\] Position Rotation \n\n*First operation*\n\n![ \\[1\\] Position Rotation](images/Macro_Rotate_To_Point_Position-Rotation00.png )\n\n- {{CheckBox|Translation}}: If this checkBox is {{CheckBox|TRUE|checked}} the rotation is disabled, the object placement is done on the axis selected.\n\n*The SpinBox {{SpinBox|1,00000 Degrees}} is reinitialized to `0.0` and coloured in red*\n\n- The time passed with your favourite macro is displayed.\n\n### \\[2\\] Translation Rotation \n\n*Second operation*\n\n![\\[2\\]Translation Rotation](images/Macro_Rotate_To_Point_Translation-Rotation00.png )\n\n### Point Rotation \n\n- Boundbox Center: Select the BoundBox center to axis rotation\n- Center of Mass: Select the Center of Mass to axis rotation\n- Point Clicked: Select the last mouse click as the point for axis rotation\n - 1: select the object\n - 2: use the **CTRL** key to choose an extra object\n\n### Axis Rotation \n\n- Rotation(Z) Yaw: Yaw axis\n- Rotation(Y) Pitch: Pitch axis\n- Rotation(X) Roll: Roll axis\n- Rotation(D) Direction: Rotate around line, wire selected\n- Follow the path: Follow the path created by the wire, line, edge.\n - 1: Select the object\n - 2: Select the path\n\n*The SpinBox {{SpinBox|1,00000 Degrees}} is reinitialized to `0.0` and coloured in red*\n\n### Coordinates Point clicked \n\n![Rotate To Point Coordinate-On-Point-Clicked](images/Macro_Rotate_To_Point_Coordinate-On-Point-Clicked_00.png )\n\n- DoubleSpinBox: Coordinate X on mouse click (modifiable only with the mode \\\"Point Clicked\\\")\n- DoubleSpinBox: Coordinate Y on mouse click (modifiable only with the mode \\\"Point Clicked\\\")\n- DoubleSpinBox: Coordinate Z on mouse click (modifiable only with the mode \\\"Point Clicked\\\")\n\n### \\[3\\] Work (Box : Cube) \n\n*Third operation*\n\n![Macro Rotate To Point Work](images/Macro_Rotate_To_Point_Work_00.png )\n\n- {{CheckBox|View}}: If checked, the view return on latest view of the object selected (work with comboBox below it) and all parameters restored.\n\n- **Point**: One point is created for visualise the point rotation axis: red X, green Y, blue Z.\n\n- **Center**: One point is created on center of circle.\n\n- {{ComboBox|Box}}: List of all objects used. The choice of the object here, the zoom *(if checkBox view is checked)* is returned and all parameters restored.\n\n- {{ComboBox|0}}: Select one predefined value.\n\n- {{ComboBox|1.0}}: Select the saved value used.\n\n- **- Invert**: Invert the sign Positif/Negatif of the value displayed.\n\n- {{SpinBox|1,00000 Degrees}}: Select the value.\n\n- **Apply**: Apply the modification to the object.\n\n- Line Edit: The line edit displays the original coordinate to axis selected + the input data given in the spinBox.\n\n- The coordinate is displayed\n\n### Data to save \n\n![Rotate To Point Data-To-Save](images/Macro_Rotate_To_Point_Data-To-Save_00.png )\n\n- Window for display the coordinates stored.\n\n- **Clear**: Delete and clean the text editor.\n\n- **Delete**: Delete the selected line in the window.\n\n- {{CheckBox|Memo on Click}}: If it is checked, the placement is automatically stored in the window with the \\\"Apply\\\" button.\n\n- **Memorize**: Store and display the coordinate in the window, the number of coordinate stored is displayed on this button.\n\n- **Save**: Save the data in file\n\n- {{CheckBox|Macro}}:\n\n - Mode normal {{CheckBox|Macro}} the coordinate is saved in this mode : `[\"Body004001\",(0.0,0.0,-1.5),(0.0,0.0,0.0)],`\n - Mode macro in a complete macro directly in your macros directory with the same name of the document with extension .FCMacro\n - **Options of the macro**\n - **\\_\\_pompe\\_\\_\\_\\_engrenage\\_\\_** : Name of document\n - **\\_\\_22 Coordinates\\_\\_** : number of coordinates\n - **Type Key Q to Quit** : Quit the macro\n - **Type Key A to Create serial image** : for create serial usage to create Animate GIF (with Gimp or other)\n - **Type Key D to Decrease speed** : Decrease the speed of the animation\n - **Type Key I to Increase speed** : Increase the speed of the animation\n - **Type Key P to Pause/Continue or key RETURN or ESCAPE** : Pause / Anime\n - **Type Key S to Step by Step (key RETURN or ESCAPE to continue)** : Step by Step\n - **Type Key V to reVerse** : reVerse the video\n - **Type Key Y to YoYo** : begin to end reverse end to begin\n - **Type Key M for this message** : Display this Memo\n - For use this options click mouse in the 3D view and type the key desidered\n - \\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\n - Mode normal {{CheckBox|Memo on Click}} : The data is not saved on window, you must push the **Memo (2)** button for save the coordinate\n - Mode Memo on Click {{CheckBox|TRUE|Memo on Demand}} : The data is automaticly saved with all click op the **Apply** button\n\n- **Copy**: Memorize the content of the window in a Rotate_To_Point format : `[\"Body004001\",(0.0,0.0,-1.5),(0.0,0.0,0.0)],`\n\n### Command\n\n![Rotate To Point Command](images/Macro_Rotate_To_Point_Command_00.png )\n\n- **Quit**: Quit the macro\n\n- **Original**: After modifying the data of the object you can return to the original placement, If you have not deselected the current object.\n\n- ** 0,0,0 **: This option places the object in base coordinate `0, 0, 0`.\n\n- **Reset**: Reset the data in the macro and deselect the current object.\n\nToolBar PNG Icon ![](images/Macro_Rotate_To_Point.png ) and ToolBar SVG Icon ![](images/Macro_Rotate_To_Point.svg )\n\n## Example\n\n![](images/Macro_Rotate_To_Point_01.gif )\n\n## Links\n\nThe forum [feature req: placement - rotate part around its midpoint](http://forum.freecadweb.org/viewtopic.php?f=8&t=20925)\n\nMy macro on Gist [mario52a](https://gist.github.com/mario52a)\n\n## Version\n\n2022/10/17 Version=00.11 : new organization GUI, Follow the path, View on object, Button Copy, adding menu Image on macro saved, add \\\"QtWidgets.QScrollArea()\\\"\n\n2021/03/08 Version=00.10 : adding zoom on object clicked, memory value, imposted values\n\n2021/02/25 Version=00.09 : correct the macro : cause multi object possible\n\n\n{{Code|\nApp.ActiveDocument.getObject(p[0]).Placement\n}}\n\ninstead {{Code|\nmyObject.Placement\n}}\n\n2021/02/22 Version=00.08c : correct the center facePoint (19h26 Paris)\n\n2021/02/22 Version=00.08b : correct the center facePoint (17h23 Paris)\n\n2021/02/22 Version=00.08 : adding save macro with multi objects moved\n\n2021/01/24 Version=00.07 : adding option R: reverse\n\n2021/01/12 ver 00.06 : adding the Data section and more options\n\n2020/03/07 ver 00.05.2 : correct the bug translation delete \\\"direction = myObject.Placement.Rotation.multVec(direction)\\\"\n\n2020/03/01 ver 00.05.1 : correct the position of the test \\\"FreeCAD version\\\"\n\n2020/02/29 ver 00.05 : convert to Hdpi (Layout) and add Direction\n\n06/04/2019 ver 00.04 : Python 3\n\n29/03/2018 ver 00.03 : comment the \\\"FreeCAD.ActiveDocument.recompute()\\\" the change value are too slow with complex element in FreeCAD 0.17\\.... see [FC0.17 recompute strange behaviour (regression)](https://www.forum.freecadweb.org/viewtopic.php?f=10&t=27732&p=224195#p224195)\n\n27/03/2017 ver 00.02 : modify the spinbox \\\"Pos\\\" now accept the negative values\n\n05/03/2017 ver 00.01 : add 3 spinbox for displayed the coordinates X Y Z on click mouse\n\n04/03/2017 ver 00.00\n\n\n---\n⏵ [documentation index](../README.md) > Macro Rotate To Point/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_TemplateHelper.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_TemplateHelper.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_TemplateHelper.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5735f426c3e61a56b96b92351b0e9c7be0a42141dd14a364b978a858a62e2d5a", "bytes": 66209, "tokens": 24072, "text": "# Macro TemplateHelper/en\n{{Macro\n|Name=Macro TemplateHelper\n|Description=This macro generates a template to use with the TechDraw workbench and adds a new page with a new template object to the active dokument, ready to place views on it. And it can supply a bill of material (BOM), if wanted.\n|Author=FBXL5\n|Date=2023-12-26\n|Version=00.02\n|SeeAlso=[TechDraw TemplateGenerator](TechDraw_TemplateGenerator.md)\n}}\n\n## Description\n\nIf you are tired of retyping information whenever you insert another page into your FreeCAD document or if you prefer a \\\"drawn\\\" bill of material (BOM) over an inserted spread sheet this macro is for you.\n\nThis macro generates a TechDraw template on the fly and inserts it into the active document, ready to get new views added.\n\nIf you wish, you can fill the space between the title block and the upper border of the drawing area with a BOM. You choose how many lines you need or if you fill the whole space.\n\n\"\" \n*Page with macro generated template, ISO A3 + bill of material*\n\n## Usage\n\n1. Open a FreeCAD file or add a new one.\n2. Find the macro file in your macro directory using \"\" [Macros\\...](Std_DlgMacroExecute.md) and select it.\n\n : (The Script section below describes how to put it there.)\n3. Press **Execute** to start the macro.\n4. Select the page format.\n5. Select the language for the title block.\n6. If you need a BOM change the number of rows:\n\n : You can use the right mouse button to reset to 0 or\n : to set the maximum number of rows that fits on your chosen page size.\n7. Click **OK** to finish.\n\n## Dialogue window \n\n\"\" \n*Dialogue window on launch*\n\n\"\" \n*Language options*\n\nEnglish is default and just one version, but maybe someone likes to distinguish \\'merican and bri\\'ish English in the future\\... :-D\n\n\"\" \n*Format options, yet without A4- (landscape)*\n\n\"\" \n*BOM options*\n\n## Script\n\nThe Macro should be found in the macro directory. To put it there, you need to:\n\n1. Select the macro below (from **#! pyth\\...** to **\\...main()**).\n2. Copy the selection.\n3. Create a new macro file using \"\" [Macros\\...](Std_DlgMacroExecute.md) and select **Create**.\n4. Type in the name (TemplateHelper) and select **OK**. (*.FCMacro* is added automatically.)\n5. Paste the clipboard content into the Editor window.\n6. Press \"\" [Execute macro](Std_DlgMacroExecuteDirect.md) to start the macro.\n\n\n
\n\n**TemplateHelper.FCMacro**\n\n\n
\n\n\n{{MacroCode|code=\n#! python\n# -*- coding: utf-8 -*-\n# (c) 2021 , LGPL\n# Thanks to WRS for some very helpful suggestions.\n\"\"\"\nThis script generates or overwrites a TechDraw Template file (MyTemplate.svg)\nand then adds it to the active FreeCAD document.\n\nGUI section:\n1. It reads the Language parameter from the preferences to customise the\n user interface (DE and EN are finished and I tried my best with IT and FR)\n2. It checks if you have assigned a template directory in your TechDraw preferences yet!\n3. It checks if a FreeCAD file is opened.\n If either is False nothing will be generated.\n4. You can choose a language for the title block labelling (fix texts).\n (DE, EN, IT, FR available)\n5. You can choose one from several drawing formats.\n (ISO is finished but ANSI and Arch formats need tweaking)\n6. If you need a bill of material you can enter the needed number of rows (lines).\n Right mouse action lets you reset the value to (default) 0 or to the maximum\n of rows which was set when the format was chosen.\n7. You can choose to cancel or to execute the creation.\n\nTemplate creation:\n8. A template file (MyTemplate.svg) will be generated and\n saved into your template directory. (You can use it like any other template\n or save it for later reuse until it is overwritten by the next macro run)\n\nInsertion sction:\n9. It adds new page object and a new temlate object to the active FreeCAD file.\n10. \"MyTemplate.svg\" is loaded into the templated object.\n11. Some editable texts are altered depending on allready existing pages:\n On all first page:\n - author's name\n - date of creation (current date)\n - format\n On any but the first page these are copied from the first page to the current:\n - Owner's details\n - Copyright info\n - Title and part number\n - CAD version\n and the total number of sheets is updated on all Pages\nIn contrast to manually inserted pages and templates these pages and templates\nare numbered with only 2 digits and afterwards their labels are changed\nfrom page to Blatt/Sheet/Feuille/Pagina + the two digit number.\n\nSome entries could be handled by follow-up macros now.\n\n!!! It is strongly recommended to save,close and reopen\n the active document before adding another page,\n especially with another format.\n The previously generated editable texts will slip to the\n!!! current positions of the newly generated ones\n\nI have tried to follow this naming rule:\n class names: CamelCase\n function names: mixedCase\n constant names: ALL_CAPITAL + underscore\n variable names: lower_case + underscore\n\"\"\"\n\n__Name__= \"Template Helper\"\n__Comment__ = \"Template generator, Page adder, BOM provider\"\n__Author__ = \"FBXL5\"\n__Version__ = \"00.02\"\n__Date__ = \"2023-12-26\"\n__License__ = \"LGPL-2.0-or-later as FreeCAD\"\n__Web__ = \"\"\n__Wiki__ = \"http://www.freecad.org/wiki/index.php?title=Macro_TemplateHelper\"\n__Icon__ = \"\"\n__IconW__ = \"\"\n__Help__ = \"Start the macro and see what happens\"\n__Status__ = \"Alpha\"\n__Requires__ = \"FreeCAD >= 0.19 + Python3 \"\n__Communication__ = \"http://www.freecad.org/wiki/index.php?title=User: FBXL5\"\n__Files__ = \"\"\n\n# imports and constants\nimport time, os # built-in modules\nfrom PySide2 import QtCore\nfrom PySide2.QtWidgets import (QDialog, QPushButton, QLabel, QComboBox,\n QLineEdit, QAction, QDoubleSpinBox)\n\n# - SVG creation -\n\nclass ToteBag:\n pass\n# This class is empty to act as a container for several variables\n\nborders = ToteBag() #- one bag for drawing border offsets\nsheet_format = ToteBag() #- one bag for page dimensions\ntitle_block = ToteBag() #- one bag for title block static texts\nbom_list = ToteBag() #- one bag for bill of material\nowner_data = ToteBag() #- one bag for owner's data and copyright info\n\nclass InputWindow(QDialog):\n \"\"\"\n This provides a user interface to set some properties.\n \"\"\"\n def __init__(self):\n super(InputWindow, self).__init__()\n self.initUI()\n\n def initUI(self):\n # set some defaut values\n #- Get the path to the template folder that is set in the FreeCAD parameters\n parameter_path = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/Mod/TechDraw/Files\")\n template_path = parameter_path.GetString(\"TemplateDir\")\n template_name = \"MyTemplate.svg\"\n #- Link template_path and template_name for any OS\n self.template_file = os.path.join(template_path, template_name)\n\n parameter_path = FreeCAD.ParamGet(\"User parameter:BaseApp/Preferences/General\")\n app_language = parameter_path.GetString(\"Language\")\n self.setWindowTexts(app_language)\n\n self.result = \"Cancelled\" # Default return status\n # the window has 640 x 480 pixels and is centered by default\n #- set window dimensions\n self.setMaximumWidth(400)\n self.setMaximumHeight(350)\n self.setWindowTitle(self.text_window)\n self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)\n\n if template_path == \"\":\n # create some labels\n self.text_template_directory = (\"\" +\n \"You haven't assigned a template directory \\n\" +\n \"in your TechDraw preferences yet! \\n\\n\" +\n \"Have a look at: \\n Preferenes \\n - TechDraw \\n - \" +\n \"General \\n - Template Directory\")\n self.label_format = QLabel(self.text_template_directory, self)\n self.label_format.setStyleSheet(\"\"\"\n background-color: #f0ddbb;\n font-size: 14px;\n \"\"\")\n #- OK button\n self.ok_button = QPushButton(self.text_ok, self)\n self.ok_button.clicked.connect(self.onCancel)\n self.ok_button.move(200, 300)\n\n elif FreeCAD.activeDocument() == None:\n # create some labels\n self.text_template_directory = (\"\" +\n \"No active FreeCAD file found! \\n\\n\" +\n \"Open a FreeCAD file before \\n\" +\n \"launching this macro. \\n\")\n self.label_format = QLabel(self.text_template_directory, self)\n self.label_format.setStyleSheet(\"\"\"\n background-color: #f0ddbb;\n font-size: 22px;\n \"\"\")\n #- OK button\n self.ok_button = QPushButton(self.text_ok, self)\n self.ok_button.clicked.connect(self.onCancel)\n self.ok_button.move(200, 300)\n\n else:\n # create some labels\n self.label_format = QLabel(self.text_format, self)\n self.label_format.move(20, 90)\n self.label_language = QLabel(self.text_language, self)\n self.label_language.move(20, 20)\n self.label_BOM_rows = QLabel(self.text_bom, self)\n self.label_BOM_rows.move(20, 160)\n self.label_warning = QLabel(self.text_warning, self)\n self.label_warning.move(20, 260)\n # set up lists for pop-ups\n self.format_list = (\"ISO A0\",\"ISO A1\",\"ISO A2\",\"ISO A3\",\"ISO A4\",\"ISO A4-\",\\\n \"ANSI A\",\"ANSI B\",\"ANSI C\",\"ANSI D\",\"ANSI E\",\\\n \"Arch A\",\"Arch B\",\"Arch C\",\"Arch D\",\"Arch E\",\"Arch E1\")\n self.language_list = (\"DE\",\"FR\",\"IT\",\"UK\",\"US\")\n # create some result containers and set default values\n self.result_format = \"ISO A4\"\n self.result_language = \"UK\"\n # create some input elements\n #- set up pop-up menu - ComboBox - Format\n self.popup_format = QComboBox(self)\n self.popup_format.setToolTip(self.tooltip_format)\n self.popup_format.move(200, 100)\n self.popup_format.addItems(self.format_list)\n self.popup_format.setCurrentIndex(self.format_list.index(\"ISO A4\"))\n self.popup_format.activated[str].connect(self.onPopupFormat)\n #- set up pop-up menu - ComboBox - Language\n self.popup_language = QComboBox(self)\n self.popup_language.setToolTip(self.tooltip_language)\n self.popup_language.move(200, 20)\n self.popup_language.addItems(self.language_list)\n self.popup_language.setCurrentIndex(self.language_list.index(\"UK\"))\n self.popup_language.activated[str].connect(self.onPopupLanguage)\n # set up text input field - Number of BOM rows\n self.input_BOM_rows = QDoubleSpinBox(self)\n self.input_BOM_rows.setToolTip(self.tooltip_bom)\n self.input_BOM_rows.setMinimum(0)\n self.input_BOM_rows.setMaximum(34) # default value for ISO A4\n self.input_BOM_rows.setDecimals(0) # no decimals\n self.input_BOM_rows.setValue(0) # no BOM as default\n self.input_BOM_rows.move(200, 180)\n self.input_BOM_rows.setFixedWidth(60)\n # set contextual menu options for text editing widget\n # reset text field to default\n self.BOM_action1 = QAction(self)\n self.BOM_action1.setText(self.text_none)\n self.BOM_action1.triggered.connect(self.onBOMAction1)\n # set tex maximum\n self.BOM_action2 = QAction(self)\n self.BOM_action2.setText(self.text_maximum)\n self.BOM_action2.triggered.connect(self.onBOMAction2)\n # define RMB-menu and add options\n self.input_BOM_rows.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)\n self.input_BOM_rows.addAction(self.BOM_action1)\n self.input_BOM_rows.addAction(self.BOM_action2)\n\n #- cancel button\n self.cancel_button = QPushButton(self.text_cancel, self)\n self.cancel_button.clicked.connect(self.onCancel)\n self.cancel_button.setAutoDefault(False) # no AutoDefault with okButton!\n self.cancel_button.move(80, 300)\n #- OK button\n self.ok_button = QPushButton(self.text_ok, self)\n self.ok_button.clicked.connect(self.onOk)\n self.ok_button.move(200, 300)\n\n # now make the window visible\n self.show()\n\n def setWindowTexts(self, lang):\n if lang == \"German\":\n self.text_format = \"Gewünschtes Blattformat \\nauswählen\"\n self.text_language = \"Sprache für Schriftfeld \\nund Stückliste auswählen\"\n self.text_bom = (\"Bei Bedarf \\nAnzahl erforderlicher\"+\n \" \\nStücklistenzeilen eingeben\")\n self.text_window = \"Dialogfenster\"\n self.text_cancel = \"Abbrechen\"\n self.text_ok = \"OK\"\n self.text_none = \"Keine\"\n self.text_maximum = \"Maximal\"\n self.text_warning = (\"Nicht vergessen, die Datei zu \\nSpeichern, Schließen \" +\n \"und wieder zu Öffnen!\")\n self.tooltip_format = (\"Die Auswahl eines Blattformats \\nsetzt \"+\n \"die Anzahl der Stücklistenzeilen \\nauf 0 zurück\")\n self.tooltip_language = \"Sprache des Schriftfeldes auswählen\"\n self.tooltip_bom = (\"Die Anzahl der \\nStücklistenzeilen\"+\n \" \\neingeben oder mit \\nder rechten Maustaste \\n\\\"Keine\\\" oder \\n\\\"Maximal\\\" auswählen\")\n elif lang == \"French\":\n self.text_format = \"Sélectionnez le format \\nde page de votre choix\"\n self.text_language = \"Sélectionnez language de le \\ncartouche et la liste des pièces\"\n self.text_bom = \"Entrer nombre de lignes \\npour la liste des pièces, \\nau besoin\"\n self.text_window = \"Fenêtre de dialogue\"\n self.text_cancel = \"Annuler\"\n self.text_ok = \"OK\"\n self.text_none = \"Aucun\"\n self.text_maximum = \"Maximum\"\n self.text_warning = \"Don't forget to Save, Close \\nand Reopen the file!\"\n self.tooltip_format = (\"Selecting a sheet format \\n\"+\n \"resets the number \\nof BOM rows to 0\")\n self.tooltip_language = \"Select language of the title block\"\n self.tooltip_bom = (\"Enter the number \\nof BOM rows or use \\n\"+\n \"right mouse buton \\nto select \\\"Aucun\\\" or \\n\\\"Maximum\\\"\")\n elif lang == \"Italian\":\n self.text_format = \"Selezionare il formato \\ndesiderato\"\n self.text_language = \"Selezionare lingua del \\ncartiglio e la lista dei pezzi\"\n self.text_bom = \"Inserire numero delle linee \\nper la lista dei pezzi, \\nall'occorrenza\"\n self.text_window = \"Finestra di dialogo\"\n self.text_cancel = \"Annulla\"\n self.text_ok = \"OK\"\n self.text_none = \"Nessuno\"\n self.text_maximum = \"Massimo\"\n self.text_warning = \"Don't forget to Save, Close \\nand Reopen the file!\"\n self.tooltip_format = (\"Selecting a sheet format \\n\"+\n \"resets the number \\nof BOM rows to 0\")\n self.tooltip_language = \"Select language of the title block\"\n self.tooltip_bom = (\"Enter the number \\nof BOM rows or use \\n\"+\n \"right mouse buton \\nto select \\\"Nessuno\\\" or \\n\\\"Massimo\\\"\")\n else:\n self.text_format = \"Select desired \\nsheet format\"\n self.text_language = \"Select language for \\nthe title block and BOM\"\n self.text_bom = \"Enter number of rows \\nfor a BOM, if required\"\n self.text_window = \"Dialogue window\"\n self.text_cancel = \"Cancel\"\n self.text_ok = \"OK\"\n self.text_none = \"None\"\n self.text_maximum = \"Maximum\"\n self.text_warning = \"Don't forget to Save, Close \\nand Reopen the file!\"\n self.tooltip_format = (\"Selecting a sheet format \\n\"+\n \"resets the number \\nof BOM rows to 0\")\n self.tooltip_language = \"Select language of the title block\"\n self.tooltip_bom = (\"Enter the number \\nof BOM rows or use \\n\"+\n \"right mouse buton \\nto select \\\"None\\\" or \\n\\\"Maximum\\\"\")\n\n def onPopupFormat(self, selected_text):\n self.result_format = selected_text\n # WRS suggestion:\n max_row = 0\n # Set the maximum number of rows for the chosen format\n if selected_text == \"ISO A4-\":\n max_row = 18\n elif selected_text == \"ISO A4\":\n max_row = 34\n elif selected_text ==\"ISO A3\":\n max_row = 34\n elif selected_text ==\"ISO A2\":\n max_row = 54\n elif selected_text ==\"ISO A1\":\n max_row = 83\n elif selected_text ==\"ISO A0\":\n max_row = 125\n\n elif selected_text ==\"ANSI A\":\n max_row = 31\n elif selected_text ==\"ANSI B\":\n max_row = 31\n elif selected_text ==\"ANSI C\":\n max_row = 56\n elif selected_text ==\"ANSI D\":\n max_row = 78\n elif selected_text ==\"ANSI E\":\n max_row = 128\n\n elif selected_text ==\"Arch A\":\n max_row = 35\n elif selected_text ==\"Arch B\":\n max_row = 35\n elif selected_text ==\"Arch C\":\n max_row = 61\n elif selected_text ==\"Arch D\":\n max_row = 86\n elif selected_text ==\"Arch E\":\n max_row = 137\n elif selected_text ==\"Arch E1\":\n max_row = 111\n else:\n max_row = 0\n\n self.input_BOM_rows.setMaximum(max_row) # max. value for selectd format\n self.input_BOM_rows.setValue(0) # reset default value\n\n def onPopupLanguage(self, selected_text):\n self.result_language = selected_text\n\n def onBOMAction1(self):\n # no bill of material\n self.input_BOM_rows.setValue(0)\n\n def onBOMAction2(self):\n # max. rows for selected format\n self.input_BOM_rows.setValue(self.input_BOM_rows.maximum())\n\n def onCancel(self):\n self.result = \"Cancelled\"\n self.close()\n\n def onOk(self):\n self.result = \"OK\"\n self.close()\n\n#- set values according to ISO, ANSI, Arch\ndef setBorderValues(format):\n # customise values if needed\n # I assume ANSI and Arch need different values but as long as I'm not sure\n # these settings are quite redundant but are not removed\n if format[0:3] == \"ANS\":\n borders.drawing_area_top = 10 # distance from page boundary\n borders.drawing_area_bottom = 10\n borders.drawing_area_left = 20\n borders.drawing_area_right = 10\n borders.sheet_frame_top = 5 # distance from drawing area border\n borders.sheet_frame_bottom = 5\n borders.sheet_frame_left = 5\n borders.sheet_frame_right = 5\n elif format[0:3] == \"Arc\":\n borders.drawing_area_top = 10 # distance from page boundary\n borders.drawing_area_bottom = 10\n borders.drawing_area_left = 20\n borders.drawing_area_right = 10\n borders.sheet_frame_top = 5 # distance from drawing area border\n borders.sheet_frame_bottom = 5\n borders.sheet_frame_left = 5\n borders.sheet_frame_right = 5\n elif format == \"ISO A4-\":\n borders.drawing_area_top = 20 # distance from page boundary\n borders.drawing_area_bottom = 10\n borders.drawing_area_left = 10\n borders.drawing_area_right = 10\n borders.sheet_frame_top = 5 # distance from drawing area border\n borders.sheet_frame_bottom = 5\n borders.sheet_frame_left = 5\n borders.sheet_frame_right = 5\n else:\n borders.drawing_area_top = 10 # distance from page boundary\n borders.drawing_area_bottom = 10\n borders.drawing_area_left = 20\n borders.drawing_area_right = 10\n borders.sheet_frame_top = 5 # distance from drawing area border\n borders.sheet_frame_bottom = 5\n borders.sheet_frame_left = 5\n borders.sheet_frame_right = 5\n\ndef setSheetDimensions(format):\n if format[0:3] == \"ANS\":\n if format[-1:] == \"A\":\n sheet_format.width = \"216\"\n sheet_format.height = \"279\"\n elif format[-1:] == \"B\":\n sheet_format.width = \"432\"\n sheet_format.height = \"279\"\n elif format[-1:] == \"C\":\n sheet_format.width = \"559\"\n sheet_format.height = \"432\"\n elif format[-1:] == \"D\":\n sheet_format.width = \"864\"\n sheet_format.height = \"559\"\n else: # E\n sheet_format.width = \"1118\"\n sheet_format.height = \"864\"\n elif format[0:3] == \"Arc\":\n if format[-1:] == \"A\":\n sheet_format.width = \"229\"\n sheet_format.height = \"305\"\n elif format[-1:] == \"B\":\n sheet_format.width = \"457\"\n sheet_format.height = \"305\"\n elif format[-1:] == \"C\":\n sheet_format.width = \"610\"\n sheet_format.height = \"457\"\n elif format[-1:] == \"D\":\n sheet_format.width = \"914\"\n sheet_format.height = \"610\"\n elif format[-1:] == \"E\":\n sheet_format.width = \"1219\"\n sheet_format.height = \"914\"\n else: # E1\n sheet_format.width = \"1067\"\n sheet_format.height = \"762\"\n else: # ISO\n if format[-2:] == \"4-\":\n sheet_format.width = \"297\"\n sheet_format.height = \"210\"\n elif format[-1:] == \"4\":\n sheet_format.width = \"210\"\n sheet_format.height = \"297\"\n elif format[-1:] == \"3\":\n sheet_format.width = \"420\"\n sheet_format.height = \"297\"\n elif format[-1:] == \"2\":\n sheet_format.width = \"594\"\n sheet_format.height = \"420\"\n elif format[-1:] == \"1\":\n sheet_format.width = \"841\"\n sheet_format.height = \"594\"\n else: # A0\n sheet_format.width = \"1189\"\n sheet_format.height = \"841\"\n print(format, sheet_format.width, sheet_format.height)\n\ndef setTitleBlockStaticTexts(language):\n # Labels for the text entry fields in chosen language\n if language == \"DE\":\n title_block.author_name = \"Ersteller:\"\n title_block.date_of_creation = \"Datum:\"\n title_block.supervisor_name = \"Prüfer:\"\n title_block.date_of_approval = \"Datum:\"\n title_block.sheet_format = \"Format:\"\n title_block.sheet_scale = \"Maßstab:\"\n title_block.weight = \"Gewicht:\"\n title_block.owner = \"Eigentümer:\"\n title_block.version = \"Version:\"\n title_block.sheet_count = \"Blatt:\"\n elif language == \"FR\":\n title_block.author_name = \"Dessinateur:\"\n title_block.date_of_creation = \"Date:\"\n title_block.supervisor_name = \"Validé par:\"\n title_block.date_of_approval = \"Date:\"\n title_block.sheet_format = \"Format:\"\n title_block.sheet_scale = \"Échelle:\"\n title_block.weight = \"Poids:\"\n title_block.owner = \"Société:\"\n title_block.version = \"Version:\"\n title_block.sheet_count = \"Feuille:\"\n elif language == \"IT\":\n title_block.author_name = \"Nome Progettista:\"\n title_block.date_of_creation = \"Data:\"\n title_block.supervisor_name = \"Supervisore:\"\n title_block.date_of_approval = \"Data:\"\n title_block.sheet_format = \"Formato:\"\n title_block.sheet_scale = \"Scala:\"\n title_block.weight = \"Peso:\"\n title_block.owner = \"Ditta:\"\n title_block.version = \"Numero di Versione:\"\n title_block.sheet_count = \"Pagina:\"\n else:\n title_block.author_name = \"Author Name:\"\n title_block.date_of_creation = \"Date:\"\n title_block.supervisor_name = \"Supervisor Name:\"\n title_block.date_of_approval = \"Date:\"\n title_block.sheet_format = \"Format:\"\n title_block.sheet_scale = \"Scale:\"\n title_block.weight = \"Weight:\"\n title_block.owner = \"Owner:\"\n title_block.version = \"Version:\"\n title_block.sheet_count = \"Sheet:\"\n\ndef setBillOfMaterialTexts(language):\n # Labels for the BOM bottom line in chosen language\n if language == \"DE\":\n bom_list.position = \"Pos.\"\n bom_list.amount = \"Menge\"\n bom_list.unit = \"Einheit\"\n bom_list.title = \"Benennung\"\n bom_list.number = \"Sachnummer\"\n bom_list.material = \"Werkstoff\"\n bom_list.mass = \"Masse\"\n bom_list.remark = \"Bemerkung\"\n else:\n bom_list.position = \"Pos.\"\n bom_list.amount = \"Qty.\"\n bom_list.unit = \"Unit\"\n bom_list.title = \"Title\"\n bom_list.number = \"Part number\"\n bom_list.material = \"Material\"\n bom_list.mass = \"Mass\"\n bom_list.remark = \"Remark\"\n\n#- Function to generate an svg-instruction to draw a rectangle with the given values\ndef svgrect(width,height,x,y):\n svg_line=(\"\")\n return svg_line\n\n#- Function to generate an svg-instruction to draw a path element (line) with the given values\ndef svgpath(x1,y1,x2,y2):\n if x2==\"v\" or x2==\"V\" or x2==\"h\" or x2==\"H\":\n svg_line=(\"\")\n else:\n svg_line=(\"\")\n return svg_line\n\n#- Function to generate an svg-instruction to place a text element with the given values\ndef svgtext(posX,posY,strValue):\n svg_line=(\"\"+strValue+\"\")\n return svg_line\n\n#- Function to generate an svg-instruction to place an editable text element with the given values\ndef FCeditext(entryName,posX,posY,strValue):\n svg_line=(\" \"+strValue+\" \")\n return svg_line\n\n#- Create a file and insert a header line\ndef createSvgFile(file_path):\n t=open(file_path, \"w\") # w = write, overwrites existing files\n t.write(\"\")\n t.close\n\n#- Create opening svg-tag\n# Namespace section\ndef startSvg(file_path):\n t=open(file_path, \"a\", encoding=\"utf-8\")\n # a = append, new lines are added at the end of an existing file\n # encoding=\"utf-8\", helps with special characters if the Python interpreter is in ASCII mode\n t.write(\"\\n\"+\"\\n\")\n t.write(\"\\n\")\n t.close\n # identical values for width and height and Viewbox' width and height will synchronise mm and svg-units\n\n#- Create closing svg-tag\ndef endSvg(file_path):\n t=open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\"\")\n t.close\n\n#- Frame creation\ndef createFrame(file_path):\n t=open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n #- set sheet dimensions\n sWidth = sheet_format.width\n sHeight = sheet_format.height\n #- set frame offsets\n dAT = borders.drawing_area_top\n dAB = borders.drawing_area_bottom\n dAL = borders.drawing_area_left\n dAR = borders.drawing_area_right\n sFT = borders.sheet_frame_top\n sFB = borders.sheet_frame_bottom\n sFL = borders.sheet_frame_left\n sFR = borders.sheet_frame_right\n # inner Frame, drawing area\n #- upper left corner\n drawingX=str(dAL)\n drawingY=str(dAT)\n #- lower right corner\n drawingWidth=str(int(sWidth)-dAR)\n drawingHeight=str(int(sHeight)-dAB)\n t.write(\" \\n\")\n #- frame dimensions\n drawingWidth=str(int(sWidth)-dAL-dAR)\n drawingHeight=str(int(sHeight)-dAT-dAB)\n #- frame rectangle\n t.write(\" \"+svgrect(drawingWidth,drawingHeight,drawingX,drawingY)+\"\\n\")\n # outer frame\n #- upper left corner\n drawingX=str(dAL-sFL)\n drawingY=str(dAT-sFT)\n #- lower right corner\n drawingWidth=str(int(sWidth)-dAR+sFR)\n drawingHeight=str(int(sHeight)-dAB+sFB)\n t.write(\" \\n\")\n #- frame dimensions\n drawingWidth=str(int(sWidth)-dAL-dAR+sFL+sFR)\n drawingHeight=str(int(sHeight)-dAT-dAB+sFT+sFB)\n #- frame rectangle\n t.write(\" \"+svgrect(drawingWidth,drawingHeight,drawingX,drawingY)+\"\\n\")\n t.write(\" \\n\\n\")\n t.close\n\n#- Indexes and folding marks creation\ndef createDecoration(file_path):\n t = open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n #- set sheet dimensions\n sWidth = sheet_format.width\n sHeight = sheet_format.height\n #- set frame offsets\n dAT = borders.drawing_area_top\n dAB = borders.drawing_area_bottom\n dAL = borders.drawing_area_left\n dAR = borders.drawing_area_right\n sFT = borders.sheet_frame_top\n sFB = borders.sheet_frame_bottom\n sFL = borders.sheet_frame_left\n sFR = borders.sheet_frame_right\n\n drawingX=str(dAL)\n drawingY=str(dAT)\n drawingWidth=str(int(sWidth)-dAL-dAR)\n drawingHeight=str(int(sHeight)-dAT-dAB)\n\n #- starting point values of center lines\n indexCenter=str(int(drawingWidth)/2+dAL)\n indexMiddle=str(int(drawingHeight)/2+dAT)\n indexLeft=str(dAL+5)\n indexRight=str(int(drawingWidth)+dAL-5)\n indexUpper=str(dAT+5)\n indexLower=str(int(drawingHeight)+dAT-5)\n\n #- centre and middle markings of drawing area\n if sWidth==\"210\": # format==\"DIN-A4\":\n indexLeft=str(dAL)\n t.write(\" \"+svgpath(indexLeft,indexMiddle,\"h\",\"-15\")+\"\\n\")\n elif sWidth == \"297\": # format==\"DIN-A4-\":\n indexUpper = str(dAT)\n t.write(\" \"+svgpath(indexCenter,indexUpper,\"v\",\"-15\")+\"\\n\")\n elif sWidth==\"420\": # format==\"DIN-A3\":\n indexLeft=str(dAL+5)\n t.write(\" \"+svgpath(indexCenter,indexUpper,\"v\",\"-10\")+\"\\n\")\n t.write(\" \"+svgpath(indexCenter,indexLower,\"v\",\" 10\")+\"\\n\")\n t.write(\" \"+svgpath(indexLeft,indexMiddle,\"h\",\"-20\")+\"\\n\")\n t.write(\" \"+svgpath(indexRight,indexMiddle,\"h\",\" 10\")+\"\\n\")\n else :\n t.write(\" \"+svgpath(indexCenter,indexUpper,\"v\",\"-10\")+\"\\n\")\n t.write(\" \"+svgpath(indexCenter,indexLower,\"v\",\" 10\")+\"\\n\")\n t.write(\" \"+svgpath(indexLeft,indexMiddle,\"h\",\"-10\")+\"\\n\")\n t.write(\" \"+svgpath(indexRight,indexMiddle,\"h\",\" 10\")+\"\\n\")\n\n #- starting point values of separator lines\n indexLeft =str(dAL)\n indexRight=str(int(drawingWidth)+dAL)\n indexUpper=str(dAT)\n indexLower=str(int(drawingHeight)+dAT)\n\n #- set number of horizontal and vertical indexes\n # this needs to be extended for American formats\n if sWidth==\"420\": # format==\"DIN-A3\":\n indexCountX=8\n indexCountY=6\n elif sWidth==\"594\": # format==\"DIN-A2\":\n indexCountX=12\n indexCountY=8\n elif sWidth==\"841\": # format==\"DIN-A1\":\n indexCountX=16\n indexCountY=12\n elif sWidth==\"1189\": # format==\"DIN-A0\":\n indexCountX=24\n indexCountY=16\n else :\n indexCountX=0\n indexCountY=0\n\n #- indexCenter and indexMiddle contain strings but floating point\n # numbers are needed to calculate\n floatCenter=int(drawingWidth)/2+dAL\n floatMiddle=int(drawingHeight)/2+dAT\n\n #- horizontal index separators\n max=int(indexCountX/2-1)\n for value in range(0,max):\n indexX=str(floatCenter+(value+1)*50)\n t.write(\" \"+svgpath(indexX,indexUpper,\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(indexX,indexLower,\"v\",\" 5\")+\"\\n\")\n indexX=str(floatCenter-(value+1)*50)\n t.write(\" \"+svgpath(indexX,indexUpper,\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(indexX,indexLower,\"v\",\" 5\")+\"\\n\")\n\n #- vertical index separators\n max=int(indexCountY/2-1)\n for value in range(0,max):\n indexY=str(floatMiddle+(value+1)*50)\n t.write(\" \"+svgpath(indexLeft, indexY,\"h\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(indexRight,indexY,\"h\",\" 5\")+\"\\n\")\n indexY=str(floatMiddle-(value+1)*50)\n t.write(\" \"+svgpath(indexLeft, indexY,\"h\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(indexRight,indexY,\"h\",\" 5\")+\"\\n\")\n\n t.write(\" \\n\")\n\n t.write(\" \\n\")\n\n #- position point values of indexes\n indexLeft=str(dAL-sFL/2)\n indexRight=str(int(drawingWidth)+dAL+sFR/2)\n indexUpper=str(dAT-1)\n indexLower=str(int(drawingHeight)+dAT+sFB-1)\n\n #- horizontal indexes, numbers\n max=int(indexCountX/2)\n for value in range(0,max):\n indexX=str(floatCenter+value*50+25)\n t.write(\" \"+svgtext(indexX,indexUpper,str(int(indexCountX/2+value+1)))+\"\\n\")\n t.write(\" \"+svgtext(indexX,indexLower,str(int(indexCountX/2+value+1)))+\"\\n\")\n indexX=str(floatCenter-value*50-25)\n t.write(\" \"+svgtext(indexX,indexUpper,str(int(indexCountX/2-value)))+\"\\n\")\n t.write(\" \"+svgtext(indexX,indexLower,str(int(indexCountX/2-value)))+\"\\n\")\n\n #- vertical indexes, letters\n max=int(indexCountY/2)\n for value in range(0,max):\n indexY=str(floatMiddle+value*50+25)\n if int(indexCountY/2+value+1)>9 : # to avoid the letter J\n t.write(\" \"+svgtext(indexLeft,indexY,chr(64+int(indexCountY/2+value+2)))+\"\\n\")\n t.write(\" \"+svgtext(indexRight,indexY,chr(64+int(indexCountY/2+value+2)))+\"\\n\")\n else :\n t.write(\" \"+svgtext(indexLeft,indexY,chr(64+int(indexCountY/2+value+1)))+\"\\n\")\n t.write(\" \"+svgtext(indexRight,indexY,chr(64+int(indexCountY/2+value+1)))+\"\\n\")\n indexY=str(floatMiddle-value*50-25)\n t.write(\" \"+svgtext(indexLeft,indexY,chr(64+int(indexCountY/2-value)))+\"\\n\")\n t.write(\" \"+svgtext(indexRight,indexY,chr(64+int(indexCountY/2-value)))+\"\\n\")\n\n t.write(\" \\n\\n\")\n\n #- puncher mark\n t.write(\" \\n\")\n if sWidth in[\"1189\", \"841\", \"594\"] : # A3 and A4 have extended middle markings\n t.write(\" \"+svgpath(str(dAL-sFL),str(int(sHeight)-(297/2)),\"h\",\"-10\")+\"\\n\")\n t.write(\" \\n\\n\")\n\n #- folding marks\n t.write(\" \\n\")\n if sWidth==\"420\": # DIN-A3\n t.write(\" \"+svgpath(\"125\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"125\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"230\",str(dAT-sFT),\"v\",\"-5\")+\"\\n\")\n t.write(\" \"+svgpath(\"230\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n elif sWidth==\"594\": # DIN-A2\n t.write(\" \"+svgpath(\"210\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"210\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"402\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"402\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"105\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\" 5\",\"123\",\"h\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(str(int(sWidth)-dAR+sFR),\"123\",\"h\",\" 5\")+\"\\n\")\n elif sWidth==\"841\": # DIN-A1\n t.write(\" \"+svgpath(\"210\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"210\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"400\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"400\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"651\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"651\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"105\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\" 5\",\"297\",\"h\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(str(int(sWidth)-dAR+sFR),\"297\",\"h\",\" 5\")+\"\\n\")\n elif sWidth==\"1189\": # DIN-A0\n t.write(\" \"+svgpath(\"210\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"210\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"400\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"400\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"590\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"590\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"780\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"780\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"999\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\"999\",str(int(sHeight)-dAB+sFB),\"v\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\"105\",str(dAT-sFT),\"v\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(\" 5\",\"247\",\"h\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(str(int(sWidth)-dAR+sFR),\"247\",\"h\",\" 5\")+\"\\n\")\n t.write(\" \"+svgpath(\" 5\",\"544\",\"h\",\" -5\")+\"\\n\")\n t.write(\" \"+svgpath(str(int(sWidth)-dAR+sFR),\"544\",\"h\",\" 5\")+\"\\n\")\n\n t.write(\" \\n\\n\")\n t.close\n\n#- Title block movable\ndef createTitleBlock(file_path):\n #- set sheet dimensions\n sWidth = sheet_format.width\n sHeight = sheet_format.height\n #- set frame offsets\n dAB = borders.drawing_area_bottom\n dAR = borders.drawing_area_right\n #- set static texts\n tb_author = title_block.author_name\n tb_created = title_block.date_of_creation\n tb_supervisor = title_block.supervisor_name\n tb_approved = title_block.date_of_approval\n tb_format = title_block.sheet_format\n tb_scale = title_block.sheet_scale\n tb_weight = title_block.weight\n tb_owner = title_block.owner\n tb_version = title_block.version\n tb_sheet = title_block.sheet_count\n\n #- lower left corner\n tbX=str(int(sWidth)-dAR-180) # 180 according to DIN EN ISO 7200\n tbY=str(int(sHeight)-dAB)\n #- group to move allelements in one step\n t=open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n t.write(\" \\n\\n\")\n #- title block\n t.write(\" \\n\")\n if sWidth != \"210\": # DIN-A4\n t.write(\" \"+svgpath(\" 0\",\" 0\",\" 0\",\"-63\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0\",\"-63\",\"180\",\" 0\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0\",\" -4\",\"h\",\"155\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0\",\"-16\",\"h\",\"155\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0\",\"-30\",\"h\",\"155\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0\",\"-46.5\",\"h\",\" 50\")+\"\\n\")\n t.write(\" \"+svgpath(\" 25\",\" -4\",\"v\",\"-26\")+\"\\n\")\n t.write(\" \"+svgpath(\" 50\",\" -4\",\"v\",\"-59\")+\"\\n\")\n t.write(\" \"+svgpath(\"140\",\" -4\",\"v\",\"-12\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\" 0\",\"v\",\"-63\")+\"\\n\")\n t.write(\" \"+svgpath(\"160\",\" 0\",\"v\",\"-63\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\" -7\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\"-14\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\"-21\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\"-28\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\"-35\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\"-42\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\"-49\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \"+svgpath(\"155\",\"-56\",\"h\",\" 25\")+\"\\n\")\n t.write(\" \\n\")\n #- small texts, left-aligned\n t.write(\" \\n\")\n t.write(\" \"+svgtext(\" 1.5\",\"-60 \", tb_author)+\"\\n\")\n t.write(\" \"+svgtext(\" 1.5\",\"-52 \", tb_created)+\"\\n\")\n t.write(\" \"+svgtext(\" 1.5\",\"-43.5 \", tb_supervisor)+\"\\n\")\n t.write(\" \"+svgtext(\" 1.5\",\"-35.5 \", tb_approved)+\"\\n\")\n t.write(\" \"+svgtext(\" 1.5\",\"-27 \", tb_format)+\"\\n\")\n t.write(\" \"+svgtext(\" 1.5\",\"-13 \", tb_scale)+\"\\n\")\n t.write(\" \"+svgtext(\" 26.5\",\"-13 \", tb_weight)+\"\\n\")\n t.write(\" \"+svgtext(\" 51.5\",\"-27 \", tb_owner)+\"\\n\")\n t.write(\" \"+svgtext(\" 51.5\",\"-13 \", tb_version)+\"\\n\")\n t.write(\" \"+svgtext(\"141.5\",\"-13 \", tb_sheet)+\"\\n\")\n t.write(\" \\n\")\n #- revision indexes, centered\n t.write(\" \\n\")\n t.write(\" \"+svgtext(\"157.5\",\" -1.5 \",\"A\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\" -8.5 \",\"B\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\"-15.5 \",\"C\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\"-22.5 \",\"D\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\"-29.5 \",\"E\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\"-36.5 \",\"F\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\"-43.5 \",\"G\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\"-50.5 \",\"H\")+\"\\n\")\n t.write(\" \"+svgtext(\"157.5\",\"-57.5 \",\"I\")+\"\\n\")\n t.write(\" \\n\")\n\n t.write(\" \\n\\n\")\n t.close\n\n#- Title block editable texts\ndef createEditableText(file_path):\n #- set sheet dimensions\n sWidth = sheet_format.width\n sHeight = sheet_format.height\n #- set frame offsets\n dAB = borders.drawing_area_bottom\n dAR = borders.drawing_area_right\n\n #- offsets for editable texts\n edX=int(sWidth)-dAR-180 # 180 according to DIN EN ISO 7200\n edY=int(sHeight)-dAB\n\n t=open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n\n t.write(\" \"+FCeditext(\"Owner\",str(edX+65),str(edY-27.0),\"Owner\")+\"\\n\")\n t.write(\" \\n\")\n\n t.write(\" \\n\")\n t.write(\" \"+FCeditext(\"Address-1\",str(edX+65),str(edY-23.5),\"Address1\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Address-2\",str(edX+65),str(edY-20.0),\"Address2\")+\"\\n\")\n t.write(\" \"+FCeditext(\"MailTo\", str(edX+65),str(edY-16.5),\"MailTo\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Copyright\",str(edX+2), str(edY-1.0), \"Copyright\")+\"\\n\")\n t.write(\" \\n\")\n\n t.write(\" \\n\")\n t.write(\" \"+FCeditext(\"Author\", str(edX+2), str(edY-55.0),\"Author\")+\"\\n\")\n t.write(\" \"+FCeditext(\"AuDate\", str(edX+7), str(edY-47.5),\"YYYY/MM/DD\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Supervisor\",str(edX+2), str(edY-38.5),\"Supervisor\")+\"\\n\")\n t.write(\" \"+FCeditext(\"SvDate\", str(edX+7), str(edY-31.0),\"YYYY/MM/DD\")+\"\\n\")\n t.write(\" \"+FCeditext(\"SubTitle\", str(edX+64), str(edY-42.0),\"Sub-title\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Version\", str(edX+60), str(edY-8.0), \"Version\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-A\",str(edX+162),str(edY-1.5), \"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-B\",str(edX+162),str(edY-8.5), \"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-C\",str(edX+162),str(edY-15.5),\"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-D\",str(edX+162),str(edY-22.5),\"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-E\",str(edX+162),str(edY-29.5),\"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-F\",str(edX+162),str(edY-36.5),\"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-G\",str(edX+162),str(edY-43.5),\"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-H\",str(edX+162),str(edY-50.5),\"______\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Revision-I\",str(edX+162),str(edY-57.5),\"______\")+\"\\n\")\n t.write(\" \\n\")\n\n t.write(\" \\n\")\n t.write(\" \"+FCeditext(\"Format\", str(edX+12), str(edY-21),\"A3\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Sheets\", str(edX+148),str(edY-8), \"1 / 1\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Scale\", str(edX+12), str(edY-8), \"1 : 1\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Weight\", str(edX+35), str(edY-8), \"___ kg\")+\"\\n\")\n t.write(\" \\n\")\n\n t.write(\" \\n\")\n t.write(\" \"+FCeditext(\"Title\", str(edX+62),str(edY-50),\"Drawing Title\")+\"\\n\")\n t.write(\" \"+FCeditext(\"PtNumber\",str(edX+62),str(edY-32),\"Part Number\")+\"\\n\")\n t.write(\" \\n\\n\")\n t.close\n\n#- Title block Freecad logo\ndef createFreecadLogo(file_path):\n #- set sheet dimensions\n sWidth = sheet_format.width\n sHeight = sheet_format.height\n #- set frame offsets\n dAB = borders.drawing_area_bottom\n dAR = borders.drawing_area_right\n\n t=open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \\n\\n\")\n t.close\n\n#- Symbol for projection method\ndef createProjectionSymbol(file_path):\n #- set sheet dimensions\n sWidth = sheet_format.width\n sHeight = sheet_format.height\n #- set frame offsets\n dAB = borders.drawing_area_bottom\n dAR = borders.drawing_area_right\n # order top and side symbols\n if projectionGroupAngle() == 1:\n # Third angle projection\n top_offset = \"-3.5\"\n side_offset = \"3.5\"\n else:\n # First angle projection\n top_offset = \"3.5\"\n side_offset = \"-3.5\"\n\n t=open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \"+svgpath(\" -2.5 \",\" 0 \",\"h\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" -1.15\",\" 0 \",\"h\",\" 0.3\")+\"\\n\")\n t.write(\" \"+svgpath(\" -0.5 \",\" 0 \",\"h\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0.85\",\" 0 \",\"h\",\" 0.3\")+\"\\n\")\n t.write(\" \"+svgpath(\" 1.5 \",\" 0 \",\"h\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0 \",\"-2.5 \",\"v\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0 \",\"-1.15\",\"v\",\" 0.3\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0 \",\"-0.5 \",\"v\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0 \",\" 0.85\",\"v\",\" 0.3\")+\"\\n\")\n t.write(\" \"+svgpath(\" 0 \",\" 1.5 \",\"v\",\" 1\")+\"\\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \"+svgpath(\" -3.0 \",\" 0 \",\"h\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" -0.5 \",\" 0 \",\"h\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" 2.0 \",\" 0 \",\"h\",\" 1\")+\"\\n\")\n t.write(\" \"+svgpath(\" -1.4 \",\" 0 \",\"h\",\" 0.3\")+\"\\n\")\n t.write(\" \"+svgpath(\" 1.1 \",\" 0 \",\"h\",\" 0.3\")+\"\\n\")\n t.write(\" \\n\")\n t.write(\" \\n\\n\")\n t.close\n\ndef createBOMLines(file_path,bom_rows):\n #- set sheet dimensions\n sWidth = sheet_format.width\n sHeight = sheet_format.height\n #- set frame offsets\n dAB = borders.drawing_area_bottom\n dAR = borders.drawing_area_right\n\n if bom_rows == 0:\n return\n else:\n max_rows = (int(bom_rows)+1)\n\n stX=int(sWidth)-dAR-180\n stY=int(sHeight)-dAB-63\n\n t=open(file_path, \"a\", encoding=\"utf-8\")\n t.write(\" \\n\")\n # BOM base line\n t.write(\" \\n\")\n if sWidth==\"210\": # format==\"DIN-A4\":\n t.write(\" \"+svgpath(str(stX),str(stY-8),\" 180\",\" 0 \")+\"\\n\")\n else :\n t.write(\" \"+svgpath(str(stX),str(stY-8),\" 180\",\" 0 \")+\"\\n\")\n t.write(\" \"+svgpath(str(stX),str(stY) ,\" 0\",\" -8 \")+\"\\n\")\n t.write(\" \\n\")\n # Field separators\n t.write(\" \\n\")\n t.write(\" \"+svgpath(str(stX+ 10),str(stY),\"v\",\" -8\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+ 20),str(stY),\"v\",\" -8\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+ 30),str(stY),\"v\",\" -8\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+ 60),str(stY),\"v\",\" -8\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+120),str(stY),\"v\",\" -8\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+140),str(stY),\"v\",\" -8\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+160),str(stY),\"v\",\" -8\")+\"\\n\")\n t.write(\" \\n\")\n # Non-editable Texts\n t.write(\" \\n\")\n t.write(\" \"+svgtext(str(stX+ 5),str(stY-4),bom_list.position)+\"\\n\")\n t.write(\" \"+svgtext(str(stX+ 15),str(stY-4),bom_list.amount)+\"\\n\")\n t.write(\" \"+svgtext(str(stX+ 25),str(stY-4),bom_list.unit)+\"\\n\")\n t.write(\" \"+svgtext(str(stX+ 45),str(stY-4),bom_list.title)+\"\\n\")\n t.write(\" \"+svgtext(str(stX+ 90),str(stY-4),bom_list.number)+\"\\n\")\n t.write(\" \"+svgtext(str(stX+130),str(stY-4),bom_list.material)+\"\\n\")\n t.write(\" \"+svgtext(str(stX+150),str(stY-4),bom_list.mass)+\"\\n\")\n t.write(\" \"+svgtext(str(stX+170),str(stY-4),bom_list.remark)+\"\\n\")\n t.write(\" \\n\")\n # Editable Lines\n t.write(\" \\n\")\n #stX=int(sWidth)-dAR-180\n #stY=int(sHeight)-dAB-72\n stY -= 8\n\n for value in range(1,max_rows):\n t.write(\" \\n\")\n if sWidth==\"210\": # format==\"DIN-A4\":\n t.write(\" \"+svgpath(str(stX),str(stY-6),\" 180\",\" 0 \")+\"\\n\")\n else :\n t.write(\" \"+svgpath(str(stX),str(stY-6),\" 180\",\" 0 \")+\"\\n\")\n t.write(\" \"+svgpath(str(stX),str(stY) ,\" 0\",\" -6 \")+\"\\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \"+svgpath(str(stX+ 10),str(stY),\"v\",\" -6\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+ 20),str(stY),\"v\",\" -6\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+ 30),str(stY),\"v\",\" -6\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+ 60),str(stY),\"v\",\" -6\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+120),str(stY),\"v\",\" -6\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+140),str(stY),\"v\",\" -6\")+\"\\n\")\n t.write(\" \"+svgpath(str(stX+160),str(stY),\"v\",\" -6\")+\"\\n\")\n t.write(\" \\n\")\n # Editable Texts\n t.write(\" \\n\")\n t.write(\" \"+FCeditext(\"Partname\"+str(value),str(stX+32),str(stY-2),\"-\")+\"\\n\")\n t.write(\" \"+FCeditext(\"PartNumber\"+str(value),str(stX+62),str(stY-2),\"-\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Material\"+str(value),str(stX+122),str(stY-2),\"-\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Remark\"+str(value),str(stX+162),str(stY-2),\"-\")+\"\\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \"+FCeditext(\"Position\"+str(value),str(stX+9),str(stY-2),str(value))+\"\\n\")\n t.write(\" \"+FCeditext(\"Amount\"+str(value),str(stX+19),str(stY-2),\"-\")+\"\\n\")\n t.write(\" \"+FCeditext(\"Mass\"+str(value),str(stX+159),str(stY-2),\"-\")+\"\\n\")\n t.write(\" \\n\")\n t.write(\" \\n\")\n t.write(\" \"+FCeditext(\"Unit\"+str(value),str(stX+25),str(stY-2),\"-\")+\"\\n\")\n t.write(\" \\n\")\n stY=stY-6\n\n t.write(\" \\n\")\n t.write(\" \\n\\n\")\n t.close\n\ndef existingPages(document):\n # this counts existing pages in the active document\n number_of_pages=0\n for entry in document.Objects:\n if entry.Name[:4] == \"Page\":\n number_of_pages += 1\n return number_of_pages\n\ndef updateSheetTotal(total_pages, document):\n # update the number of sheets on earlier sheets\n count_down = total_pages\n while count_down > 1:\n count_down -= 1\n if count_down < 10:\n # insert leading zero\n current_page = (\"Page\"+ \"0\"+ str(count_down))\n else:\n current_page = (\"Page\"+ str(count_down))\n\n editable_texts = document.getObject(current_page).Template.EditableTexts\n editable_texts[\"Sheets\"] = (str(count_down) + \"/\" + str(total_pages))\n document.getObject(current_page).Template.EditableTexts = editable_texts\n\ndef setOwnerData():\n owner_data.company = \"Owner / Company\"\n owner_data.address1 = \"Address-1\"\n owner_data.address2 = \"Address-2\"\n owner_data.mailTo = \"Info@theCompany.com\"\n owner_data.copyright = \"All rights reserved\"\n\ndef getAuthor():\n # Reads the user name from the preferences settings\n parameter_path = App.ParamGet(\"User parameter:BaseApp/Preferences/Document\")\n author_name = parameter_path.GetString(\"prefAuthor\")\n if author_name == \"\":\n author_name = \"not set yet\"\n return author_name\n\ndef getDate():\n today = time.strftime(\"%Y-%m-%d\") # %Y: YYYY, %y: YY\n return today\n\ndef getVersion():\n # Reads the FreeCAD version from the running application\n av = App.Version()\n if av[2] == \"0\":\n app_version = (\"FreeCAD v. \" + av[0] + \".\" + av[1] + \".\" + av[2] + \" - \" + av[3])\n else:\n app_version = (\"FreeCAD v. \" + av[0] + \".\" + av[1] + \".\" + av[2])\n return app_version\n\ndef projectionGroupAngle():\n # Reads the projection convention from the preferences settings\n parameter_path = App.ParamGet(\"User parameter:BaseApp/Preferences/Mod/TechDraw/General\")\n projection_angle = parameter_path.GetInt(\"ProjectionAngle\")\n return projection_angle\n\ndef main():\n # Gui to select some presets\n form = InputWindow()\n form.exec_()\n if form.result == \"Cancelled\":\n pass\n else:\n template_file = form.template_file\n setBorderValues(form.result_format)\n setSheetDimensions(form.result_format)\n setTitleBlockStaticTexts(form.result_language)\n setBillOfMaterialTexts(form.result_language)\n\n createSvgFile(template_file) # overwrites existing File\n startSvg(template_file) # adds Start tag and namespaces\n createSheet(template_file)\n createFrame(template_file)\n createDecoration(template_file)\n createTitleBlock(template_file)\n createEditableText(template_file)\n createFreecadLogo(template_file)\n createProjectionSymbol(template_file)\n createBOMLines(template_file, form.input_BOM_rows.value())\n endSvg(template_file)\n # At this point a new SVG-file is generated and saved\n # and shall be attached to the active document\n\n # -- Add a page and a template to the active document --\n\n active_doc = App.activeDocument()\n # add a page to the active document\n #- count existing pages\n how_many = existingPages(active_doc)\n how_many += 1 # for the following new page\n #- Define the new page's name (with only 2 trailing digits)\n if how_many < 10:\n # insert leading zero\n new_page = (\"Page\"+ \"0\"+ str(how_many))\n else:\n new_page = (\"Page\"+ str(how_many))\n\n # set template number according to page number\n new_template = ('Template' + new_page[4:])\n # add a page object to the active document\n active_doc.addObject('TechDraw::DrawPage',new_page)\n # add a template object to the active document\n active_doc.addObject('TechDraw::DrawSVGTemplate',new_template)\n # load the svg template into the template object\n active_doc.getObject(new_template).Template = template_file\n # add the template object to the page's object list\n active_doc.getObject(new_page).Template = active_doc.getObject(new_template)\n #create entries on first page or copy from first page\n #- check for arch formats and A4 landscape\n if form.result_format[:4] == \"Arch\":\n sheet_format = form.result_format\n elif form.result_format == \"ISO A4-\":\n sheet_format = \"A4\"\n else:\n sheet_format = form.result_format[-2:]\n\n if how_many == 1:\n setOwnerData()\n # update entries on first sheet\n editable_texts = active_doc.getObject(new_page).Template.EditableTexts\n #- EditableTexts is a dictionary automatically created when the Template is inserted\n # Listed are all keys and (default) values - as created with the template above\n editable_texts[\"Owner\"] = owner_data.company\n editable_texts[\"Address-1\"] = owner_data.address1\n editable_texts[\"Address-2\"] = owner_data.address2\n editable_texts[\"MailTo\"] = owner_data.mailTo\n editable_texts[\"Copyright\"] = owner_data.copyright\n editable_texts[\"Author\"] = getAuthor()\n editable_texts[\"AuDate\"] = getDate()\n #editable_texts[\"Supervisor\"] = \"Supervisor\"\n #editable_texts[\"SvDate\"] = \"YYYY/MM/DD\"\n #editable_texts[\"SubTitle\"] = \"Sub-title\"\n editable_texts[\"Version\"] = getVersion()\n #editable_texts[\"Revision-A\"] = \"______\"\n #editable_texts[\"Revision-B\"] = \"______\"\n #editable_texts[\"Revision-C\"] = \"______\"\n #editable_texts[\"Revision-D\"] = \"______\"\n #editable_texts[\"Revision-E\"] = \"______\"\n #editable_texts[\"Revision-F\"] = \"______\"\n #editable_texts[\"Revision-G\"] = \"______\"\n #editable_texts[\"Revision-H\"] = \"______\"\n #editable_texts[\"Revision-I\"] = \"______\"\n editable_texts[\"Format\"] = sheet_format\n #editable_texts[\"Sheets\"] = \"1 / 1\"\n #editable_texts[\"Scale\"] = \"1 : 1\"\n #editable_texts[\"Weight\"] = \"Weight\"\n #editable_texts[\"Title\"] = \"Title\"\n #editable_texts[\"PtNumber\"] = \"Part number\"\n active_doc.getObject(new_page).Template.EditableTexts = editable_texts\n else:\n # copy some entries from first sheet that are identical on all sheets\n existing_texts = active_doc.Page01.Template.EditableTexts\n editable_texts = active_doc.getObject(new_page).Template.EditableTexts\n\n editable_texts[\"Owner\"] = existing_texts[\"Owner\"]\n editable_texts[\"Address-1\"] = existing_texts[\"Address-1\"]\n editable_texts[\"Address-2\"] = existing_texts[\"Address-2\"]\n editable_texts[\"MailTo\"] = existing_texts[\"MailTo\"]\n editable_texts[\"Copyright\"] = existing_texts[\"Copyright\"]\n editable_texts[\"Author\"] = getAuthor()\n editable_texts[\"AuDate\"] = getDate()\n #editable_texts[\"Supervisor\"] = existing_texts[\"Supervisor\"]\n #editable_texts[\"SvDate\"] = existing_texts[\"SvDate\"]\n editable_texts[\"SubTitle\"] = existing_texts[\"SubTitle\"]\n editable_texts[\"Version\"] = getVersion()\n #editable_texts[\"Revision-A\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-B\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-C\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-D\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-E\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-F\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-G\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-H\"] = existing_texts[\"______\"]\n #editable_texts[\"Revision-I\"] = existing_texts[\"______\"]\n editable_texts[\"Format\"] = sheet_format\n editable_texts[\"Sheets\"] = (str(how_many) + \"/\" + str(how_many))\n #editable_texts[\"Scale\"] = existing_texts[\"Scale\"]\n editable_texts[\"Weight\"] = existing_texts[\"Weight\"]\n editable_texts[\"Title\"] = existing_texts[\"Title\"]\n editable_texts[\"PtNumber\"] = existing_texts[\"PtNumber\"]\n active_doc.getObject(new_page).Template.EditableTexts = editable_texts\n # update the number of sheets on earlier sheets\n updateSheetTotal(how_many, active_doc)\n\n # rename 'Page' according to the title block label\n active_doc.getObject(new_page).Label = (title_block.sheet_count[:-1] + \" \" + new_page[4:])\n # open the page object for editing\n active_doc.getObject(new_page).ViewObject.doubleClicked()\n\n\nif __name__ == '__main__':\n # This will be true only if the file is \"executed\"\n # but not if imported as module\n main()\n}}\n\n\n
\n\n\n
\n\n\n---\n⏵ [documentation index](../README.md) > Macro TemplateHelper/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_TreeToAscii.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_TreeToAscii.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_TreeToAscii.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "fd8dea2acb065bac80bb30b3c8b4d774d5d9544749004a94a008af082760bf37", "bytes": 10441, "tokens": 3751, "text": "# Macro TreeToAscii/en\n{{Macro\n|Name=Macro TreeToAscii\n|Description=This macro generates an ASCII art representation of the tree of selected object(s)\n|Author=OpenBrain\n|Date=2020-03-23\n|Version=0.6\n|FCVersion=0.17+\n}}\n\n## Description\n\nThis macro has been written mainly aiming at documenting the model construction. It generates an ASCII art representation of the construction tree of selected object(s).\n\n## Usage\n\nJust select the object(s) you want to print the tree and run the macro. It will display the tree of each object in a dialog. All selected objects will be considered as being at the same hierarchy level at the top of the tree (even if they aren\\'t in the real model). Once dialog is open, you can change style and/or pattern and re-generate the ASCII tree.\n\n![](images/FCTree2Ascii.png )\n\nSeveral styles are provided, at this time mainly to support systems that can encounter problems with Unicode encoding :\n\n- ***Modern*** : (default) uses Unicode characters to display forks and branches\n- ***Baroque*** : another Unicode style with larger indentation\n- ***ASCII*** : pure ASCII representation of forks and branches\n\nCreating your own style should not be too difficult by editing the macro and changing/adding a style to \\'STYLES\\' variable. Selected style choice is saved in FreeCAD parameters.\n\nLine pattern is can be customized. It supports different defined metadata :\n\n- ***{LBL}*** : object Label (displayed label)\n- ***{NAM}*** : object Name (internal name) eg. \\'Box001\\'\n- ***{SNAM}*** : object ShortName (without digits) eg. \\'Box001\\' will be displayed as \\'Box\\'\n- ***{TYP}*** : object Type eg. \\'Part::MultiFuse\\'\n- ***{BTYP}*** : object BaseType eg. \\'Part::MultiFuse\\' will be displayed as \\'Part\\'\n- ***{STYP}*** : object ShortType (without base) eg. \\'Part::MultiFuse\\' will be displayed as \\'MultiFuse\\'\n\nDefault pattern is \\'{LBL} ({SNAM})\\', which means eg. object \\'Box001\\' labeled \\'myCube\\' will be displayed as \\'myCube (Box001)\\'. Notice virtually all characters are allowed. If you want to print curly braces, they need to be doubled. Eg. with same example object, pattern \\'{LBL} (SNAME) {{{TYP}}} =\\>\\' will print \\'myCube (Box) {Part::Box} =\\>\\'. Available metadata are available in the tooltip of the pattern editing field so you don\\'t need to remember it. Line pattern is saved in FreeCAD parameters.\n\nOnce dialog is open, several actions are available :\n\n- ***Copy to clipboard*** : copies the whole tree to your clipboard\n- ***Save to file*** : saves the whole tree to an arbitrary file on your system\n- ***Embed in text file*** : stores the whole tree in a text file embedded in the document (available since FC 0.18.4)\n- Of course you can copy any part of the tree by selecting it and using standard copy commands\n\n## Installation\n\nThe macro is available through [Addon Manager](Std_AddonMgr.md). Code is provided on this page for convenience in case user system doesn\\'t have git-python. Though it should be up-to-date, latest release is always available at [FreeCAD-macro repository](https://github.com/FreeCAD/FreeCAD-macros/blob/master/Information/TreeToAscii.FCMacro)\n\nFor more detailed explanations, see the [How to install macros](How_to_install_macros.md) page.\n\n## Script\n\n### Forum discussion \n\nFor any feedback (bug, feature request, comments, \\...), please use this forum thread : \n\n### Code\n\n**Macro_FCTree2Ascii.FCMacro**\n\n\n{{MacroCode|code=\n\n#!/usr/bin/python\n#####################################\n# Copyright (c) openBrain 2020\n# Licensed under LGPL v2\n#\n# This FreeCAD macro prints the Tree of selected object(s) as ASCII art.\n# Several styles are available. Tree branch pattern is customizable.\n# It can export to clipboard, file or embedded text document.\n# This mainly aims at documenting the model.\n#\n# Version history :\n# *0.6 : introduce last fork string definition, add new style\n# *0.5 : beta release\n#\n#####################################\n\n# -*- coding: utf-8 -*-\n\n__Name__ = 'TreeToAscii'\n__Comment__ = 'Prints the Tree of selected object(s) as ASCII art'\n__Author__ = 'openBrain'\n__Version__ = '0.6'\n__Date__ = '2020-03-23'\n__License__ = 'LGPL v2'\n__Web__ = 'https://www.freecadweb.org/wiki/Macro_TreeToAscii'\n__Wiki__ = 'https://www.freecadweb.org/wiki/Macro_TreeToAscii'\n__Icon__ = ''\n__Help__ = 'Select object(s) you want to print the tree then run'\n__Status__ = 'Beta'\n__Requires__ = 'FreeCAD >= 0.17'\n__Communication__ = 'https://forum.freecadweb.org/viewtopic.php?f=22&t=43504'\n\nimport FreeCAD as App\nimport FreeCADGui as Gui\nfrom PySide import QtGui, QtCore # Special FreeCAD's PySide, which may be PySide2!\n\nPREF_PATH = 'User parameter:BaseApp/Preferences/Mod/TreeToAscii'\nPREF_PATTERN = 'TreePattern'\nPREF_STYLE = 'TreeStyle'\nSTYLES = { # defines styles as NAME : [ branch str, fork str, opt:last fork str]\n 'Modern' : [' │ ', ' ├ ', ' └ '], # Unicode U+251C, Unicode U+2502\n 'Baroque' : [' │ ', ' ├─ ', ' └─ '],\n 'ASCII' : [' | ', ' \\\\_']\n }\nDEF_PATTERN = '{LBL} ({SNAM})'\nDEF_STYLE = list(STYLES.keys())[0]\n\ng_ascii_tree=\"\"\n\ndef printChildren(objs=None, level=0, baseline=''):\n \"\"\"Build ASCII tree by recursive call\"\"\"\n global g_ascii_tree\n for cnt, obj in enumerate(objs,1):\n data = {\n \"LBL\" : obj.Label,\n \"NAM\" : obj.Name,\n \"SNAM\" : \"\".join(filter(str.isalpha, obj.Name)),\n \"TYP\" : obj.TypeId,\n \"BTYP\" : obj.TypeId.partition('::')[0],\n \"STYP\" : obj.TypeId.rpartition('::')[-1]\n }\n branch_str = STYLES[gen_style.currentText()][0]\n fork_str = STYLES[gen_style.currentText()][1]\n last_fork_str = STYLES[gen_style.currentText()][-1]\n if cnt == len(objs):\n g_ascii_tree += baseline + last_fork_str\n else:\n g_ascii_tree += baseline + fork_str\n try:\n g_ascii_tree += gen_pattern.text().format(**data)\n except (ValueError, IndexError, KeyError):\n g_ascii_tree = 'Error in generating pattern'\n return\n g_ascii_tree += '\\n'\n if cnt == len(objs):\n baselinechi = baseline + ' '*len(branch_str)\n else:\n baselinechi = baseline + branch_str\n printChildren(obj.ViewObject.claimChildren(), level + 1, baselinechi)\n\ndef copyToClip():\n \"\"\"Copies ASCII tree to clipboard\"\"\"\n tree_view.selectAll()\n tree_view.copy()\n tree_view.setPlainText(\"Copied to clipboard\")\n QtCore.QTimer.singleShot(3000, lambda:tree_view.setPlainText(g_ascii_tree))\n\ndef saveToFile():\n \"\"\"Saves ASCII tree to user system file\"\"\"\n _path = QtGui.QFileDialog.getSaveFileName()\n if _path[0]:\n save_file = QtCore.QFile(_path[0])\n if save_file.open(QtCore.QFile.ReadWrite):\n save_fileContent = QtCore.QTextStream(save_file)\n save_fileContent << g_ascii_tree\n save_file.flush()\n save_file.close()\n tree_view.setPlainText(\"Saved to file : \" + _path[0])\n else:\n tree_view.setPlainText(\"ERROR : Can't open file : \" + _path[0])\n QtCore.QTimer.singleShot(3000, lambda:tree_view.setPlainText(g_ascii_tree))\n\ndef embedToText():\n \"\"\"Stores ASCII tree into an embedded document\"\"\"\n text_doc = None\n try:\n text_doc = App.ActiveDocument.addObject(\"App::TextDocument\",\"ModelTree\")\n except:\n tree_view.setPlainText(\"ERROR : can't create Text document. Maybe your version is too old\")\n if text_doc:\n text_doc.Text = g_ascii_tree\n tree_view.setPlainText(\"Embedded to text document : \" + text_doc.Label)\n QtCore.QTimer.singleShot(3000, lambda:tree_view.setPlainText(g_ascii_tree))\n\ndef updateTxt():\n \"\"\"Updates ASCII tree\"\"\"\n global g_ascii_tree\n g_ascii_tree=\"\"\n printChildren(Gui.Selection.getSelection())\n tree_view.setPlainText(g_ascii_tree)\n\n\ndef onGenerate():\n \"\"\"Called when updating ASCII tree\"\"\"\n p.SetString(PREF_PATTERN, gen_pattern.text())\n p.SetString(PREF_STYLE, gen_style.currentText())\n updateTxt()\n\n# Get saved parameters or use defaults.\np = App.ParamGet(PREF_PATH)\ng_name_pattern = p.GetString(PREF_PATTERN, DEF_PATTERN)\ng_tree_style = p.GetString(PREF_STYLE, DEF_STYLE)\nif g_tree_style not in STYLES:\n g_tree_style = DEF_STYLE\n\n# Build UI and show\ndlg = QtGui.QDialog(Gui.getMainWindow(), QtCore.Qt.Tool)\ndlg_layout = QtGui.QVBoxLayout(dlg)\ngen_layout = QtGui.QHBoxLayout()\ngen_pattern = QtGui.QLineEdit(g_name_pattern, dlg)\ngen_pattern.setToolTip(\"\"\"Defined variables are :\n {LBL} : object Label\n {NAM} : object Name\n {SNAM} : object ShortName (without digits)\n {TYP} : object Type\n {BTYP} : object BaseType\n {STYP} : object ShortType (without base)\nIf you need to print curly braces, they have to be doubled\"\"\")\ngen_run = QtGui.QPushButton(\"Generate\",dlg)\ngen_run.clicked.connect(onGenerate)\ngen_style = QtGui.QComboBox(dlg)\ngen_style.addItems(list(STYLES.keys()))\ngen_style.setCurrentIndex(list(STYLES.keys()).index(g_tree_style))\ngen_layout.addWidget(QtGui.QLabel(\"Generating pattern: \"))\ngen_layout.addWidget(gen_pattern)\ngen_layout.addWidget(QtGui.QLabel(\"Style : \"))\ngen_layout.addWidget(gen_style)\ngen_layout.addWidget(gen_run)\ntree_view = QtGui.QPlainTextEdit(g_ascii_tree)\ntree_view.setReadOnly(True)\ntree_view.setMinimumWidth(Gui.getMainWindow().width()/2)\ntree_view.setMinimumHeight(Gui.getMainWindow().height()/2)\ntree_view.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)\nbutton_box = QtGui.QDialogButtonBox()\ncopy_clip_but = QtGui.QPushButton(\"Copy to clipboard\", button_box)\nbutton_box.addButton(copy_clip_but, QtGui.QDialogButtonBox.ActionRole)\ncopy_clip_but.clicked.connect(copyToClip)\n_but = QtGui.QPushButton(\"Save to file\", button_box)\nbutton_box.addButton(_but, QtGui.QDialogButtonBox.ActionRole)\n_but.clicked.connect(saveToFile)\nstore_embed_but = QtGui.QPushButton(\"Embed in a text file\", button_box)\nbutton_box.addButton(store_embed_but, QtGui.QDialogButtonBox.ActionRole)\nstore_embed_but.clicked.connect(embedToText)\nclose_dlg_but = QtGui.QPushButton(\"Close\", button_box)\nbutton_box.addButton(close_dlg_but, QtGui.QDialogButtonBox.RejectRole)\nbutton_box.rejected.connect(dlg.reject)\ndlg_layout.insertLayout(0,gen_layout)\ndlg_layout.addWidget(tree_view)\ndlg_layout.addWidget(button_box)\nupdateTxt()\ndlg.exec_()\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > Macro TreeToAscii/en\n"} {"id": "freecad-docs:wiki/translations/en/Macro_screw_maker1_2.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Macro_screw_maker1_2.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Macro_screw_maker1_2.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8b1165128f3802742eeb50f0361b5435f929b44fc001cfb73e5884ee11833c02", "bytes": 197491, "tokens": 90591, "text": "# Macro screw maker1 2/en\n{{Macro\n|Name=Macro_screw_maker1_2\n|Icon=Macro_screw_maker1_2.png\n|Description=Creates a screw, bolt... with or without thread, according to ISO standards.\n|Author=Ulrich Brammer\n|Version=2.3.1\n|Date=2018-10-22\n|FCVersion=All\n|Download=[https://wiki.freecad.org/images/0/00/Macro_screw_maker1_2.png ToolBar Icon]\n}}\n\n## Description\n\nThis macro creates a screw with or without thread, according to ISO standards.\n\n\n{{Codeextralink|https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/ObjectCreation/ScrewMaker.FCMacro}}\n\n\"\" \n*Screw maker*\n\n## Usage\n\n1. Select the characteristics of the screw and click on the create button.\n2. If you select a circle on a hole, or alternatively the inner surface of a circular hole and the circle at top of that hole at the same time, the screw will be placed into the hole with the create button.\n3. There is a message text, that will inform you, when the selected combination of properties is not available.\n\n\n
\n\n of **screw_maker** and a few types of screws. screw with thread\n\n\n
\n\nThe creation of the thread takes some time. Be patient and have a look at the CPU-usage.\n\n## Script\n\nThe latest version of the macro is to be found at [ScrewMaker.FCMacro](https://github.com/FreeCAD/FreeCAD-macros/blob/master/ObjectCreation/ScrewMaker.FCMacro) but the easiest way to install this macro is through the [Addon Manager](Std_AddonMgr.md).\n\nToolBar Icon ![](images/Macro_screw_maker1_2.png )\n\n**Macro_screw_maker_2.FCMacro**\n\n\n{{MacroCode|code=\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# screw_maker2_0.py\n# \n\n\n\"\"\"\nMacro to generate screws with FreeCAD.\nVersion 1.4 from 1st of September 2013\nVersion 1.5 from 23rd of December 2013\nCorrected hex-heads above M12 not done.\nVersion 1.6 from 15th of March 2014\nAdded PySide support\n\nVersion 1.7 from April 2014\nfixed bool type error. (int is not anymore accepted at linux)\nfixed starting point of real thread at some screw types.\n\nVersion 1.8 from July 2014\nfirst approch for a faster real thread\n\nVersion 1.9 / 2.0 July 2015\nnew calculation of starting point of thread\nshell-based approach for screw generation\nadded:\nISO 14582 Hexalobular socket countersunk head screws, high head\nISO 14584 Hexalobular socket raised countersunk head screws\nISO 7380-2 Hexagon socket button head screws with collar\nDIN 967 Cross recessed pan head screws with collar\nISO 4032 Hexagon nuts, Style 1\nISO 4033 Hexagon nuts, Style 2\nISO 4035 Hexagon thin nuts, chamfered\nEN 1661 Hexagon nuts with flange\nISO 7094 definitions Plain washers - Extra large series\nISO 7092 definitions Plain washers - Small series\nISO 7093-1 Plain washer - Large series\nScrew-tap to drill inner threads in parts with user defined length\n\nScrewMaker can now also used as a python module.\nThe following shows how to generate a screw from a python script:\n import screw_maker2_0\n\n threadDef = 'M3.5'\n o = screw_maker2_0.Screw()\n t = screw_maker2_0.Screw.setThreadType(o,'real')\n # Creates a Document-Object with label describing the screw\n d = screw_maker2_0.Screw.createScrew(o, 'ISO1207', threadDef, '20', 'real')\n\n # creates a shape in memory\n t = screw_maker2_0.Screw.setThreadType(o,'real')\n s = screw_maker1_9d.Screw.makeIso7046(o, 'ISO14582', threadDef, 40.0)\n Part.show(s)\n\n\nto do: check ISO7380 usage of rs and rt, actual only rs is used \ncheck chamfer angle on hexogon heads and nuts\n***************************************************************************\n* Copyright (c) 2013, 2014, 2015 *\n* Ulrich Brammer *\n* *\n* This file is a supplement to the FreeCAD CAx development system. *\n* *\n* This program is free software; you can redistribute it and/or modify *\n* it under the terms of the GNU Lesser General Public License (LGPL) *\n* as published by the Free Software Foundation; either version 2 of *\n* the License, or (at your option) any later version. *\n* for detail see the LICENCE text file. *\n* *\n* This software is distributed in the hope that it will be useful, *\n* but WITHOUT ANY WARRANTY; without even the implied warranty of *\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\n* GNU Library General Public License for more details. *\n* *\n* You should have received a copy of the GNU Library General Public *\n* License along with this macro; if not, write to the Free Software *\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *\n* USA *\n* *\n***************************************************************************\n\"\"\"\n\n__author__ = \"Ulrich Brammer \"\n\n\nimport FreeCAD, FreeCADGui, Part, math\nfrom FreeCAD import Base\nimport DraftVecUtils\n\ntry:\n from PySide import QtCore, QtGui\n #FreeCAD.Console.PrintMessage(\"PySide is used\" + \"\\n\")\nexcept:\n #FreeCAD.Console.PrintMessage(\"PyQt4 is needed\" + \"\\n\")\n from PyQt4 import QtCore, QtGui\n\n\nDEBUG = False # set to True to show debug messages; does not work, still todo.\n\n\n# Diameters included in this library/macro\n# some ISO-standards may include more diameters!\n# Dictionary used for user messages\nstandard_diameters = {\n 'ISO4017': ('M1.6', 'M64'), # ISO 4017 Hex-head-screw\n 'ISO4014': ('M1.6', 'M64'), # ISO 4014 Hex-head-bolt\n 'EN1662': ('M5', 'M16'), # EN 1662 Hexagon bolts with flange, small series\n 'EN1665': ('M5', 'M20'), # EN 1665 Hexagon bolts with flange, heavy series\n 'ISO4762': ('M1.6', 'M64'), # ISO 4762 Hexagon socket head cap screws\n 'ISO2009': ('M1.6', 'M10'), # ISO 2009 Slotted countersunk flat head screws\n 'ISO2010': ('M1.6', 'M10'), # ISO 2010 Slotted raised countersunk head screws\n 'ISO1580': ('M1.6', 'M10'), # ISO 1580 Slotted pan head screws\n 'ISO7045': ('M1.6', 'M10'), # ISO 7045 Pan head screws type H cross recess\n 'ISO7046': ('M1.6', 'M10'),\n 'ISO7047': ('M1.6', 'M10'),\n 'ISO1207': ('M3', 'M10'), # ISO 1207 Slotted cheese head screws\n 'ISO7048': ('M2.5', 'M8'), # ISO 7048 Cross-recessed cheese head screws with type H cross recess\n 'ISO7380-1':('M3', 'M16'), # ISO 7380 Hexagon socket button head screws\n 'ISO7380-2':('M3', 'M16'), # ISO 7380 Hexagon socket button head screws with collar\n 'DIN967' :('M3', 'M8'), # DIN 967 Cross recessed pan head screws with collar\n 'ISO10642':('M3', 'M20'), # ISO 10642 Hexagon socket countersunk head screws\n 'ISO14579':('M2', 'M20'), # ISO 14579 Hexalobular socket head cap screws\n 'ISO14580':('M2', 'M10'), # ISO 14580 Hexalobular socket cheese head screws\n 'ISO14581':('M2', 'M10'), # ISO 14581 Hexalobular socket countersunk flat head screws (to do!!)\n 'ISO14582':('M3', 'M10'), # ISO 14582 Hexalobular socket countersunk head screws, high head\n 'ISO14583':('M2', 'M10'), # ISO 14583 Hexalobular socket pan head screws\n 'ISO14584':('M2', 'M10'), # ISO 14584 Hexalobular socket raised countersunk head screws\n 'ISO7089': ('M1.6', 'M64'), # Washer\n 'ISO7090': ('M5', 'M64'), # ISO 7090 definitions Plain washers, chamfered - Normal series\n 'ISO7091': ('M1.6', 'M64'), # ISO 7091 definitions Plain washer - Normal series Product Grade C\n 'ISO7092': ('M1.6', 'M36'), # ISO 7092 definitions Plain washers - Small series\n 'ISO7093-1': ('M3', 'M36'), # ISO 7093-1 Plain washer - Large series\n 'ISO7094': ('M5', 'M36'), # ISO 7094 definitions Plain washers - Extra large series\n 'ISO4032': ('M1.6', 'M64'), # ISO 4032 Hexagon nuts, Style 1\n 'ISO4033': ('M5', 'M36'), # ISO 4033 Hexagon nuts, Style 2\n 'ISO4035': ('M1.6', 'M64'), # ISO 4035 Hexagon thin nuts, chamfered\n 'ISO4036': ('M1.6', 'M10'), # ISO 4035 Hexagon thin nuts, unchamfered, todo no function coded\n 'EN1661': ('M5', 'M20')} # EN 1661 Hexagon nuts with flange\n\n# ISO 4017 Hex-head-screw\n# P, c, dw, e, k, r, s\niso4017head={\n 'M1.6': (0.35, 0.2, 2.9, 3.4, 1.1, 0.1, 3.2),\n 'M2': (0.40, 0.2, 3.7, 4.4, 1.4, 0.1, 4.0),\n 'M2.5': (0.45, 0.2, 4.6, 5.5, 1.7, 0.1, 5.0),\n 'M3': (0.5, 0.2, 5.2, 6.1, 2.0, 0.1, 5.5),\n '(M3.5)':(0.6, 0.2, 5.2, 6.6, 2.4, 0.1, 5.5),\n 'M4': (0.7, 0.2, 6.6, 7.7, 2.8, 0.2, 7.0), \n 'M5': (0.8, 0.2, 7.5, 8.9, 3.5, 0.2, 8.0),\n 'M6': (1.0, 0.2, 9.5, 11.05, 4.0, 0.25, 10.0),\n 'M8': (1.25, 0.3, 11.7, 14.5, 5.3, 0.25, 13.0),\n 'M10': (1.50, 0.3, 14.7, 17.9, 6.4, 0.4, 16.0),\n 'M12': (1.75, 0.3, 16.7, 20.1, 7.5, 0.6, 18.0),\n '(M14)': (2.00, 0.3, 20.5, 24.5, 8.8, 0.6, 22.0),\n 'M16': (2.00, 0.4, 22.4, 26.9, 10.0, 0.6, 24.0),\n '(M18)': (2.50, 0.4, 25.4, 30.2, 11.5, 0.6, 27.0),\n 'M20': (2.50, 0.4, 28.2, 33.7, 12.5, 0.8, 30.0),\n '(M22)': (2.50, 0.4, 31.8, 37.7, 14.0, 0.8, 34.0),\n 'M24': (3.00, 0.4, 33.7, 40.1, 15.0, 0.8, 36.0),\n '(M27)': (3.00, 0.4, 38.0, 45.2, 17.0, 1.0, 41.0),\n 'M30': (3.50, 0.4, 42.8, 50.9, 18.7, 1.0, 46.0), #dw not in class A, e not in class A\n '(M33)': (3.50, 0.4, 46.6, 55.4, 21.0, 1.0, 50.0), \n 'M36': (4.00, 0.4, 51.2, 61.0, 22.5, 1.0, 55.0), #dw not in class A, e not in class A\n '(M39)': (4.00, 0.5, 55.9, 66.5, 25.0, 1.0, 60.0),\n 'M42': (4.50, 0.7, 60.0, 71.3, 26.0, 1.2, 65.0),\n '(M45)': (4.50, 0.7, 64.7, 77.0, 28.0, 1.2, 70.0),\n 'M48': (5.00, 0.7, 69.5, 82.6, 30.0, 1.6, 75.0),\n '(M52)': (5.00, 0.7, 74.5, 88.3, 33.0, 1.6, 80.0),\n 'M56': (5.50, 0.7, 78.7, 93.6, 35.0, 2.0, 85.0),\n '(M60)': (5.50, 0.7, 82.7, 99.2, 38.0, 2.0, 90.0),\n 'M64': (6.00, 0.7, 88.2,104.9, 40.0, 2.0, 95.0)\n } \n\n\niso4017length = {\n '2': ( 1.8, 2.2),\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '100':(99.3, 100.7),\n '110':(109.3, 110.7),\n '120':(119.3, 120.7),\n '130':(129.2, 130.8),\n '140':(139.2, 130.8),\n '150':(149.2, 150.8),\n '160':(159.2, 160.8),\n '180':(179.2, 180.8),\n '200':(199.1, 200.9)\n }\n\n# range of typical srew lengths\n# min_length, max_length\niso4017range = {\n 'M1.6': ('2', '16'),\n 'M2': ('4', '20'),\n 'M2.5': ('5', '25'),\n 'M3': ('5', '30'),\n '(M3.5)':('8', '35'),\n 'M4': ('6', '40'),\n 'M5': ('8', '50'),\n 'M6': ('12', '60'),\n 'M8': ('16', '80'),\n 'M10': ('20','100'),\n 'M12': ('25','120'),\n '(M14)':('25','140'),\n 'M16': ('30','150'),\n '(M18)':('35','200'),\n 'M20': ('40','160'),\n '(M22)':('45','200'),\n 'M24': ('50','180'),\n '(M27)':('50','100'),\n 'M30': ('60','200'), \n '(M33)':('65','200'),\n 'M36': ('70','200'),\n '(M39)':('80','200'),\n 'M42': ('70','200'),\n '(M45)':('90','200'),\n 'M48': ('100','200'),\n '(M52)':('100','200'),\n 'M56': ('110','200'),\n '(M60)':('120','200'),\n 'M64': ('120','200')\n } \n\n\n# ISO 4014 Hex-head-bolt\n# P, b1, b2, b3, c, dw, e, k, r, s\niso4014head={\n 'M1.6': (0.35, 9.0, 15.0, 28.0, 0.2, 2.3, 3.4, 1.1, 0.1, 3.2),\n 'M2': (0.40, 10.0, 16.0, 29.0, 0.2, 3.0, 4.4, 1.4, 0.1, 4.0),\n 'M2.5': (0.45, 11.0, 17.0, 30.0, 0.2, 4.0, 5.5, 1.7, 0.1, 5.0),\n 'M3': (0.50, 12.0, 18.0, 31.0, 0.2, 4.6, 6.1, 2.0, 0.1, 5.5),\n '(M3.5)':(0.60, 13.0, 19.0, 32.0, 0.2, 5.1, 6.6, 2.4, 0.1, 6.0),\n 'M4': (0.70, 14.0, 20.0, 33.0, 0.2, 5.9, 7.7, 2.8, 0.2, 7.0),\n 'M5': (0.80, 16.0, 22.0, 35.0, 0.2, 6.9, 8.9, 3.5, 0.2, 8.0), \n 'M6': (1.00, 18.0, 24.0, 37.0, 0.2, 8.9, 11.05, 4.0, 0.25,10.0),\n 'M8': (1.25, 22.0, 28.0, 41.0, 0.3, 11.7, 14.5, 5.3, 0.4, 13.0),\n 'M10': (1.50, 26.0, 32.0, 45.0, 0.3, 14.7, 17.9, 6.4, 0.4, 16.0),\n 'M12': (1.75, 30.0, 36.0, 49.0, 0.3, 16.7, 20.1, 7.5, 0.6, 18.0),\n '(M14)': (2.00, 34.0, 40.0, 53.0, 0.3, 20.5, 24.5, 8.8, 0.6, 22.0),\n 'M16': (2.00, 38.0, 44.0, 57.0, 0.4, 22.4, 26.9, 10.0, 0.6, 24.0),\n '(M18)': (2.50, 42.0, 48.0, 61.0, 0.4, 25.4, 30.2, 11.5, 0.6, 27.0),\n 'M20': (2.50, 46.0, 52.0, 65.0, 0.4, 28.2, 33.7, 12.5, 0.8, 30.0),\n '(M22)': (2.50, 50.0, 56.0, 69.0, 0.4, 31.8, 37.7, 14.0, 0.8, 34.0),\n 'M24': (3.00, 54.0, 60.0, 73.0, 0.4, 33.7, 40.1, 15.0, 0.8, 36.0),\n '(M27)': (3.00, 60.0, 66.0, 79.0, 0.4, 38.0, 45.2, 17.0, 1.0, 41.0),\n 'M30': (3.50, 66.0, 72.0, 85.0, 0.4, 42.8, 50.9, 18.7, 1.0, 46.0), #dw not in class A, e not in class A\n '(M33)': (3.50, 78.0, 78.0, 91.0, 0.4, 46.6, 55.4, 21.0, 1.0, 50.0), \n 'M36': (4.00, 84.0, 84.0, 97.0, 0.4, 51.2, 60.8, 22.5, 1.0, 55.0),\n '(M39)': (4.00, 90.0, 90.0, 103.0, 0.5, 55.9, 66.5, 25.0, 1.0, 60.0),\n 'M42': (4.50, 96.0, 96.0, 109.0, 0.6, 60.0, 71.3, 26.0, 1.2, 65.0),\n '(M45)': (4.50, 102.0, 102.0, 115.0, 0.7, 64.7, 77.0, 28.0, 1.2, 70.0),\n 'M48': (5.00, 108.0, 108.0, 121.0, 0.6, 69.5, 82.6, 30.0, 1.6, 75.0),\n '(M52)': (5.00, 116.0, 116.0, 129.0, 0.7, 74.5, 88.3, 33.0, 1.6, 80.0),\n 'M56': (5.50, 137.0, 137.0, 137.0, 0.6, 78.7, 93.6, 35.0, 2.0, 85.0),\n '(M60)': (5.50, 145.0, 145.0, 145.0, 0.7, 82.7, 99.2, 38.0, 2.0, 90.0),\n 'M64': (6.00, 153.0, 153.0, 153.0, 0.6, 88.2,104.9, 40.0, 2.0, 55.0)\n }\n\n\niso4014length = {\n '12':(11.65, 12.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '100':(99.3, 100.7),\n '110':(109.3, 110.7),\n '120':(119.3, 120.7),\n '130':(129.2, 130.8),\n '140':(139.2, 130.8),\n '150':(149.2, 150.8),\n '160':(159.2, 160.8),\n '180':(179.2, 180.8),\n '200':(199.1, 200.9),\n '220':(219.1, 220.9), \n '240':(237.7, 242.3),\n '260':(219.1, 220.9),\n '280':(219.1, 220.9),\n '300':(219.1, 220.9),\n '320':(219.1, 220.9),\n '340':(219.1, 220.9),\n '360':(219.1, 220.9),\n '380':(219.1, 220.9),\n '400':(219.1, 220.9),\n '420':(219.1, 220.9),\n '440':(219.1, 220.9),\n '460':(219.1, 220.9),\n '480':(219.1, 220.9),\n '500':(496.85, 503.15) \n }\n\n# range of typical srew lengths\n# min_length, max_length\niso4014range = {\n 'M1.6':('12', '16'),\n 'M2': ('16', '20'),\n 'M2.5':('16', '25'),\n 'M3': ('20', '30'),\n '(M3.5)':('20', '35'),\n 'M4': ('25', '50'),\n 'M5': ('25', '50'),\n 'M6': ('30', '130'),\n 'M8': ('30', '180'),\n 'M10': ('35', '150'),\n 'M12': ('50', '150'),\n '(M14)': ('50', '160'),\n 'M16': ('55', '200'),\n '(M18)':('70','180'),\n 'M20': ('60', '300'),\n '(M22)':('70','220'),\n 'M24': ('80', '220'),\n '(M27)':('90', '220'),\n 'M30': ('110','300'),\n '(M33)':('130','320'),\n 'M36': ('140','360'),\n '(M39)':('150','380'),\n 'M42': ('160','440'),\n '(M45)':('180','440'),\n 'M48': ('180','480'),\n '(M52)':('200','480'),\n 'M56': ('220','500'),\n '(M60)':('220','500'),\n 'M64': ('260','500')\n }\n\n\n# EN 1662 Hexagon bolts with flange, small series\n# P, b0, b1, b2, b3, c, dc, dw, e, k, kw, lf, r1, s\nen1662def={\n 'M5': (0.80, 25.0, 16.0, 0.0, 0.0, 1.0, 11.4, 9.4, 7.59, 5.6, 2.3, 1.4, 0.2, 7.0), \n 'M6': (1.00, 30.0, 18.0, 0.0, 0.0, 1.1, 13.6, 11.6, 8.71, 6.9, 2.9, 1.6, 0.25, 8.0),\n 'M8': (1.25, 35.0, 22.0, 28.0, 0.0, 1.2, 17.0, 14.9, 10.95, 8.5, 3.8, 2.1, 0.4, 10.0),\n 'M10':(1.50, 40.0, 26.0, 32.0, 0.0, 1.5, 20.8, 18.7, 14.26, 9.7, 4.3, 2.1, 0.4, 13.0),\n 'M12':(1.75, 45.0, 30.0, 36.0, 0.0, 1.8, 24.7, 22.5, 17.62, 12.1, 5.4, 2.1, 0.6, 16.0),\n '(M14)':(2.00, 50.0, 34.0, 40.0, 0.0, 2.1, 28.6, 26.4, 19.86, 12.9, 5.6, 2.1, 0.6, 18.0),\n 'M16':(2.00, 55.0, 38.0, 44.0, 57.0, 2.4, 32.8, 30.6, 23.15, 15.2, 6.8, 3.2, 0.6, 21.0)}\n\n\n# range of typical srew lengths\n# min_length, max_length\nen1662range = {\n 'M5': ('10', '50'),\n 'M6': ('12', '60'),\n 'M8': ('16', '80'),\n 'M10':('20','100'),\n 'M12':('25','120'),\n '(M14)':('30','140'), \n 'M16':('35','160')\n } \n\nen1662length = {\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '90':(89.3, 90.7),\n '100':(99.3, 100.7),\n '110':(109.3, 110.7),\n '120':(119.3, 120.7),\n '130':(129.2, 130.8),\n '140':(139.2, 130.8),\n '150':(149.2, 150.8),\n '160':(159.2, 160.8)\n }\n\n\n# EN 1665 Hexagon bolts with flange, heavy series\n# P, b0, b1, b2, b3, c, dc, dw, e, k, kw, lf, r1, s\nen1665def={\n 'M5': (0.80, 25.0, 16.0, 0.0, 0.0, 1.0, 11.8, 9.8, 8.71, 5.8, 2.6, 1.4, 0.2, 8.0), \n 'M6': (1.00, 30.0, 18.0, 0.0, 0.0, 1.1, 14.2, 12.2, 10.95, 6.6, 3.0, 1.6, 0.25,10.0),\n 'M8': (1.25, 35.0, 22.0, 28.0, 0.0, 1.2, 18.0, 15.8, 14.26, 8.1, 3.9, 2.1, 0.4, 13.0),\n 'M10':(1.50, 40.0, 26.0, 32.0, 0.0, 1.5, 22.3, 19.6, 17.62, 10.4, 4.1, 2.1, 0.4, 16.0),\n 'M12':(1.75, 45.0, 30.0, 36.0, 0.0, 1.8, 26.6, 23.8, 19.86, 11.8, 5.6, 2.1, 0.6, 18.0),\n '(M14)':(2.00, 50.0, 34.0, 40.0, 0.0, 2.1, 30.5, 27.6, 23.15, 13.7, 6.5, 2.1, 0.6, 21.0),\n 'M16':(2.00, 55.0, 38.0, 44.0, 57.0, 2.4, 35.0, 31.9, 26.51, 15.4, 7.3, 3.2, 0.6, 24.0),\n 'M20':(2.50, 65.0, 46.0, 52.0, 65.0, 3.0, 43.0, 39.9, 33.23, 18.9, 8.9, 4.2, 0.8, 30.0)}\n\n\n# range of typical srew lengths\n# min_length, max_length\nen1665range = {\n 'M5': ('10', '50'),\n 'M6': ('12', '60'),\n 'M8': ('16', '80'),\n 'M10':('20','100'),\n 'M12':('25','120'),\n '(M14)':('30','140'), \n 'M16':('35','160'),\n 'M20':('65','200')\n } \n\nen1665length = {\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '90':(89.3, 90.7),\n '100':(99.3, 100.7),\n '110':(109.3, 110.7),\n '120':(119.3, 120.7),\n '130':(129.2, 130.8),\n '140':(139.2, 130.8),\n '150':(149.2, 150.8),\n '160':(159.2, 160.8),\n '180':(179.2, 180.8),\n '200':(199.1, 200.9)\n }\n\n\n# ISO 1207 definitions Class A, Slotted cheese head screws\n# P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x\niso1207def={\n 'M1.6':(0.35, 0.7, 25.0, 3.0, 2.9, 2.0, 1.1, 0.46, 0.1, 0.45, 0.9),\n 'M2': (0.40, 0.8, 25.0, 3.8, 3.7, 2.6, 1.4, 0.56, 0.1, 0.6, 1.0),\n 'M2.5':(0.45, 0.9, 25.0, 4.5, 4.4, 3.1, 1.8, 0.66, 0.1, 0.7, 1.1),\n 'M3': (0.50, 1.0, 25.0, 5.5, 5.4, 3.6, 2.0, 0.86, 0.1, 0.85, 1.25),\n '(M3.5)':(0.60, 1.2, 38.0, 6.0, 5.9, 4.1, 2.4, 1.06, 0.1, 1.0, 1.5),\n 'M4': (0.70, 1.4, 38.0, 7.0, 6.9, 4.7, 2.6, 1.26, 0.2, 1.1, 1.75),\n 'M5': (0.80, 1.6, 38.0, 8.5, 8.4, 5.7, 3.3, 1.26, 0.2, 1.3, 2.0),\n 'M6': (1.00, 2.0, 38.0, 10.0, 9.9, 6.8, 3.9, 1.66, 0.25,1.6, 2.5),\n 'M8': (1.25, 2.5, 38.0, 13.0, 12.85, 9.2, 5.0, 2.06, 0.4, 2.0, 3.2),\n 'M10': (1.50, 3.0, 38.0, 16.0, 15.85, 11.2,6.0, 2.56, 0.4, 2.4, 3.8)}\n\n# range of typical srew lengths\n# min_length, max_length\niso1207range = {\n 'M1.6':('2', '16'),\n 'M2': ('3', '20'),\n 'M2.5':('3', '25'),\n 'M3': ('4', '30'),\n '(M3.5)':('5', '35'),\n 'M4': ('5', '40'),\n 'M5': ('6', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '80'),\n 'M10':('12', '80')}\n\n# slotted cheese head screws\n# nom length: l_min, l_max \niso1207length = {\n '2': (1.8, 2.2),\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.05, 55.95),\n '60':(59.05, 60.95),\n '65':(64.05, 65.95),\n '70':(69.05, 70.95),\n '75':(74.05, 75.95),\n '80':(79.05, 80.95)\n }\n\n\n# ISO 14580 definitions , Hexalobular socket cheese head screws\n# P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x\n# tt, k, A, t_mean\niso14580def={\n 'M2': ('T6', 1.55, 1.75, 0.8),\n 'M2.5':('T8', 1.85, 2.40, 0.9),\n 'M3': ('T10', 2.40, 2.80, 1.2),\n '(M3.5)':('T15', 2.60, 3.35, 1.3),\n 'M4': ('T20', 3.10, 3.95, 1.5),\n 'M5': ('T25', 3.65, 4.50, 1.7),\n 'M6': ('T30', 4.40, 5.60, 2.1),\n 'M8': ('T45', 5.80, 7.95, 2.9),\n 'M10': ('T50', 6.90, 8.95, 3.3)}\n \n# range of typical srew lengths\n# min_length, max_length\n# iso14580range = iso1207range\n\n# nom length: l_min, l_max \niso14580length = {\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.05, 55.95),\n '60':(59.05, 60.95),\n '65':(64.05, 65.95),\n '70':(69.05, 70.95),\n '75':(74.05, 75.95),\n '80':(79.05, 80.95)\n }\n\n\n# ISO 7048 definitions Class A, \n# Cross-recessed cheese head screws with type H or Z cross recess\n# P, a, b, dk, dk_mean, da, k, r, x, cT, mH, mZ \niso7048def={\n 'M2.5':(0.45, 0.9, 25.0, 4.5, 4.4, 3.1, 1.8, 0.1, 1.1, '1', 2.7, 2.4),\n 'M3': (0.50, 1.0, 25.0, 5.5, 5.4, 3.6, 2.0, 0.1, 1.25,'2', 3.5, 3.5),\n '(M3.5)':(0.60, 1.2, 38.0, 6.0, 5.9, 4.1, 2.4, 0.1, 1.5, '2', 3.8, 3.7),\n 'M4': (0.70, 1.4, 38.0, 7.0, 6.9, 4.7, 2.6, 0.2, 1.75,'2', 4.1, 4.0),\n 'M5': (0.80, 1.6, 38.0, 8.5, 8.4, 5.7, 3.3, 0.2, 2.0, '2', 4.8, 4.6),\n 'M6': (1.00, 2.0, 38.0, 10.0, 9.9, 6.8, 3.9, 0.25,2.5, '3', 6.2, 6.1),\n 'M8': (1.25, 2.5, 38.0, 13.0, 12.85, 9.2, 5.0, 0.4, 3.2, '3', 7.7, 7.5)\n }\n\n# range of typical srew lengths\n# min_length, max_length\niso7048range = {\n 'M2.5':('3', '25'),\n 'M3': ('4', '30'),\n '(M3.5)':('5', '35'),\n 'M4': ('5', '40'),\n 'M5': ('6', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '80')}\n\n# nom length: l_min, l_max \niso7048length = {\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '60':(59.05, 60.95),\n '70':(69.05, 70.95),\n '80':(79.05, 80.95)\n }\n\n\n# Button Head Screw\n# nom length: l_min, l_max \niso7380length = {\n #'2.5':(2.3, 2.7),\n #'3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.05, 55.95),\n '60':(59.05, 60.95),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '90':(89.3, 90.7)\n }\n\n# ISO 7380-1 definitions Class A \n# http://www.agrati.com/it/unificati/it/gamma/unificati/home02.htm\n# P, b, a, da, dk, dk_mean,s_mean,t_min, r, k, e, w, \niso7380def={\n 'M3': (0.50, 18.0, 1.0, 3.6, 5.7, 5.5, 2.03, 1.04, 0.1, 1.65, 2.3, 0.2),\n 'M4': (0.70, 20.0, 1.4, 4.7, 7.6, 7.4, 2.54, 1.30, 0.2, 2.20, 2.87, 0.3),\n 'M5': (0.80, 22.0, 1.6, 5.7, 9.5, 9.3, 3.05, 1.56, 0.2, 2.75, 3.44, 0.38),\n 'M6': (1.00, 24.0, 2.0, 6.8, 10.5, 10.3, 4.05, 2.08, 0.25,3.3, 4.58, 0.74),\n 'M8': (1.25, 28.0, 2.5, 9.2, 14.0, 13.8, 5.05, 2.60, 0.4, 4.4, 5.72, 1.05),\n 'M10': (1.50, 32.0, 3.0, 11.2, 17.5, 17.3, 6.05, 3.12, 0.4, 5.5, 6.86, 1.45),\n 'M12': (1.75, 36.0, 3.5, 13.7, 21.0, 20.7, 8.06, 4.16, 0.6, 6.6, 9.15, 1.63),\n 'M16': (2.00, 44.0, 3.5, 17.7, 28.0, 27.8, 10.06,5.20, 0.6, 8.8, 11.43, 2.25)\n }\n\n# range of typical srew lengths\n# min_length, max_length\niso7380range = {\n 'M3': ('6', '30'),\n 'M4': ('6', '40'),\n 'M5': ('8', '50'),\n 'M6': ('10', '60'),\n 'M8': ('12', '80'),\n 'M10':('16', '90'),\n 'M12':('20', '90'),\n 'M16':('25', '90')}\n\n# ISO 7380-2 definitions \n# P, b, c, da, dk, dk_c,s_mean,t_min, r, k, e, w, \niso7380_2def={\n 'M3': (0.50, 18.0, 0.7, 3.6, 5.2, 6.9, 2.03, 1.04, 0.1, 1.65, 2.3, 0.2),\n 'M4': (0.70, 20.0, 0.8, 4.7, 7.2, 9.4, 2.54, 1.30, 0.2, 2.20, 2.87, 0.3),\n 'M5': (0.80, 22.0, 1.0, 5.7, 8.8, 11.8, 3.05, 1.56, 0.2, 2.75, 3.44, 0.38),\n 'M6': (1.00, 24.0, 1.2, 6.8, 10.0, 13.6, 4.05, 2.08, 0.25,3.3, 4.58, 0.74),\n 'M8': (1.25, 28.0, 1.5, 9.2, 13.2, 17.8, 5.05, 2.60, 0.4, 4.4, 5.72, 1.05),\n 'M10': (1.50, 32.0, 2.0, 11.2, 16.5, 21.9, 6.05, 3.12, 0.4, 5.5, 6.86, 1.45),\n 'M12': (1.75, 36.0, 2.4, 13.7, 19.4, 26.0, 8.06, 4.16, 0.6, 6.6, 9.15, 1.63),\n 'M16': (2.00, 44.0, 2.8, 17.7, 26.0, 34.0, 10.06,5.20, 0.6, 8.8, 11.43, 2.25)\n }\n\n\n# DIN 967 definitions: Cross recessed pan head screw with collar\n# P, b, c, da, dk, r, k, rf, x, cT, mH, mZ \ndin967def={\n 'M3': (0.50, 25.0, 0.7, 3.6, 7.5, 0.1, 2.35, 3.8, 1.25, '1', 3.0, 2.9),\n '(M3.5)':(0.60, 38.0, 0.8, 4.1, 9.0, 0.1, 2.60, 4.6, 1.5, '2', 4.2, 3.9),\n 'M4': (0.70, 38.0, 1.0, 4.7, 10.0, 0.2, 3.05, 5.8, 1.75, '2', 4.6, 4.3),\n 'M5': (0.80, 38.0, 1.2, 5.7, 11.5, 0.2, 3.55, 6.6, 2.0, '2', 5.0, 4.7),\n 'M6': (1.00, 38.0, 1.6, 6.8, 14.5, 0.25,4.55, 8.2, 2.5, '3', 7.1, 6.7),\n 'M8': (1.25, 38.0, 2.0, 9.2, 19.0, 0.4, 5.90, 11.0, 3.2, '4', 9.0, 8.8)\n }\n\n# range of typical srew lengths\n# min_length, max_length\ndin967range = {\n 'M3': ('4', '30'),\n '(M3.5)': ('5', '35'),\n 'M4': ('5', '40'),\n 'M5': ('6', '45'),\n 'M6': ('8', '60'),\n 'M8': ('10', '60')\n}\n# Button Head Screw\n# nom length: l_min, l_max \ndin967length = {\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.05, 55.95),\n '60':(59.05, 60.95)\n }\n\n\nL_iso2009length =['2.5','3','4','5','6','8','10','12','14','16','20', \\\n '25','30','35','40','45','50','55','60','65','70','75','80'] \n# nom length: l_min, l_max \niso2009length = {\n '2.5':(2.3, 2.7),\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.05, 55.95),\n '60':(59.05, 60.95),\n '65':(64.05, 65.95),\n '70':(69.05, 70.95),\n '75':(74.05, 75.95),\n '80':(79.05, 80.95)\n }\n\n\n# ISO 2009 definitions Class A\n# P, a, b, dk_theo, dk_mean, k, n_min, r, t_mean, x\niso2009def={\n 'M1.6':(0.35, 0.7, 25, 3.6, 2.8, 1.0, 0.46, 0.2, 0.4, 0.9),\n 'M2': (0.40, 0.8, 25, 4.4, 3.6, 1.2, 0.56, 0.3, 0.5, 1.0),\n 'M2.5':(0.45, 0.9, 25, 5.5, 4.5, 1.5, 0.66, 0.3, 0.6, 1.1),\n 'M3': (0.50, 1.0, 25, 6.3, 5.3, 1.65, 0.86, 0.4, 0.7, 1.25),\n '(M3.5)':(0.60, 1.2, 38, 8.2, 7.1, 2.35, 1.06, 0.4, 1.0, 1.5),\n 'M4': (0.70, 1.4, 38, 9.4, 8.2, 2.7, 1.26, 0.5, 1.1, 1.75),\n 'M5': (0.80, 1.6, 38,10.4, 9.2, 2.7, 1.26, 0.6, 1.2, 2.0),\n 'M6': (1.00, 2.0, 38,12.6, 11.2, 3.3, 1.66, 0.7, 1.4, 2.5),\n 'M8': (1.25, 2.5, 38,17.3, 15.6, 4.65, 2.06, 1.0, 2.0, 3.2),\n 'M10': (1.50, 3.0, 38,20.0, 18.1, 5.0, 2.56, 1.2, 2.3, 3.8)}\n \n# range of typical srew lengths\n# min_length, max_length\niso2009range = {\n 'M1.6':('2.5', '16'),\n 'M2': ('3', '20'),\n 'M2.5':('4', '25'),\n 'M3': ('5', '30'),\n '(M3.5)':('6', '35'),\n 'M4': ('6', '40'),\n 'M5': ('8', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '80'),\n 'M10':('12', '80')}\n\n\n# ISO 7046 definitions Class A\n# ISO 7046 Countersunk flat head srews (common head style)\n# with type H or type Z cross recess\n# Parameters P, a, b, dk_theo, dk_mean, k, r, x to be read from iso2009def\n# Length = iso7045length\n# cT, mH, mZ \niso7046def={\n 'M1.6':('0', 1.6, 1.6),\n 'M2': ('0', 1.9, 1.9),\n 'M2.5':('1', 2.9, 2.8),\n 'M3': ('1', 3.2, 3.0),\n '(M3.5)':('2', 4.4, 4.1),\n 'M4': ('2', 4.6, 4.4),\n 'M5': ('2', 5.2, 4.0),\n 'M6': ('3', 6.8, 6.6),\n 'M8': ('4', 8.9, 8.8),\n 'M10': ('4', 10.0,9.8)}\n\n# range of typical srew lengths\n# min_length, max_length\niso7046range = {\n 'M1.6':('3', '16'),\n 'M2': ('3', '20'),\n 'M2.5':('3', '25'),\n 'M3': ('4', '30'),\n '(M3.5)':('5', '35'),\n 'M4': ('5', '40'),\n 'M5': ('6', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '60'),\n 'M10':('12', '60')}\n\n# ISO 2010, ISO 7047 definitions Class A: Raised Countersunk head srews\n# ISO 2010 slotted screws (common head style) range = iso2009range\n# ISO 7047 with type H or type Z cross recess range = iso7046range\n# Parameters P, a, b, dk_theo, dk_mean, k, r, x to be read from iso2009def\n# Length = iso7045length\n# rf, t_mean, cT, mH, mZ \nRaised_countersunk_def={\n 'M1.6':(3.0, 0.7, '0', 1.9, 1.9),\n 'M2': (4.0, 0.9, '0', 2.0, 2.2),\n 'M2.5':(5.0, 1.1, '1', 3.0, 2.8),\n 'M3': (6.0, 1.3, '1', 3.4, 3.1),\n '(M3.5)':(8.5, 1.5, '2', 4.8, 4.6),\n 'M4': (9.5, 1.8, '2', 5.2, 5.0),\n 'M5': (9.5, 2.2, '2', 5.4, 5.3),\n 'M6': (12.0, 2.6, '3', 7.3, 7.1),\n 'M8': (16.5, 3.5, '4', 9.6, 9.5),\n 'M10': (19.5, 4.1, '4', 10.4,10.3)}\n\n\n# ISO 14582 definitions \n# P, a, b, dk_theo, dk_mean,k, r, tt, A, t_mean\niso14582def={\n 'M3': (0.50, 1.0, 18.0, 7.40, 6.5, 2.20, 0.10, 'T10', 2.80, 1.1),\n 'M4': (0.70, 1.4, 20.0, 10.02, 9.0, 3.01, 0.20, 'T20', 3.95, 1.6),\n 'M5': (0.80, 1.6, 22.0, 12.00, 10.8, 3.50, 0.20, 'T25', 4.50, 1.8),\n 'M6': (1.00, 2.0, 24.0, 14.44, 13.1, 4.22, 0.25, 'T30', 5.60, 2.2),\n 'M8': (1.25, 2.5, 28.0, 19.38, 17.8, 5.69, 0.40, 'T45', 7.93, 2.8),\n 'M10': (1.50, 3.0, 32.0, 23.00, 21.1, 6.50, 0.40, 'T50', 8.95, 3.3)}\n\n# range of typical srew lengths\n# min_length, max_length\niso14582range = {\n 'M3': ('8', '30'),\n 'M4': ('8', '40'),\n 'M5': ('8', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '80'),\n 'M10':('12', '100')}\n\n# nom length: l_min, l_max \niso14582length = {\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '90':(89.3, 90.7),\n '100':(99.3, 100.7)\n }\n\n\n# ISO 1580 definitions Class A, Slotted pan head screws\n# P, a, b, dk_max,da, k, n_min, r, rf, t_mean, x\niso1580def={\n 'M1.6':(0.35, 0.7, 25, 3.2, 2.0, 1.0, 0.46, 0.1, 0.5, 0.4, 0.9),\n 'M2': (0.4, 0.8, 25, 4.0, 2.6, 1.3, 0.56, 0.1, 0.6, 0.5, 1.0),\n 'M2.5':(0.45, 0.9, 25, 5.0, 3.1, 1.5, 0.66, 0.1, 0.8, 0.6, 1.1),\n 'M3': (0.5, 1.0, 25, 5.6, 3.6, 1.8, 0.86, 0.1, 0.9, 0.7, 1.25),\n '(M3.5)':(0.6, 1.2, 38, 7.0, 4.1, 2.1, 1.06, 0.1, 1.0, 0.8, 1.5),\n 'M4': (0.7, 1.4, 38, 8.0, 4.7, 2.4, 1.26, 0.2, 1.2, 1.0, 1.75),\n 'M5': (0.8, 1.6, 38, 9.5, 5.7, 3.0, 1.26, 0.2, 1.5, 1.2, 2.0),\n 'M6': (1.0, 2.0, 38, 12.0, 6.8, 3.6, 1.66, 0.25,1.8, 1.4, 2.5),\n 'M8': (1.25, 2.5, 38, 16.0, 9.2, 4.8, 2.06, 0.4, 2.4, 1.9, 3.2),\n 'M10': (1.50, 3.0, 38, 20.0,11.2, 6.0, 2.56, 0.4, 3.0, 2.4, 3.8)}\n\n\n# ISO 7045 definitions Class A, Pan head screws with type H or type Z\n# partly used also for ISO 14583 Hexalobular socket pan head screws\n# cross recess; cT = size of cross recess\n# P, a, b, dk_max,da, k, r, rf, x, cT, mH, mZ \niso7045def={\n 'M1.6':(0.35, 0.7, 25, 3.2, 2.0, 1.3, 0.1, 2.5, 0.9, '0', 1.7, 1.6),\n 'M2': (0.4, 0.8, 25, 4.0, 2.6, 1.6, 0.1, 3.2, 1.0, '0', 1.9, 2.1),\n 'M2.5':(0.45, 0.9, 25, 5.0, 3.1, 2.1, 0.1, 4.0, 1.1, '1', 2.7, 2.6),\n 'M3': (0.5, 1.0, 25, 5.6, 3.6, 2.4, 0.1, 5.0, 1.25,'1', 3.0, 2.8),\n '(M3.5)':(0.6, 1.2, 38, 7.0, 4.1, 2.6, 0.1, 6.0, 1.5, '2', 3.9, 3.9),\n 'M4': (0.7, 1.4, 38, 8.0, 4.7, 3.1, 0.2, 6.5, 1.75,'2', 4.4, 4.3),\n 'M5': (0.8, 1.6, 38, 9.5, 5.7, 3.7, 0.2, 8.0, 2.0, '2', 4.9, 4.7),\n 'M6': (1.0, 2.0, 38, 12.0, 6.8, 4.6, 0.25,10., 2.5, '3', 6.9, 6.7),\n 'M8': (1.25, 2.5, 38, 16.0, 9.2, 6.0, 0.4, 13., 3.2, '4', 9.0, 8.8),\n 'M10': (1.50, 3.0, 38, 20.0,11.2, 7.5, 0.4, 16., 3.8, '4', 10.1,9.9)}\n\n# nom length: l_min, l_max \niso7045length = {\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.05, 55.95),\n '60':(59.05, 60.95)\n }\n\n# range of typical srew lengths\n# min_length, max_length\niso7045range = {\n 'M1.6':('3', '16'),\n 'M2': ('3', '20'),\n 'M2.5':('3', '25'),\n 'M3': ('4', '30'),\n '(M3.5)':('5', '35'),\n 'M4': ('5', '40'),\n 'M5': ('6', '45'),\n 'M6': ('8', '60'),\n 'M8': ('10', '60'),\n 'M10':('12', '60')}\n\n\n# ISO 14583 Hexalobular socket pan head screws\n# hexalobular recess; tt = size of hexalobular recess\n\n# tt, A, t_mean\niso14583def={\n 'M2': ('T6', 1.75, 0.7),\n 'M2.5':('T8', 2.40, 1.0),\n 'M3': ('T10', 2.80, 1.2),\n '(M3.5)':('T15', 3.35, 1.3),\n 'M4': ('T20', 3.95, 1.5),\n 'M5': ('T25', 4.50, 1.7),\n 'M6': ('T30', 5.60, 2.2),\n 'M8': ('T45', 7.95, 3.0),\n 'M10': ('T50', 8.95, 3.8)}\n\n\n#iso14583range = iso7046range\n#iso14583length = iso7045length\n\n# ISO 14584 Hexalobular socket raised countersunk head screws\n# P, b, dk_theo, dk_mean, f, k, r, rf, x, tt, A, t_mean\niso14584def={\n 'M2': (0.40, 25.0, 4.4, 3.8, 0.5, 1.20, 0.2, 4.0, 1.00, 'T6', 1.75, 0.7),\n 'M2.5':(0.45, 25.0, 5.5, 4.7, 0.6, 1.50, 0.3, 5.0, 1.10, 'T8', 2.40, 1.0),\n 'M3': (0.50, 25.0, 6.3, 5.5, 0.7, 1.65, 0.4, 6.0, 1.25, 'T10', 2.80, 1.2),\n '(M3.5)':(0.60, 38.0, 8.2, 7.3, 0.8, 2.35, 0.4, 8.5, 1.50, 'T15', 3.35, 1.3),\n 'M4': (0.70, 38.0, 9.4, 8.4, 1.0, 2.70, 0.5, 9.5, 1.75, 'T20', 3.95, 1.5),\n 'M5': (0.80, 38.0, 10.4, 9.3, 1.2, 2.70, 0.6, 9.5, 2.00, 'T25', 4.50, 1.7),\n 'M6': (1.00, 38.0, 12.6, 11.3, 1.4, 3.30, 0.7, 12.0, 2.50, 'T30', 5.60, 2.2),\n 'M8': (1.25, 38.0, 17.3, 15.8, 2.0, 4.65, 1.0, 16.5, 3.20, 'T45', 7.95, 3.0),\n 'M10': (1.50, 38.0, 20.0, 18.3, 2.3, 5.00, 1.2, 19.5, 3.80, 'T50', 8.95, 3.8)}\n\n\n# range of typical srew lengths\n# min_length, max_length\niso14584range = {\n 'M2': ('3', '20'),\n 'M2.5':('3', '25'),\n 'M3': ('4', '30'),\n '(M3.5)':('5', '35'),\n 'M4': ('5', '40'),\n 'M5': ('6', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '60'),\n 'M10':('12', '60')}\n\n#iso14584length = iso7045length\n\n\n# ISO 4762 Hexagon socket head cap screws ( Allan screw)\n# ISO 4762 definitions\n# P, b, dk_max, da, ds_min, e, lf, k, r, s_mean, t, v, dw, w\niso4762def={\n 'M1.6':(0.35, 15.0, 3.0, 2.0, 1.46, 1.73, 0.34, 1.6, 0.1, 1.56, 0.7, 0.16, 2.72, 0.55),\n 'M2': (0.40, 16.0, 3.8, 2.6, 1.86, 1.73, 0.51, 2.0, 0.1, 1.56, 1.0, 0.2, 3.48, 0.55),\n 'M2.5':(0.45, 17.0, 4.5, 3.1, 2.36, 2.30, 0.51, 2.5, 0.1, 2.06, 1.1, 0.25, 4.18, 0.85),\n 'M3': (0.50, 18.0, 5.5, 3.6, 2.86, 2.87, 0.51, 3.0, 0.1, 2.56, 1.3, 0.3, 5.07, 1.15),\n 'M4': (0.70, 20.0, 7.0, 4.7, 3.82, 3.44, 0.60, 4.0, 0.2, 3.06, 2.0, 0.4, 6.53, 1.40),\n 'M5': (0.80, 22.0, 8.5, 5.7, 4.82, 4.58, 0.60, 5.0, 0.2, 4.06, 2.5, 0.5, 8.03, 1.9),\n 'M6': (1.00, 24.0, 10.0, 6.8, 5.82, 5.72, 0.68, 6.0, 0.25, 5.06, 3.0, 0.6, 9.38, 2.3),\n 'M8': (1.25, 28.0, 13.0, 9.2, 7.78, 6.86, 1.02, 8.0, 0.4, 6.06, 4.0, 0.8, 12.33, 3.3),\n 'M10': (1.50, 32.0, 16.0, 11.2, 9.78, 9.15, 1.02, 10.0, 0.4, 8.07, 5.0, 1.0, 15.33, 4.0),\n 'M12': (1.75, 36.0, 18.0, 13.7, 11.73, 11.43, 1.45, 12.0, 0.6, 10.07, 6.0, 1.2, 17.23, 4.8),\n '(M14)':(2.00, 40.0, 21.0, 15.7, 13.73, 13.72, 1.45, 14.0, 0.6, 12.07, 7.0, 1.4, 20.17, 5.8),\n 'M16': (2.00, 44.0, 24.0, 17.7, 15.73, 16.00, 1.45, 16.0, 0.6, 14.08, 8.0, 1.6, 23.17, 6.8),\n 'M20': (2.50, 52.0, 30.0, 22.4, 19.67, 19.44, 2.04, 20.0, 0.8, 17.10, 10.0, 2.0, 28.87, 8.6),\n 'M24': (3.00, 60.0, 36.0, 26.4, 23.67, 21.73, 2.04, 24.0, 0.8, 19.15, 12.0, 2.0, 34.81, 10.4),\n 'M30': (3.50, 72.0, 45.0, 33.4, 29.67, 25.15, 2.89, 30.0, 1.0, 22.15, 15.5, 2.4, 43.61, 13.1),\n 'M36': (4.00, 84.0, 54.0, 39.4, 35.61, 30.85, 2.89, 36.0, 1.0, 27.15, 19.0, 3.0, 52.54, 15.3),\n 'M42': (4.50, 96.0, 63.0, 45.6, 41.61, 36.58, 3.06, 42.0, 1.2, 32.15, 24.0, 4.2, 61.34, 16.3),\n 'M48': (5.00, 108.0, 72.0, 52.6, 47.61, 41.14, 3.91, 48.0, 1.6, 36.15, 28.0, 4.8, 70.34, 17.5),\n 'M56': (5.50, 124.0, 84.0, 63.0, 55.54, 46.84, 5.95, 56.0, 2.0, 41.15, 34.0, 5.6, 82.26, 19.0),\n 'M64': (6.00, 140.0, 96.0, 71.0, 63.54, 52.54, 5.95, 64.0, 2.0, 46.15, 38.0, 6.4, 94.26, 22.0)\n }\n\n# nom length: l_min, l_max \niso4762length = {\n '2.5':(2.3, 2.7),\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '14':(13.65, 14.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '75':(74.4, 75.6),\n '80':(79.4, 80.6),\n '100':(99.3, 100.7),\n '110':(109.3, 110.7),\n '120':(119.3, 120.7),\n '130':(129.2, 130.8),\n '140':(139.2, 130.8),\n '150':(149.2, 150.8),\n '160':(159.2, 160.8),\n '180':(179.2, 180.8),\n '200':(199.1, 200.9),\n '220':(219.1, 220.9), \n '240':(237.7, 242.3),\n '260':(219.1, 220.9),\n '280':(219.1, 220.9),\n '300':(219.1, 220.9)\n }\n\n# range of typical srew lengths\n# min_length, max_length\niso4762range = {\n 'M1.6':('2.5', '16'),\n 'M2': ('3', '20'),\n 'M2.5':('4', '25'),\n 'M3': ('5', '30'),\n '(M3.5)':('6', '35'),\n 'M4': ('6', '40'),\n 'M5': ('8', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '80'),\n 'M10':('16', '100'),\n 'M12':('20', '120'),\n '(M14)':('25', '140'),\n 'M16':('25', '160'),\n 'M20':('16', '100'),\n 'M24':('40', '200'),\n 'M30':('45', '200'),\n 'M36':('55', '200'), \n 'M42':('60', '300'),\n 'M48':('100','300'),\n 'M56':('110','300'),\n 'M64':('120','300')\n }\n\n\n# ISO 14579 Hexalobular socket head cap screws\n# hexalobular recess; tt = size of hexalobular recess\n\n# tt, A, t_mean\niso14579def={\n 'M2': ( 'T6', 1.75, 0.8),\n 'M2.5':( 'T8', 2.40, 1.0),\n 'M3': ('T10', 2.80, 1.2),\n 'M4': ('T20', 3.95, 1.7),\n 'M5': ('T25', 4.50, 1.9),\n 'M6': ('T30', 5.60, 2.3),\n 'M8': ('T45', 7.95, 3.2),\n 'M10': ('T50', 8.95, 3.8),\n 'M12': ('T55', 11.35, 5.0),\n '(M14)': ('T60', 13.45, 5.8),\n 'M16': ('T70', 15.70, 6.8),\n '(M18)': ('T80', 17.75, 7.8),\n 'M20': ('T90', 20.20, 9.0),\n }\n\n# range of typical srew lengths\n# min_length, max_length\niso14579range = {\n 'M2': ('3', '20'),\n 'M2.5':('4', '25'),\n 'M3': ('5', '30'),\n 'M4': ('6', '40'),\n 'M5': ('8', '50'),\n 'M6': ('10', '60'),\n 'M8': ('12', '80'),\n 'M10':('16','100'),\n 'M12':('20','120'),\n '(M14)':('25','140'), \n 'M16':('25','160'),\n '(M18)':('30','180'),\n 'M20':('30','200'),\n } \n\niso14579length = {\n '3': ( 2.8, 3.2),\n '4': ( 3.76, 4.24),\n '5': ( 4.76, 5.24),\n '6': ( 5.76, 6.24),\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '90':(89.3, 90.7),\n '100':(99.3, 100.7),\n '110':(109.3, 110.7),\n '120':(119.3, 120.7),\n '130':(129.2, 130.8),\n '140':(139.2, 130.8),\n '150':(149.2, 150.8),\n '160':(159.2, 160.8),\n '180':(179.2, 180.8),\n '200':(199.1, 200.9)\n }\n\n\n# ISO 10642 Hexagon socket countersunk head screws ( Allan screw)\n# ISO 10642 definitions\n# P, b, dk_theo, dk_mean,da, ds_min, e, k, r, s_mean, t, w\niso10642def={\n 'M3': (0.50, 18.0, 6.72, 6.0, 3.3, 2.86, 2.31, 1.86, 0.1, 2.06, 1.1, 0.25),\n 'M4': (0.70, 20.0, 8.96, 8.0, 4.4, 3.82, 2.88, 2.48, 0.2, 2.56, 1.5, 0.45),\n 'M5': (0.80, 22.0, 11.20, 10.0, 5.5, 4.82, 3.45, 3.10, 0.2, 3.06, 1.9, 0.66),\n 'M6': (1.00, 24.0, 13.44, 12.0, 6.6, 5.82, 4.59, 3.72, 0.25, 4.06, 2.2, 0.70),\n 'M8': (1.25, 28.0, 17.92, 16.0, 8.54, 7.78, 5.73, 4.96, 0.4, 5.06, 3.0, 1.16),\n 'M10': (1.50, 32.0, 22.40, 20.5, 10.62, 9.78, 6.87, 6.20, 0.4, 6.06, 3.6, 1.62),\n 'M12': (1.75, 36.0, 26.88, 25.0, 13.5, 11.73, 9.15, 7.44, 0.6, 8.07, 4.3, 1.80),\n '(M14)': (2.00, 40.0, 30.80, 28.4, 15.5, 13.73, 11.43, 8.40, 0.6, 10.07, 4.5, 1.62),\n 'M16': (2.00, 44.0, 33.60, 31.0, 17.5, 15.73, 11.43, 8.80, 0.6, 10.07, 4.8, 2.20),\n 'M20': (2.50, 52.0, 40.32, 38.0, 22.0, 19.67, 13.72, 10.16, 0.8, 12.10, 5.6, 2.20)}\n\n# range of typical srew lengths\n# min_length, max_length\niso10642range = {\n 'M3': ('8', '30'),\n 'M4': ('8', '40'),\n 'M5': ('8', '50'),\n 'M6': ('8', '60'),\n 'M8': ('10', '80'),\n 'M10':('12','100'),\n 'M12':('20','100'),\n '(M14)':('25','100'), \n 'M16':('30','100'),\n 'M20':('35','100'),\n } \n\niso10642length = {\n '8': ( 7.71, 8.29),\n '10':( 9.71, 10.29),\n '12':(11.65, 12.35),\n '16':(15.65, 16.35),\n '20':(19.58, 20.42),\n '25':(24.58, 25.42),\n '30':(29.58, 30.42),\n '35':(34.5, 35.5),\n '40':(39.5, 40.5),\n '45':(44.5, 45.5),\n '50':(49.5, 50.5),\n '55':(54.4, 55.6),\n '60':(59.4, 60.6),\n '65':(64.4, 65.6),\n '70':(69.4, 70.6),\n '80':(79.4, 80.6),\n '90':(89.3, 90.7),\n '100':(99.3, 100.7),\n }\n\n\n# ISO 7089 definitions Washer\n# d1_min, d2_max, h, h_max\niso7089def={\n 'M1.6':( 1.7, 4.0, 0.3, 0.35),\n 'M2': ( 2.2, 5.0, 0.3, 0.35),\n 'M2.5':( 2.7, 6.0, 0.5, 0.55),\n 'M3': ( 3.2, 7.0, 0.5, 0.55),\n 'M4': ( 4.3, 9.0, 0.8, 0.90),\n 'M5': ( 5.3, 10.0, 1.0, 1.10),\n 'M6': ( 6.4, 12.0, 1.6, 1.80),\n 'M8': ( 8.4, 16.0, 1.6, 1.80),\n 'M10': (10.5, 20.0, 2.0, 2.20),\n 'M12': (13.0, 24.0, 2.5, 2.70),\n 'M16': (17.0, 30.0, 3.0, 3.30),\n 'M20': (21.0, 37.0, 3.0, 3.30),\n 'M24': (25.0, 44.0, 4.0, 4.30),\n 'M30': (31.0, 56.0, 4.0, 4.30),\n 'M36': (37.0, 66.0, 5.0, 5.60),\n 'M42': (45.0, 78.0, 8.0, 9.0),\n 'M48': (52.0, 92.0, 8.0, 9.0),\n 'M56': (62.0,105.0,10.0, 11.0),\n 'M64': (70.0,115.0,10.0, 11.0)\n } \n\n\n# ISO 7090 definitions Plain washers, chamfered - Normal series\n# chamfer angle 30° / 45°\n# chamfer h/4 / h/2\n# d1_min, d2_max, h, h_max\niso7090def={\n 'M5': ( 5.3, 10.0, 1.0, 1.10),\n 'M6': ( 6.4, 12.0, 1.6, 1.80),\n 'M8': ( 8.4, 16.0, 1.6, 1.80),\n 'M10': (10.5, 20.0, 2.0, 2.20),\n 'M12': (13.0, 24.0, 2.5, 2.70),\n 'M16': (17.0, 30.0, 3.0, 3.30),\n 'M20': (21.0, 37.0, 3.0, 3.30),\n 'M24': (25.0, 44.0, 4.0, 4.30),\n 'M30': (31.0, 56.0, 4.0, 4.30),\n 'M36': (37.0, 66.0, 5.0, 5.60),\n 'M42': (45.0, 78.0, 8.0, 9.0),\n 'M48': (52.0, 92.0, 8.0, 9.0),\n 'M56': (62.0,105.0,10.0, 11.0),\n 'M64': (70.0,115.0,10.0, 11.0)\n } \n\n\n# ISO 7091 definitions Plain washer - Normal series Product Grade C\n# d1_min, d2_max, h, h_max\niso7091def={\n 'M1.6':( 1.8, 4.0, 0.3, 0.35),\n 'M2': ( 2.4, 5.0, 0.3, 0.35),\n 'M2.5':( 2.9, 6.0, 0.5, 0.55),\n 'M3': ( 3.4, 7.0, 0.5, 0.55),\n 'M4': ( 4.5, 9.0, 0.8, 0.90),\n 'M5': ( 5.5, 10.0, 1.0, 1.10),\n 'M6': ( 6.6, 12.0, 1.6, 1.80),\n 'M8': ( 9.0, 16.0, 1.6, 1.80),\n 'M10': (11.0, 20.0, 2.0, 2.20),\n 'M12': (13.5, 24.0, 2.5, 2.70),\n 'M16': (17.5, 30.0, 3.0, 3.30),\n 'M20': (22.0, 37.0, 3.0, 3.30),\n 'M24': (26.0, 44.0, 4.0, 4.30),\n 'M30': (33.0, 56.0, 4.0, 4.30),\n 'M36': (39.0, 66.0, 5.0, 5.60),\n 'M42': (45.0, 78.0, 8.0, 9.0),\n 'M48': (52.0, 92.0, 8.0, 9.0),\n 'M56': (62.0,105.0,10.0, 11.0),\n 'M64': (70.0,115.0,10.0, 11.0)\n } \n\n\n# ISO 7092 definitions Plain washers - Small series\n# d1_min, d2_max, h, h_max\niso7092def={\n 'M1.6':( 1.7, 3.5, 0.3, 0.35),\n 'M2': ( 2.2, 4.5, 0.3, 0.35),\n 'M2.5':( 2.7, 5.0, 0.5, 0.55),\n 'M3': ( 3.2, 6.0, 0.5, 0.55),\n 'M4': ( 4.3, 8.0, 0.5, 0.55),\n 'M5': ( 5.3, 9.0, 1.0, 1.10),\n 'M6': ( 6.4, 11.0, 1.6, 1.80),\n 'M8': ( 8.4, 15.0, 1.6, 1.80),\n 'M10': (10.5, 18.0, 1.6, 1.80),\n 'M12': (13.0, 20.0, 2.0, 2.20),\n 'M16': (17.0, 28.0, 2.5, 2.70),\n 'M20': (21.0, 34.0, 3.0, 3.30),\n 'M24': (25.0, 39.0, 4.0, 4.30),\n 'M30': (31.0, 50.0, 4.0, 4.30),\n 'M36': (37.0, 60.0, 5.0, 5.60)\n } \n\n\n# ISO 7093-1 definitions Plain washers - Large series\n# d1_min, d2_max, h, h_max\niso7093def={\n 'M3': ( 3.2, 9.0, 0.8, 0.90),\n '(M3.5)':( 3.7, 11.0, 0.8, 0.90),\n 'M4': ( 4.3, 12.0, 1.0, 1.10),\n 'M5': ( 5.3, 15.0, 1.0, 1.10),\n 'M6': ( 6.4, 18.0, 1.6, 1.80),\n 'M8': ( 8.4, 24.0, 2.0, 2.20),\n 'M10': (10.5, 30.0, 2.5, 2.70),\n 'M12': (13.0, 37.0, 3.0, 3.30),\n '(M14)': (15.0, 44.0, 3.0, 3.30),\n 'M16': (17.0, 50.0, 3.0, 3.30),\n '(M18)': (19.0, 56.0, 4.0, 4.30),\n 'M20': (21.0, 60.0, 4.0, 4.30),\n '(M22)': (23.0, 66.0, 5.0, 5.60),\n 'M24': (25.0, 72.0, 5.0, 5.60),\n '(M27)': (30.0, 85.0, 6.0, 6.60),\n 'M30': (33.0, 92.0, 6.0, 6.60),\n '(M33)': (36.0,105.0, 6.0, 6.60),\n 'M36': (39.0,110.0, 8.0, 9.00)\n } \n\n\n# ISO 7094 definitions Plain washers - Extra large series\n# d1_min, d2_max, h, h_max\niso7094def={\n 'M5': ( 5.5, 18.0, 2.0, 2.3),\n 'M6': ( 6.6, 22.0, 2.0, 2.3),\n 'M8': ( 9.0, 28.0, 3.0, 3.6),\n 'M10': (11.0, 34.0, 3.0, 3.6),\n 'M12': (13.5, 44.0, 4.0, 4.6),\n '(M14)': (15.5, 50.0, 4.0, 4.6),\n 'M16': (17.5, 56.0, 5.0, 6.0),\n '(M18)': (20.0, 60.0, 5.0, 6.0),\n 'M20': (22.0, 72.0, 6.0, 7.0),\n '(M22)': (24.0, 80.0, 6.0, 7.0),\n 'M24': (26.0, 85.0, 6.0, 7.0),\n '(M27)': (30.0, 98.0, 6.0, 7.0),\n 'M30': (33.0,105.0, 6.0, 7.0),\n '(M33)': (36.0,115.0, 8.0, 9.2),\n 'M36': (39.0,125.0, 8.0, 9.2)\n } \n\n\n# ISO 4757:1983 Definition of cross recess type H\n# b, e_min, g, f_mean, r, t1, alpha, beta\niso4757def = {\n '0': (0.61, 0.26, 0.81, 0.34, 0.3, 0.22, 138.0, 7.0 ),\n '1': (0.97, 0.41, 1.27, 0.54, 0.5, 0.34, 138.0, 7.0 ),\n '2': (1.47, 0.79, 2.29, 0.70, 0.6, 0.61, 140.0, 5.75),\n '3': (2.41, 1.98, 3.81, 0.83, 0.8, 1.01, 146.0, 5.75),\n '4': (3.48, 2.39, 5.08, 1.23, 1.0, 1.35, 153.0, 7.0 )\n }\n\n# ISO 10664 Hexalobular internal driving feature for bolts and screws\n# A, B, Re\niso10664def = {\n 'T6': ( 1.75, 1.205, 0.14),\n 'T8': ( 2.40, 1.67, 0.20),\n 'T10':( 2.80, 1.98, 0.24),\n 'T15':( 3.35, 2.35, 0.28),\n 'T20':( 3.95, 2.75, 0.32),\n 'T25':( 4.50, 3.16, 0.39),\n 'T30':( 5.60, 3.95, 0.46),\n 'T40':( 6.75, 4.76, 0.56),\n 'T45':( 7.93, 5.55, 0.59),\n 'T50':( 8.95, 6.36, 0.78),\n 'T55':(11.35, 7.92, 0.77),\n 'T60':(13.45, 9.48, 1.07),\n 'T70':(15.70, 11.08, 1.20),\n 'T80':(17.75, 12.64, 1.53),\n 'T90':(20.20, 14.22, 1.54),\n 'T100':(22.40,15.81, 1.73)\n } \n\n\n# ISO 4032 Hex-head-nut\n# P, c, damax, dw, e, m, mw, s_nom\niso4032def={\n 'M1.6': (0.35, 0.2, 1.84, 2.9, 3.4, 1.3, 0.8, 3.2),\n 'M2': (0.40, 0.2, 2.3, 3.7, 4.4, 1.6, 1.1, 4.0),\n 'M2.5': (0.45, 0.2, 2.9, 4.6, 5.5, 2.0, 1.4, 5.0),\n 'M3': (0.5, 0.2, 3.45, 5.2, 6.1, 2.4, 1.7, 5.5),\n '(M3.5)':(0.6, 0.2, 4.00, 5.7, 6.6, 2.8, 2.0, 6.0),\n 'M4': (0.7, 0.2, 4.6, 6.6, 7.7, 3.2, 2.3, 7.0), \n 'M5': (0.8, 0.2, 5.75, 7.5, 8.9, 3.5, 3.5, 8.0),\n 'M6': (1.0, 0.2, 6.75, 9.5, 11.05, 4.7, 3.9, 10.0),\n 'M8': (1.25, 0.3, 8.75, 11.7, 14.5, 6.8, 5.2, 13.0),\n 'M10': (1.50, 0.3, 10.8, 14.7, 17.9, 8.4, 6.4, 16.0),\n 'M12': (1.75, 0.3, 13.0, 16.7, 20.1, 10.8, 8.3, 18.0),\n '(M14)': (2.00, 0.3, 15.1, 20.5, 24.5, 12.8, 9.7, 22.0),\n 'M16': (2.00, 0.4, 17.3, 22.4, 26.9, 14.8, 11.3, 24.0),\n '(M18)': (2.50, 0.4, 19.5, 24.9, 29.6, 15.8, 12.3, 27.0),\n 'M20': (2.50, 0.4, 21.6, 28.2, 33.7, 18.0, 13.5, 30.0),\n '(M22)': (2.50, 0.4, 23.7, 31.4, 37.3, 19.4, 15.0, 34.0),\n 'M24': (3.00, 0.4, 25.9, 33.7, 40.1, 21.5, 16.2, 36.0),\n '(M27)': (3.00, 0.4, 29.1, 38.0, 45.2, 23.8, 18.0, 41.0),\n 'M30': (3.50, 0.4, 32.4, 42.8, 50.9, 25.6, 19.4, 46.0), \n '(M33)': (3.50, 0.4, 35.6, 46.6, 55.4, 28.7, 21.4, 50.0), \n 'M36': (4.00, 0.4, 38.9, 51.2, 61.0, 31.0, 23.5, 55.0),\n '(M39)': (4.00, 0.5, 42.1, 55.9, 66.5, 33.4, 24.5, 60.0),\n 'M42': (4.50, 0.7, 45.4, 60.0, 71.3, 34.0, 25.9, 65.0),\n '(M45)': (4.50, 0.7, 48.6, 64.7, 77.0, 36.0, 27.9, 70.0),\n 'M48': (5.00, 0.7, 51.8, 69.5, 82.6, 38.0, 29.1, 75.0),\n '(M52)': (5.00, 0.7, 56.2, 74.5, 88.3, 42.0, 32.1, 80.0),\n 'M56': (5.50, 0.7, 60.5, 78.7, 93.6, 45.0, 34.7, 85.0),\n '(M60)': (5.50, 0.7, 64.8, 82.7, 99.2, 48.0, 38.7, 90.0),\n 'M64': (6.00, 0.7, 69.1, 88.2,104.9, 51.0, 39.3, 95.0)\n } \n\n\n# ISO 4033 Hexagon nuts style 2\n# P, c, damax, dw, e, m, mw, s_nom\niso4033def={\n 'M5': (0.8, 0.2, 5.75, 7.5, 8.9, 5.1, 3.5, 8.0),\n 'M6': (1.0, 0.2, 6.75, 9.5, 11.05, 5.7, 3.9, 10.0),\n 'M8': (1.25, 0.3, 8.75, 11.7, 14.5, 7.5, 5.2, 13.0),\n 'M10': (1.50, 0.3, 10.8, 14.7, 17.9, 9.3, 6.4, 16.0),\n 'M12': (1.75, 0.3, 13.0, 16.7, 20.1, 12.0, 8.3, 18.0),\n '(M14)': (2.00, 0.3, 15.1, 20.5, 24.5, 14.1, 9.7, 22.0),\n 'M16': (2.00, 0.4, 17.3, 22.4, 26.9, 16.4, 11.3, 24.0),\n 'M20': (2.50, 0.4, 21.6, 28.2, 33.7, 20.3, 13.5, 30.0),\n 'M24': (3.00, 0.4, 25.9, 33.7, 40.1, 23.9, 16.2, 36.0),\n 'M30': (3.50, 0.4, 32.4, 42.8, 50.9, 28.6, 19.4, 46.0), \n 'M36': (4.00, 0.4, 38.9, 51.2, 61.0, 33.1, 23.5, 55.0)\n }\n\n\n# ISO 4035 Hexagon thin nuts, chamfered\n# P, c, damax, dw, e, m, mw, s_nom\niso4035def={\n 'M1.6': (0.35, 0.2, 1.84, 2.9, 3.4, 1.0, 0.8, 3.2),\n 'M2': (0.40, 0.2, 2.3, 3.7, 4.4, 1.2, 1.1, 4.0),\n 'M2.5': (0.45, 0.2, 2.9, 4.6, 5.5, 1.6, 1.4, 5.0),\n 'M3': (0.5, 0.2, 3.45, 5.2, 6.1, 1.8, 1.7, 5.5),\n '(M3.5)':(0.6, 0.2, 4.00, 5.7, 6.6, 2.0, 2.0, 6.0),\n 'M4': (0.7, 0.2, 4.6, 6.6, 7.7, 2.2, 2.3, 7.0), \n 'M5': (0.8, 0.2, 5.75, 7.5, 8.9, 2.7, 3.5, 8.0),\n 'M6': (1.0, 0.2, 6.75, 9.5, 11.05, 3.2, 3.9, 10.0),\n 'M8': (1.25, 0.3, 8.75, 11.7, 14.5, 4.0, 5.2, 13.0),\n 'M10': (1.50, 0.3, 10.8, 14.7, 17.9, 5.0, 6.4, 16.0),\n 'M12': (1.75, 0.3, 13.0, 16.7, 20.1, 6.0, 8.3, 18.0),\n '(M14)': (2.00, 0.3, 15.1, 20.5, 24.5, 7.0, 9.7, 22.0),\n 'M16': (2.00, 0.4, 17.3, 22.4, 26.9, 8.0, 11.3, 24.0),\n '(M18)': (2.50, 0.4, 19.5, 24.9, 29.6, 9.0, 12.3, 27.0),\n 'M20': (2.50, 0.4, 21.6, 28.2, 33.7, 10.0, 13.5, 30.0),\n '(M22)': (2.50, 0.4, 23.7, 31.4, 37.3, 11.0, 15.0, 34.0),\n 'M24': (3.00, 0.4, 25.9, 33.7, 40.1, 12.0, 16.2, 36.0),\n '(M27)': (3.00, 0.4, 29.1, 38.0, 45.2, 13.5, 18.0, 41.0),\n 'M30': (3.50, 0.4, 32.4, 42.8, 50.9, 15.0, 19.4, 46.0), \n '(M33)': (3.50, 0.4, 35.6, 46.6, 55.4, 16.5, 21.4, 50.0), \n 'M36': (4.00, 0.4, 38.9, 51.2, 61.0, 18.0, 23.5, 55.0),\n '(M39)': (4.00, 0.5, 42.1, 55.9, 66.5, 19.5, 24.5, 60.0),\n 'M42': (4.50, 0.7, 45.4, 60.0, 71.3, 21.0, 25.9, 65.0),\n '(M45)': (4.50, 0.7, 48.6, 64.7, 77.0, 22.5, 27.9, 70.0),\n 'M48': (5.00, 0.7, 51.8, 69.5, 82.6, 24.0, 29.1, 75.0),\n '(M52)': (5.00, 0.7, 56.2, 74.5, 88.3, 26.0, 32.1, 80.0),\n 'M56': (5.50, 0.7, 60.5, 78.7, 93.6, 28.0, 34.7, 85.0),\n '(M60)': (5.50, 0.7, 64.8, 82.7, 99.2, 30.0, 38.7, 90.0),\n 'M64': (6.00, 0.7, 69.1, 88.2,104.9, 32.0, 39.3, 95.0)\n }\n\n\n# ISO 4036 Hexagon thin nuts, unchamfered\n# P, e, m, s_nom\niso4036def={\n 'M1.6': (0.35, 3.4, 1.0, 3.2),\n 'M2': (0.40, 4.4, 1.2, 4.0),\n 'M2.5': (0.45, 5.5, 1.6, 5.0),\n 'M3': (0.5, 6.1, 1.8, 5.5),\n '(M3.5)':(0.6, 6.6, 2.0, 6.0),\n 'M4': (0.7, 7.7, 2.2, 7.0), \n 'M5': (0.8, 8.9, 2.7, 8.0),\n 'M6': (1.0, 10.9, 3.2, 10.0),\n 'M8': (1.25, 14.5, 4.0, 13.0),\n 'M10': (1.50, 17.9, 5.0, 16.0)}\n\n\n# EN 1661 Hexagon nuts with flange\n# P, damax, c, dc, dw, e, m, mw, r, s\nen1661def={\n 'M5' :(0.80, 5.75, 1.0, 11.8, 9.8, 8.79, 5.0, 2.5, 0.30, 8.0), \n 'M6' :(1.00, 6.75, 1.1, 14.2, 12.2, 11.05, 6.0, 3.1, 0.36, 10.0),\n 'M8' :(1.25, 8.75, 1.2, 17.9, 15.8, 14.38, 8.0, 4.6, 0.48, 13.0),\n 'M10' :(1.50, 10.80, 1.5, 21.8, 19.6, 17.77, 10.0, 5.9, 0.60, 16.0),\n 'M12' :(1.75, 13.00, 1.8, 26.0, 23.8, 20.03, 12.0, 6.8, 0.72, 18.0),\n '(M14)':(2.00, 15.10, 2.1, 29.9, 27.6, 23.36, 14.0, 7.7, 0.88, 21.0),\n 'M16' :(2.00, 17.30, 2.4, 34.5, 31.9, 26.75, 16.0, 8.9, 0.96, 24.0),\n 'M20' :(2.50, 21.60, 3.0, 42.8, 39.9, 33.23, 20.0,10.7, 1.20, 30.0)}\n\n\n# Tuning table to get valid shapes\n# P, tunIn, tunEx \ntuningTable={\n 'M1.6':(0.35, 516, 516),\n 'M2': (0.40, 515, 516),\n 'M2.5':(0.45, 515, 515),\n 'M3': (0.5, 480, 502),\n '(M3.5)':(0.6, 480, 502),\n 'M4': (0.7, 510, 519), #last value needed for ISO7380\n 'M5': (0.8, 510, 510),\n 'M6': (1.0, 515, 515),\n 'M8': (1.25, 516, 516),\n 'M10': (1.50, 515, 515),\n 'M12': (1.75, 513, 513),\n '(M14)': (2.00, 513, 513),\n 'M16': (2.00, 513, 513),\n 'M20': (2.50, 513, 513),\n 'M24': (3.00, 513, 513),\n '(M27)': (3.00, 513, 513),\n 'M30': (3.50, 513, 513),\n '(M33)': (3.50, 513, 513),\n 'M36': (4.00, 513, 513),\n 'M42': (4.50, 515, 515),\n '(M45)': (4.50, 515, 515),\n 'M48': (5.00, 515, 505), # ISO4014: 505, 502 or 488; ISO4017: above 505\n '(M52)': (5.00, 508, 508),\n 'M56': (5.50, 508, 508),\n '(M60)': (5.50, 508, 508),\n 'M64': (6.00, 489, 489) # Nut ISO4032: 489\n } \n\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s\n\nclass Ui_ScrewMaker(object):\n def setupUi(self, ScrewMaker):\n FCUi = FreeCADGui.UiLoader()\n\n ScrewMaker.setObjectName(_fromUtf8(\"ScrewMaker\"))\n ScrewMaker.resize(450, 362)\n ScrewMaker.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom))\n self.layoutWidget = QtGui.QWidget(ScrewMaker)\n self.layoutWidget.setGeometry(QtCore.QRect(348, 35, 102, 161))\n self.layoutWidget.setObjectName(_fromUtf8(\"layoutWidget\"))\n self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget)\n #self.verticalLayout_2.setMargin(0)\n self.verticalLayout_2.setObjectName(_fromUtf8(\"verticalLayout_2\"))\n self.ScrewTypeLabel = QtGui.QLabel(self.layoutWidget)\n self.ScrewTypeLabel.setObjectName(_fromUtf8(\"ScrewTypeLabel\"))\n self.verticalLayout_2.addWidget(self.ScrewTypeLabel)\n self.NomDiaLabel = QtGui.QLabel(self.layoutWidget)\n self.NomDiaLabel.setObjectName(_fromUtf8(\"NomDiaLabel\"))\n self.verticalLayout_2.addWidget(self.NomDiaLabel)\n self.NomLenLabel = QtGui.QLabel(self.layoutWidget)\n self.NomLenLabel.setObjectName(_fromUtf8(\"NomLenLabel\"))\n self.verticalLayout_2.addWidget(self.NomLenLabel)\n self.UserLenLabel = QtGui.QLabel(self.layoutWidget)\n self.UserLenLabel.setObjectName(_fromUtf8(\"UserLenLabel\"))\n self.verticalLayout_2.addWidget(self.UserLenLabel)\n\n self.layoutWidget1 = QtGui.QWidget(ScrewMaker)\n self.layoutWidget1.setGeometry(QtCore.QRect(3, 35, 350, 166))\n #self.layoutWidget1.setGeometry(QtCore.QRect(10, 5, 315, 200))\n self.layoutWidget1.setObjectName(_fromUtf8(\"layoutWidget1\"))\n self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget1)\n #self.verticalLayout.setMargin(0)\n self.verticalLayout.setObjectName(_fromUtf8(\"verticalLayout\"))\n self.ScrewType = QtGui.QComboBox(self.layoutWidget1)\n self.ScrewType.setObjectName(_fromUtf8(\"ScrewType\"))\n for i in range(32):\n self.ScrewType.addItem(_fromUtf8(\"\")) # 0\n\n self.verticalLayout.addWidget(self.ScrewType)\n self.NominalDiameter = QtGui.QComboBox(self.layoutWidget1)\n self.NominalDiameter.setObjectName(_fromUtf8(\"NominalDiameter\"))\n for i in range(28):\n self.NominalDiameter.addItem(_fromUtf8(\"\")) # 0\n\n self.verticalLayout.addWidget(self.NominalDiameter)\n self.NominalLength = QtGui.QComboBox(self.layoutWidget1)\n self.NominalLength.setObjectName(_fromUtf8(\"NominalLength\"))\n for i in range(48):\n self.NominalLength.addItem(_fromUtf8(\"\")) #0\n\n self.verticalLayout.addWidget(self.NominalLength)\n #self.UserLen = QtGui.QComboBox(self.layoutWidget1)\n self.UserLen = FCUi.createWidget(\"Gui::InputField\")\n self.UserLen.setObjectName(_fromUtf8(\"UserLen\"))\n #self.UserLen.addItem(_fromUtf8(\"\"))\n self.UserLen.setProperty(\"text\", \"0 mm\")\n self.verticalLayout.addWidget(self.UserLen)\n\n #self.CommentLabel = QtGui.QLabel(self.layoutWidget)\n self.CommentLabel = QtGui.QLabel(ScrewMaker)\n self.CommentLabel.setObjectName(_fromUtf8(\"CommentLabel\"))\n self.CommentLabel.setGeometry(QtCore.QRect(10, 184, 411, 21))\n #self.verticalLayout.addWidget(self.CommentLabel)\n\n\n self.layoutWidget2 = QtGui.QWidget(ScrewMaker)\n #self.layoutWidget2.setGeometry(QtCore.QRect(10, 200, 321, 83))\n self.layoutWidget2.setGeometry(QtCore.QRect(3, 200, 321, 120))\n self.layoutWidget2.setObjectName(_fromUtf8(\"layoutWidget2\"))\n self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget2)\n #self.verticalLayout_3.setMargin(0)\n self.verticalLayout_3.setObjectName(_fromUtf8(\"verticalLayout_3\"))\n self.SimpleScrew = QtGui.QRadioButton(self.layoutWidget2)\n self.SimpleScrew.setChecked(True)\n self.SimpleScrew.setObjectName(_fromUtf8(\"SimpleScrew\"))\n self.verticalLayout_3.addWidget(self.SimpleScrew)\n self.SymbolThread = QtGui.QRadioButton(self.layoutWidget2)\n self.SymbolThread.setObjectName(_fromUtf8(\"SymbolThread\"))\n self.verticalLayout_3.addWidget(self.SymbolThread)\n self.RealThread = QtGui.QRadioButton(self.layoutWidget2)\n self.RealThread.setObjectName(_fromUtf8(\"RealThread\"))\n self.verticalLayout_3.addWidget(self.RealThread)\n self.MessageLabel = QtGui.QLabel(ScrewMaker)\n self.MessageLabel.setGeometry(QtCore.QRect(10, 10, 411, 21))\n self.MessageLabel.setProperty(\"Empty_text\", _fromUtf8(\"\"))\n self.MessageLabel.setObjectName(_fromUtf8(\"MessageLabel\"))\n self.CreateButton = QtGui.QToolButton(ScrewMaker)\n self.CreateButton.setGeometry(QtCore.QRect(180, 320, 111, 26))\n self.CreateButton.setObjectName(_fromUtf8(\"CreateButton\"))\n self.ScrewAvailable = Trueself.simpThread = self.SimpleScrew.isChecked()\n self.symThread = self.SymbolThread.isChecked()\n self.rThread = self.RealThread.isChecked()self.theScrew = Screw()\n\n\n self.retranslateUi(ScrewMaker)\n self.NominalDiameter.setCurrentIndex(5)\n self.NominalLength.setCurrentIndex(9)\n QtCore.QObject.connect(self.ScrewType, QtCore.SIGNAL(_fromUtf8(\"currentIndexChanged(int)\")), self.guiCheck_Data)\n QtCore.QObject.connect(self.CreateButton, QtCore.SIGNAL(_fromUtf8(\"pressed()\")), self.guiCreateScrew)\n QtCore.QObject.connect(self.NominalDiameter, QtCore.SIGNAL(_fromUtf8(\"currentIndexChanged(int)\")), self.guiCheck_Data)\n QtCore.QObject.connect(self.NominalLength, QtCore.SIGNAL(_fromUtf8(\"currentIndexChanged(int)\")), self.guiCheck_Data)\n QtCore.QMetaObject.connectSlotsByName(ScrewMaker)\n\n def retranslateUi(self, ScrewMaker):\n ScrewMaker.setWindowTitle(QtGui.QApplication.translate(\"ScrewMaker\", \"Screw-Maker 2.0\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewTypeLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Type of Screw\", None, QtGui.QApplication.UnicodeUTF8))\n self.NomDiaLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Nomimal\\nDiameter\", None, QtGui.QApplication.UnicodeUTF8))\n self.NomLenLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Nominal\\nLength\", None, QtGui.QApplication.UnicodeUTF8))\n self.UserLenLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"User length \\nfor screw-tap\", None, QtGui.QApplication.UnicodeUTF8))\n self.CommentLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Values in brackets are not recommended!\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(0, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO4017: Hexagon head screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(1, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO4014: Hexagon head bolts\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(2, QtGui.QApplication.translate(\"ScrewMaker\", \"EN1662: Hexagon bolts with flange, small\\n series\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(3, QtGui.QApplication.translate(\"ScrewMaker\", \"EN1665: Hexagon bolts with flange, heavy\\n series\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(4, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO4762: Hexagon socket head cap screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(5, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7380-1: Hexagon socket button head\\n screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(6, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7380-2: Hexagon socket button head\\n screws with collar\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(7, QtGui.QApplication.translate(\"ScrewMaker\", \"DIN967: Cross recessed pan head screws\\n with collar\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(8, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO10642: Hexagon socket countersunk \\n head screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(9, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO2009: Slotted countersunk flat head\\n screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(10, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO2010: Slotted raised countersunk head\\n screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(11, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO1207: Slotted cheese head screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(12, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO1580: Slotted pan head screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(13, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7045: Pan head screws, type H cross recess\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(14, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7046: Countersunk flat head screws\\n H cross recess\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(15, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7047: Raised countersunk head screws\\n H cross recess\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(16, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7048: Cheese head screws type H cross recess\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(17, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO14579: Hexalobular socket head cap screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(18, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO14580: Hexalobular socket cheese head\\n screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(19, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO14583: Hexalobular socket pan head screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(20, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO14582: Hexalobular socket countersunk\\n head screws, high head\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(21, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO14584: Hexalobular socket raised\\n countersunk head screws\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(22, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7089: Plain washers - Normal series\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(23, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7090: Plain washers, chamfered - Normal series\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(24, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7092: Plain washers - Small series\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(25, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7093-1: Plain washer - Large series\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(26, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO7094: Plain washers - Extra large series\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(27, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO4032: Hexagon nuts, Style 1\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(28, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO4033: Hexagon nuts, Style 2\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(29, QtGui.QApplication.translate(\"ScrewMaker\", \"ISO4035: Hexagon thin nuts, chamfered\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(30, QtGui.QApplication.translate(\"ScrewMaker\", \"EN1661: Hexagon nuts with flange\", None, QtGui.QApplication.UnicodeUTF8))\n self.ScrewType.setItemText(31, QtGui.QApplication.translate(\"ScrewMaker\", \"ScrewTap: ISO Screw-Tap\", None, QtGui.QApplication.UnicodeUTF8))self.NominalDiameter.setItemText(0, QtGui.QApplication.translate(\"ScrewMaker\", \"M1.6\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(1, QtGui.QApplication.translate(\"ScrewMaker\", \"M2\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(2, QtGui.QApplication.translate(\"ScrewMaker\", \"M2.5\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(3, QtGui.QApplication.translate(\"ScrewMaker\", \"M3\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(4, QtGui.QApplication.translate(\"ScrewMaker\", \"(M3.5)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(5, QtGui.QApplication.translate(\"ScrewMaker\", \"M4\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(6, QtGui.QApplication.translate(\"ScrewMaker\", \"M5\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(7, QtGui.QApplication.translate(\"ScrewMaker\", \"M6\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(8, QtGui.QApplication.translate(\"ScrewMaker\", \"M8\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(9, QtGui.QApplication.translate(\"ScrewMaker\", \"M10\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(10, QtGui.QApplication.translate(\"ScrewMaker\", \"M12\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(11, QtGui.QApplication.translate(\"ScrewMaker\", \"(M14)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(12, QtGui.QApplication.translate(\"ScrewMaker\", \"M16\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(13, QtGui.QApplication.translate(\"ScrewMaker\", \"(M18)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(14, QtGui.QApplication.translate(\"ScrewMaker\", \"M20\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(15, QtGui.QApplication.translate(\"ScrewMaker\", \"(M22)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(16, QtGui.QApplication.translate(\"ScrewMaker\", \"M24\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(17, QtGui.QApplication.translate(\"ScrewMaker\", \"(M27)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(18, QtGui.QApplication.translate(\"ScrewMaker\", \"M30\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(19, QtGui.QApplication.translate(\"ScrewMaker\", \"M36\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(20, QtGui.QApplication.translate(\"ScrewMaker\", \"(M33)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(21, QtGui.QApplication.translate(\"ScrewMaker\", \"M42\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(22, QtGui.QApplication.translate(\"ScrewMaker\", \"(M45)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(23, QtGui.QApplication.translate(\"ScrewMaker\", \"M48\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(24, QtGui.QApplication.translate(\"ScrewMaker\", \"(M52)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(25, QtGui.QApplication.translate(\"ScrewMaker\", \"M54\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(26, QtGui.QApplication.translate(\"ScrewMaker\", \"(M60)\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalDiameter.setItemText(27, QtGui.QApplication.translate(\"ScrewMaker\", \"M64\", None, QtGui.QApplication.UnicodeUTF8))\n\n self.NominalLength.setItemText(0, QtGui.QApplication.translate(\"ScrewMaker\", \"2\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(1, QtGui.QApplication.translate(\"ScrewMaker\", \"2.5\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(2, QtGui.QApplication.translate(\"ScrewMaker\", \"3\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(3, QtGui.QApplication.translate(\"ScrewMaker\", \"4\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(4, QtGui.QApplication.translate(\"ScrewMaker\", \"5\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(5, QtGui.QApplication.translate(\"ScrewMaker\", \"6\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(6, QtGui.QApplication.translate(\"ScrewMaker\", \"8\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(7, QtGui.QApplication.translate(\"ScrewMaker\", \"10\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(8, QtGui.QApplication.translate(\"ScrewMaker\", \"12\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(9, QtGui.QApplication.translate(\"ScrewMaker\", \"16\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(10, QtGui.QApplication.translate(\"ScrewMaker\", \"20\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(11, QtGui.QApplication.translate(\"ScrewMaker\", \"25\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(12, QtGui.QApplication.translate(\"ScrewMaker\", \"30\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(13, QtGui.QApplication.translate(\"ScrewMaker\", \"35\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(14, QtGui.QApplication.translate(\"ScrewMaker\", \"40\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(15, QtGui.QApplication.translate(\"ScrewMaker\", \"45\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(16, QtGui.QApplication.translate(\"ScrewMaker\", \"50\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(17, QtGui.QApplication.translate(\"ScrewMaker\", \"55\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(18, QtGui.QApplication.translate(\"ScrewMaker\", \"60\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(19, QtGui.QApplication.translate(\"ScrewMaker\", \"65\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(20, QtGui.QApplication.translate(\"ScrewMaker\", \"70\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(21, QtGui.QApplication.translate(\"ScrewMaker\", \"80\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(22, QtGui.QApplication.translate(\"ScrewMaker\", \"90\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(23, QtGui.QApplication.translate(\"ScrewMaker\", \"100\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(24, QtGui.QApplication.translate(\"ScrewMaker\", \"110\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(25, QtGui.QApplication.translate(\"ScrewMaker\", \"120\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(26, QtGui.QApplication.translate(\"ScrewMaker\", \"130\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(27, QtGui.QApplication.translate(\"ScrewMaker\", \"140\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(28, QtGui.QApplication.translate(\"ScrewMaker\", \"150\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(29, QtGui.QApplication.translate(\"ScrewMaker\", \"160\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(30, QtGui.QApplication.translate(\"ScrewMaker\", \"180\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(31, QtGui.QApplication.translate(\"ScrewMaker\", \"200\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(32, QtGui.QApplication.translate(\"ScrewMaker\", \"220\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(33, QtGui.QApplication.translate(\"ScrewMaker\", \"240\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(34, QtGui.QApplication.translate(\"ScrewMaker\", \"260\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(35, QtGui.QApplication.translate(\"ScrewMaker\", \"280\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(36, QtGui.QApplication.translate(\"ScrewMaker\", \"300\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(37, QtGui.QApplication.translate(\"ScrewMaker\", \"320\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(38, QtGui.QApplication.translate(\"ScrewMaker\", \"340\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(39, QtGui.QApplication.translate(\"ScrewMaker\", \"360\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(40, QtGui.QApplication.translate(\"ScrewMaker\", \"380\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(41, QtGui.QApplication.translate(\"ScrewMaker\", \"400\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(42, QtGui.QApplication.translate(\"ScrewMaker\", \"420\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(43, QtGui.QApplication.translate(\"ScrewMaker\", \"440\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(44, QtGui.QApplication.translate(\"ScrewMaker\", \"460\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(45, QtGui.QApplication.translate(\"ScrewMaker\", \"480\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(46, QtGui.QApplication.translate(\"ScrewMaker\", \"500\", None, QtGui.QApplication.UnicodeUTF8))\n self.NominalLength.setItemText(47, QtGui.QApplication.translate(\"ScrewMaker\", \"User\", None, QtGui.QApplication.UnicodeUTF8))\n #self.UserLen.setItemText(0, QtGui.QApplication.translate(\"ScrewMaker\", \"regular pitch\", None, QtGui.QApplication.UnicodeUTF8))\n self.SimpleScrew.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Simple Screw (no thread at all!)\", None, QtGui.QApplication.UnicodeUTF8))\n self.SymbolThread.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Symbol Thread (not implemented yet)\", None, QtGui.QApplication.UnicodeUTF8))\n self.RealThread.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Real Thread (takes time, memory intensive)\\nMay not work for all screws!\", None, QtGui.QApplication.UnicodeUTF8))\n self.MessageLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"Select your screw type\", None, QtGui.QApplication.UnicodeUTF8))\n self.MessageLabel.setProperty(\"Errortext\", QtGui.QApplication.translate(\"ScrewMaker\", \"Combination not implemented\", None, QtGui.QApplication.UnicodeUTF8))\n self.MessageLabel.setProperty(\"OK_text\", QtGui.QApplication.translate(\"ScrewMaker\", \"Screw is made\", None, QtGui.QApplication.UnicodeUTF8))\n self.CreateButton.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"create\", None, QtGui.QApplication.UnicodeUTF8))\n\n\n def guiCheck_Data(self):\n ST_text = str(self.ScrewType.currentText())\n ST_text = ST_text.split(':')[0]\n ND_text = str(self.NominalDiameter.currentText())\n NL_text = str(self.NominalLength.currentText())\n M_text, self.ScrewAvailable = self.theScrew.check_Data(ST_text, ND_text, NL_text)\n self.MessageLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", M_text, None, QtGui.QApplication.UnicodeUTF8))\n\n\n def guiCreateScrew(self):\n #self.simpThread = self.SimpleScrew.isChecked()\n #self.symThread = self.SymbolThread.isChecked()\n #self.rThread = self.RealThread.isChecked()\n if self.SimpleScrew.isChecked():\n threadType = 'simple'\n if self.SymbolThread.isChecked():\n threadType = 'symbol'\n if self.RealThread.isChecked():\n threadType = 'real'\n \n ND_text = str(self.NominalDiameter.currentText())\n NL_text = str(self.NominalLength.currentText())\n ST_text = str(self.ScrewType.currentText())\n ST_text = ST_text.split(':')[0]if ST_text == 'ScrewTap':\n if NL_text == 'User':\n textValue = self.UserLen.property(\"text\")\n stLength = FreeCAD.Units.parseQuantity(textValue).Value\n NL_text = str(stLength)\n\n myObj = self.theScrew.createScrew(ST_text, ND_text, NL_text, threadType)\n\n\nclass Screw(object):\n def __init__(self):\n self.objAvailable = True\n self.Tuner = 510\n \n def check_Data(self, ST_text, ND_text, NL_text):\n #FreeCAD.Console.PrintMessage(\"Data checking\" + NL_text + \"\\n\")\n #set screw not ok\n self.objAvailable = False\n M_text = \"Select your screw type\"\n Type_text = ''\n if ST_text == 'ISO4017':\n table = iso4017head\n tab_len = iso4017length\n tab_range = iso4017range\n Type_text = 'Screw'\n\n if ST_text == 'EN1662':\n table = en1662def\n tab_len = en1662length\n tab_range = en1662range\n Type_text = 'Screw'\n \n if ST_text == 'EN1665':\n table = en1665def\n tab_len = en1665length\n tab_range = en1665range\n Type_text = 'Screw'\n \n if ST_text == 'ISO2009':\n table = iso2009def\n tab_len = iso2009length\n tab_range = iso2009range\n Type_text = 'Screw'\n if ST_text == 'ISO2010':\n table = iso2009def\n tab_len = iso2009length\n tab_range = iso2009range\n Type_text = 'Screw'\n if ST_text == 'ISO4762':\n table = iso4762def\n tab_len = iso4762length\n tab_range = iso4762range\n Type_text = 'Screw'\n\n if ST_text == 'ISO10642':\n table = iso10642def\n tab_len = iso10642length\n tab_range = iso10642range\n Type_text = 'Screw'\n\n if ST_text == 'ISO4014':\n table = iso4014head\n tab_len = iso4014length\n tab_range = iso4014range\n Type_text = 'Screw'\n \n if ST_text == 'ISO1207':\n table = iso1207def\n tab_len = iso1207length\n tab_range = iso1207range\n Type_text = 'Screw'\n if ST_text == 'ISO1580':\n table = iso1580def\n tab_len = iso2009length\n tab_range = iso2009range\n Type_text = 'Screw'\n\n if ST_text == 'ISO7045':\n table = iso7045def\n tab_len = iso7045length\n tab_range = iso7045range\n Type_text = 'Screw'\n\n if ST_text == 'ISO7046':\n table = iso7046def # contains only cross recess data\n tab_len = iso7045length\n tab_range = iso7046range\n Type_text = 'Screw'\n\n if ST_text == 'ISO7047':\n table = iso2009def \n tab_len = iso7045length\n tab_range = iso7046range\n Type_text = 'Screw'\n\n if ST_text == 'ISO7048':\n table = iso7048def\n tab_len = iso7048length\n tab_range = iso7048range\n Type_text = 'Screw'\n\n if ST_text == 'ISO7380-1':\n table = iso7380def\n tab_len = iso7380length\n tab_range = iso7380range\n Type_text = 'Screw'\n\n if ST_text == 'ISO7380-2':\n table = iso7380_2def\n tab_len = iso7380length\n tab_range = iso7380range\n Type_text = 'Screw'\n\n if ST_text == 'DIN967':\n table = din967def\n tab_len = din967length\n tab_range = din967range\n Type_text = 'Screw'\n\n if ST_text == 'ISO14579':\n table = iso14579def\n tab_len = iso14579length\n tab_range = iso14579range\n Type_text = 'Screw'\n\n if ST_text == 'ISO14580':\n table = iso14580def\n tab_len = iso14580length\n tab_range = iso1207range\n Type_text = 'Screw'\n\n if ST_text == 'ISO14583':\n table = iso14583def\n tab_len = iso7045length\n tab_range = iso7046range\n Type_text = 'Screw'\n\n if ST_text == 'ISO14584':\n table = iso14584def\n tab_len = iso7045length\n tab_range = iso14584range\n Type_text = 'Screw'\n\n if ST_text == 'ISO14582':\n table = iso14582def\n tab_len = iso14582length\n tab_range = iso14582range\n Type_text = 'Screw'\n\n if ST_text == 'ISO7089':\n table = iso7089def\n Type_text = 'Washer'\n\n if ST_text == 'ISO7090':\n table = iso7090def\n Type_text = 'Washer'\n\n if ST_text == 'ISO7091':\n table = iso7091def\n Type_text = 'Washer'\n\n if ST_text == 'ISO7092':\n table = iso7092def\n Type_text = 'Washer'\n\n if ST_text == 'ISO7093-1':\n table = iso7093def\n Type_text = 'Washer'\n \n if ST_text == 'ISO7094':\n table = iso7094def\n Type_text = 'Washer'\n\n if ST_text == 'ISO4032':\n table = iso4032def\n Type_text = 'Nut'\n\n if ST_text == 'ISO4033':\n table = iso4033def\n Type_text = 'Nut'\n\n if ST_text == 'ISO4035':\n table = iso4035def\n Type_text = 'Nut'\n\n if ST_text == 'ISO4036':\n table = iso4036def\n Type_text = 'Nut'\n\n if ST_text == 'EN1661':\n table = en1661def\n Type_text = 'Nut'\n\n if ST_text == 'ScrewTap':\n table = tuningTable\n Type_text = 'Screw-Tap'\n\n if ND_text not in table:\n ND_min, ND_max = standard_diameters[ST_text]\n M_text = ST_text+' has diameters from '+ ND_min +' to ' + ND_max + ' and not ' + ND_text +'!'\n self.objAvailable = False\n # set scew not ok\n else:\n if Type_text == 'Screw':\n #NL_text = str(self.NominalLength.currentText())\n NL_min, NL_max = tab_range[ND_text]\n NL_min_float = float(NL_min)\n NL_max_float = float(NL_max)\n if NL_text == 'User':\n M_text = 'User length is only available for the screw-tab!'\n self.objAvailable = False\n else:\n NL_text_float = float(NL_text)\n if (NL_text_floatNL_max_float)or(NL_text not in tab_len): \n if '(' in ND_text:\n ND_text = ND_text.lstrip('(').rstrip(')')\n M_text = ST_text+'-'+ ND_text +' has lengths from '+ NL_min +' to ' + NL_max + ' and not ' + NL_text +'!'\n self.objAvailable = False\n # set screw not ok\n else:\n if '(' in ND_text:\n ND_text = ND_text.lstrip('(').rstrip(')')\n M_text = ST_text+'-'+ ND_text +'x'+ NL_text +' is in library available! '\n self.objAvailable = True\n #set screw ok\n else: # Washers and Nuts\n if not (Type_text == 'Screw-Tap'):\n if '(' in ND_text:\n ND_text = ND_text.lstrip('(').rstrip(')')\n M_text = ST_text+'-'+ ND_text +' is in library available! '\n self.objAvailable = True\n #set washer/nut ok\n else:\n if NL_text == 'User':\n M_text = 'Screw-tab with user length is ok!'\n self.objAvailable = True\n else:\n #NL_text = str(self.NominalLength.currentText())\n if '(' in ND_text:\n ND_text = ND_text.lstrip('(').rstrip(')')\n M_text = ST_text+'-'+ ND_text +' with '+ NL_text +'mm length is in library available! '\n self.objAvailable = True\n #set screwTap ok#print \"Data checking: \", self.NominalLength.currentText(), \"\\n\"\n #FreeCAD.Console.PrintMessage(\"Set Check_result into text \" + str(self.objAvailable) + M_text + \"\\n\")\n return M_text, self.objAvailable\n\n\n def createScrew(self, ST_text, ND_text, NL_text, threadType):\n #self.simpThread = self.SimpleScrew.isChecked()\n #self.symThread = self.SymbolThread.isChecked()\n #self.rThread = self.RealThread.isChecked()\n if threadType == 'real':\n self.rThread = True\n else:\n self.rThread = Falseif self.objAvailable:\n try:\n # first we check if valid numbers have been entered\n #FreeCAD.Console.PrintMessage(\"NominalLength: \" + self.NominalLength.currentText() + \"\\n\")\n #FreeCAD.Console.PrintMessage(\"NominalDiameter: \" + self.NominalDiameter.currentText() + \"\\n\")\n #FreeCAD.Console.PrintMessage(\"SimpleThread: \" + str(self.SimpleScrew.isChecked()) + \"\\n\")\n #FreeCAD.Console.PrintMessage(\"SymbolThread: \" + str(self.SymbolThread.isChecked()) + \"\\n\")\n #FreeCAD.Console.PrintMessage(\"RealThread: \" + str(self.RealThread.isChecked()) + \"\\n\")\n \n #ND_text = str(self.NominalDiameter.currentText())\n #NL_text = str(self.NominalLength.currentText())\n #ST_text = str(self.ScrewType.currentText())\n #ST_text = ST_text.split(':')[0]\n #dia = float(ND_text.lstrip('M'))\n l = float(NL_text)\n if ST_text == 'ISO4017':\n table = iso4017head\n if ST_text == 'ISO4014':\n table = iso4014head\n if ST_text == 'EN1662':\n table = en1662def\n if ST_text == 'EN1665':\n table = en1665def\n if ST_text == 'ISO2009':\n table = iso2009def\n if ST_text == 'ISO2010':\n table = iso2009def\n if ST_text == 'ISO4762':\n table = iso4762def\n if ST_text == 'ISO10642':\n table = iso10642def\n if ST_text == 'ISO1207':\n table = iso1207def\n if ST_text == 'ISO1580':\n table = iso1580def\n if ST_text == 'ISO7045':\n table = iso7045def\n if ST_text == 'ISO7046':\n table = iso7045def\n if ST_text == 'ISO7047':\n table = iso7045def\n if ST_text == 'ISO7048':\n table = iso7048def\n if ST_text == 'ISO7380-1':\n table = iso7380def\n if ST_text == 'ISO7380-2':\n table = iso7380_2def\n if ST_text == 'DIN967':\n table = din967def\n if ST_text == 'ISO14579':\n table = iso14579def\n if ST_text == 'ISO14580':\n table = iso14580def\n if ST_text == 'ISO14582':\n table = iso14582def\n if ST_text == 'ISO14583':\n table = iso14583def\n if ST_text == 'ISO14584':\n table = iso14584def\n if ST_text == 'ISO7089':\n table = iso7089def\n if ST_text == 'ISO7090':\n table = iso7090def\n if ST_text == 'ISO7091':\n table = iso7091def\n if ST_text == 'ISO7092':\n table = iso7092def\n if ST_text == 'ISO7093-1':\n table = iso7093def\n if ST_text == 'ISO7094':\n table = iso7094def\n if ST_text == 'ISO4032':\n table = iso4032def\n if ST_text == 'ISO4033':\n table = iso4033def\n if ST_text == 'ISO4035':\n table = iso4035def\n if ST_text == 'ISO4036':\n table = iso4036def\n if ST_text == 'EN1661':\n table = en1661def\n if ST_text == 'ScrewTap':\n table = tuningTable\n if ND_text not in table:\n FreeCAD.Console.PrintMessage(\"Combination of type \"+ST_text \\\n + \" and diameter \" + ND_text +\" not available!\" + \"\\n\")\n #self.MessageLabel.setText(QtGui.QApplication.translate(\"ScrewMaker\", \"not implemented\", None, QtGui.QApplication.UnicodeUTF8))\n \n except ValueError:\n #print \"Error! nom_dia and length values must be valid numbers!\"\n FreeCAD.Console.PrintMessage(\"Error! nom_dia and length values must be valid numbers!\\n\")\n else:\n doc=FreeCAD.activeDocument()\n done = False\n if (ST_text == 'ISO4014') or (ST_text == 'ISO4017'):\n screw = self.makeIso4017_2(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'EN1662') or (ST_text == 'EN1665'):\n screw = self.makeEN1662_2(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'ISO2009') or (ST_text == 'ISO2010') or (ST_text == 'ISO1580'):\n screw = self.makeSlottedScrew(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'ISO4762') or (ST_text == 'ISO14579'):\n screw = self.makeIso4762(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'ISO1207') or (ST_text == 'ISO14580') or (ST_text == 'ISO7048'):\n screw = self.makeIso1207(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'ISO7045') or (ST_text == 'ISO14583'):\n screw = self.makeIso7045(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'ISO7046') or (ST_text == 'ISO7047') or \\\n (ST_text == 'ISO14582') or (ST_text == 'ISO14584') or (ST_text == 'ISO10642'):\n screw = self.makeIso7046(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'ISO7380-1') or (ST_text == 'ISO7380-2') or (ST_text == 'DIN967'):\n screw = self.makeIso7380(ST_text, ND_text,l)\n Type_text = 'Screw'\n done = True\n if (ST_text == 'ISO7089') or (ST_text == 'ISO7090') or (ST_text == 'ISO7093-1') or \\\n (ST_text == 'ISO7091') or (ST_text == 'ISO7092') or (ST_text == 'ISO7094'):\n screw = self.makeIso7089(ST_text, ND_text)\n Type_text = 'Washer'\n done = True\n if (ST_text == 'ISO4032') or (ST_text == 'ISO4033') or (ST_text == 'ISO4035'):\n screw = self.makeIso4032(ST_text, ND_text)\n Type_text = 'Nut'\n done = True\n if ST_text == 'EN1661':\n screw = self.makeEN1661(ND_text)\n Type_text = 'Nut'\n done = True\n if ST_text == 'ScrewTap':\n screw = self.makeScrewTap(ND_text,l)\n Type_text = 'Screw-Tap'\n done = True\n if not done:\n FreeCAD.Console.PrintMessage(\"No valid Screw Type!\" + \"\\n\")\n if '(' in ND_text:\n ND_text = ND_text.lstrip('(').rstrip(')')\n \n if Type_text == 'Screw':\n label = ST_text + \"-\" + ND_text +\"x\"+ NL_text +\"_\"\n else:\n if (Type_text == 'Nut'):\n label = ST_text + '-' + ND_text +'_'\n else:\n if Type_text == 'Screw-Tap':\n label = ST_text + '-' + ND_text +'x'+ NL_text +'_'\n else: # washer\n label = ST_text + '-' + ND_text.lstrip('M') +'_'\n ScrewObj = doc.addObject(\"Part::Feature\")\n ScrewObj.Label=label\n ScrewObj.Shape=screw\n #FreeCAD.Console.PrintMessage(\"Placement: \"+ str(ScrewObj.Placement) +\"\\n\")\n #FreeCAD.Console.PrintMessage(\"The label: \"+ label +\"\\n\")\n self.moveScrew(ScrewObj)\n #ScrewObj.Label = label\n doc.recompute()\n # Part.show(screw)\n return ScrewObj\n \n def moveScrew(self, ScrewObj_m):\n #FreeCAD.Console.PrintMessage(\"In Move Screw: \" + str(ScrewObj_m) + \"\\n\")\n\n mylist = FreeCAD.Gui.Selection.getSelectionEx()\n if (mylist.__len__() == 1):\n # check selection\n #FreeCAD.Console.PrintMessage(\"Selektionen: \" + str(mylist.__len__()) + \"\\n\")\n Pnt1 = None\n Axis1 = None\n Axis2 = None\n \n for o in Gui.Selection.getSelectionEx():\n #for s in o.SubElementNames:\n #FreeCAD.Console.PrintMessage( \"name: \" + str(s) + \"\\n\")\n for s in o.SubObjects:\n #FreeCAD.Console.PrintMessage( \"object: \"+ str(s) + \"\\n\")\n if hasattr(s,\"Curve\"):\n #FreeCAD.Console.PrintMessage( \"The Object is a Curve!\\n\")\n if hasattr(s.Curve,\"Center\"):\n \"\"\"\n FreeCAD.Console.PrintMessage( \"The object has a Center!\\n\")\n FreeCAD.Console.PrintMessage( \"Curve attribut. \"+ str(s.__getattribute__('Curve')) + \"\\n\")\n FreeCAD.Console.PrintMessage( \"Center: \"+ str(s.Curve.Center) + \"\\n\")\n FreeCAD.Console.PrintMessage( \"Axis: \"+ str(s.Curve.Axis) + \"\\n\")\n \"\"\"\n Pnt1 = s.Curve.Center\n Axis1 = s.Curve.Axis\n if hasattr(s,'Surface'):\n #print 'the object is a face!'\n if hasattr(s.Surface,'Axis'):\n Axis1 = s.Surface.Axis\n \n if hasattr(s,'Point'):\n #FreeCAD.Console.PrintMessage( \"the object seems to be a vertex! \"+ str(s.Point) + \"\\n\")\n Pnt1 = s.Point\n \n if (Axis1 != None):\n #FreeCAD.Console.PrintMessage( \"Got Axis1: \" + str(Axis1) + \"\\n\")\n Axis2 = Base.Vector(0.0,0.0,1.0)\n Axis2_minus = Base.Vector(0.0,0.0,-1.0)\n \n # Calculate angle\n if Axis1 == Axis2:\n normvec = Base.Vector(1.0,0.0,0.0)\n result = 0.0\n else:\n if Axis1 == Axis2_minus:\n normvec = Base.Vector(1.0,0.0,0.0)\n result = math.pi\n else:\n normvec = Axis1.cross(Axis2) # Berechne Achse der Drehung = normvec\n normvec.normalize() # Normalisieren fuer Quaternionenrechnung\n #normvec_rot = normvec\n result = DraftVecUtils.angle(Axis1, Axis2, normvec) # Winkelberechnung\n sin_res = math.sin(result/2.0)\n cos_res = math.cos(result/2.0)\n normvec.multiply(-sin_res) # Berechnung der Quaternionen-Elemente\n #FreeCAD.Console.PrintMessage( \"Winkel = \"+ str(math.degrees(result)) + \"\\n\")\n #FreeCAD.Console.PrintMessage(\"Normalvektor: \"+ str(normvec) + \"\\n\")\n \n pl = FreeCAD.Placement()\n pl.Rotation = (normvec.x,normvec.y,normvec.z,cos_res) #Drehungs-Quaternion\n \n #FreeCAD.Console.PrintMessage(\"pl mit Rot: \"+ str(pl) + \"\\n\")\n #neuPlatz = Part2.Object.Placement.multiply(pl)\n neuPlatz = ScrewObj_m.Placement\n #FreeCAD.Console.PrintMessage(\"die Position \"+ str(neuPlatz) + \"\\n\")\n neuPlatz.Rotation = pl.Rotation.multiply(ScrewObj_m.Placement.Rotation)\n neuPlatz.move(Pnt1)\n #FreeCAD.Console.PrintMessage(\"die rot. Position: \"+ str(neuPlatz) + \"\\n\")\n\n\n # make Washer\n def makeIso7089(self,SType ='ISO7089', ThreadType ='M6'):\n dia = self.getDia(ThreadType)\n #FreeCAD.Console.PrintMessage(\"die Scheibe mit dia: \" + str(dia) + \"\\n\")\n if SType == 'ISO7089':\n d1_min, d2_max, h, h_max = iso7089def[ThreadType]\n if SType == 'ISO7090':\n d1_min, d2_max, h, h_max = iso7090def[ThreadType]\n if SType == 'ISO7091':\n d1_min, d2_max, h, h_max = iso7091def[ThreadType]\n if SType == 'ISO7092':\n d1_min, d2_max, h, h_max = iso7092def[ThreadType]\n if SType == 'ISO7093-1':\n d1_min, d2_max, h, h_max = iso7093def[ThreadType]\n if SType == 'ISO7094':\n d1_min, d2_max, h, h_max = iso7094def[ThreadType]\n #FreeCAD.Console.PrintMessage(\"got: \" + SType + \"\\n\")\n\n #FreeCAD.Console.PrintMessage(\"die Scheibe mit d1_min: \" + str(d1_min) + \"\\n\")\n\n #Washer Points \n Pnt0 = Base.Vector(d1_min/2.0,0.0,h_max)\n Pnt2 = Base.Vector(d2_max/2.0,0.0,h_max)\n Pnt3 = Base.Vector(d2_max/2.0,0.0,0.0) \n Pnt4 = Base.Vector(d1_min/2.0,0.0,0.0)\n if SType == 'ISO7090':\n Pnt1 = Base.Vector(d2_max/2.0-h_max/4.0,0.0,h_max)\n Pnt2 = Base.Vector(d2_max/2.0,0.0,h_max*0.75)\n edge1 = Part.makeLine(Pnt0,Pnt1)\n edgeCham = Part.makeLine(Pnt1,Pnt2)\n edge1 = Part.Wire([edge1, edgeCham])\n else:\n edge1 = Part.makeLine(Pnt0,Pnt2)edge2 = Part.makeLine(Pnt2,Pnt3)\n edge3 = Part.makeLine(Pnt3,Pnt4)\n edge4 = Part.makeLine(Pnt4,Pnt0)\n #FreeCAD.Console.PrintMessage(\"Edges made Pnt2: \" + str(Pnt2) + \"\\n\")\n\n aWire=Part.Wire([edge1,edge2,edge3,edge4])\n #Part.show(aWire)\n aFace =Part.Face(aWire)\n head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #FreeCAD.Console.PrintMessage(\"Washer revolved: \" + str(dia) + \"\\n\")\n\n return head\n\n\n # make ISO 2009 Slotted countersunk flat head screws\n # make ISO 2010 Slotted raised countersunk head screws\n # make ISO 1580 Pan head slotted screw (Code is nearly identical to iso1207)\n def makeSlottedScrew(self,SType ='ISO1580', ThreadType ='M6',l=25.0):\n dia = self.getDia(ThreadType)\n if SType == 'ISO1580':\n #FreeCAD.Console.PrintMessage(\"der Kopf mit l: \" + str(l) + \"\\n\")\n #P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x = iso1580def[ThreadType]\n P, a, b, dk_max, da, k, n_min, r, rf, t_min, x = iso1580def[ThreadType]\n #FreeCAD.Console.PrintMessage(\"der Kopf mit iso: \" + str(dk_max) + \"\\n\")\n ht = k\n headEnd = r\n \n #Length for calculation of head fillet\n sqrt2_ = 1.0/math.sqrt(2.0)\n r_fil = rf\n beta = math.radians(5.0) # angle of pan head edge\n alpha = math.radians(90.0 - (90.0+5.0)/2.0)\n tan_beta = math.tan(beta) \n # top head diameter without fillet\n rK_top = dk_max/2.0 - k * tan_beta \n fillet_center_x = rK_top - r_fil + r_fil * tan_beta \n fillet_center_z = k - r_fil\n fillet_arc_x = fillet_center_x + r_fil * math.sin(alpha)\n fillet_arc_z = fillet_center_z + r_fil * math.cos(alpha)\n #FreeCAD.Console.PrintMessage(\"rK_top: \" + str(rK_top) + \"\\n\")\n if (b > (l - 1.0*P)):\n bmax = l- 1.0*P\n else:\n bmax = b\n\n #Head Points \n Pnt0 = Base.Vector(0.0,0.0,k)\n Pnt2 = Base.Vector(fillet_center_x,0.0,k)\n Pnt3 = Base.Vector(fillet_arc_x,0.0,fillet_arc_z) \n Pnt4 = Base.Vector(fillet_center_x + r_fil*math.cos(beta),0.0,fillet_center_z+ r_fil * math.sin(beta))\n Pnt5 = Base.Vector(dk_max/2.0,0.0,0.0)\n Pnt6 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n Pnt7 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet\n #Pnt8 = Base.Vector(dia/2.0,0.0,-r) # end of fillet\n PntR = Base.Vector(dia/2.0,0.0,-r) # end of fillet\n PntT0 = Base.Vector(0.0,0.0,-r) # helper point for real thread\n \n edge1 = Part.makeLine(Pnt0,Pnt2)\n edge2 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape()\n edge3 = Part.makeLine(Pnt4,Pnt5)\n edge4 = Part.makeLine(Pnt5,Pnt6)\n edge5 = Part.Arc(Pnt6,Pnt7,PntR).toShape()\n headWire=Part.Wire([edge1,edge2,edge3,edge4,edge5])\n \n if (SType == 'ISO2009') or (SType == 'ISO2010'):\n P, a, b, dk_theo, dk_mean, k, n_min, r, t_mean, x = iso2009def[ThreadType]\n dk_max = dk_theo\n t_min = t_mean\n ht = 0.0 # Head heigth of flat head\n if (SType == 'ISO2010'):\n rf, t_mean, cT, mH, mZ = Raised_countersunk_def[ThreadType]\n #Lengths and angles for calculation of head rounding\n beta = math.asin(dk_mean /2.0 / rf) # angle of head edge\n tan_beta = math.tan(beta) \n alpha = beta/2.0 # half angle\n # heigth of raised head top\n ht = rf - (dk_mean/2.0) / tan_beta\n h_arc_x = rf * math.sin(alpha) \n h_arc_z = ht - rf + rf * math.cos(alpha)\n\n cham = (dk_theo - dk_mean)/2.0\n rad225 = math.radians(22.5)\n rad45 = math.radians(45.0)\n rtan = r*math.tan(rad225)\n headEnd = k + rtan\n\n if (b > l - k - rtan/2.0 - 1.0*P):\n bmax = l-k-rtan/2.0 - 1.0*P\n else:\n bmax = b\n \n #Head Points\n Pnt0 = Base.Vector(0.0,0.0,ht)\n Pnt1 = Base.Vector(dk_mean/2.0,0.0,0.0)\n Pnt2 = Base.Vector(dk_mean/2.0,0.0,-cham)\n Pnt3 = Base.Vector(dia/2.0+r-r*math.cos(rad45),0.0,-k-rtan+r*math.sin(rad45))\n # Arc-points\n Pnt4 = Base.Vector(dia/2.0+r-r*(math.cos(rad225)),0.0,-k-rtan+r*math.sin(rad225))\n PntR = Base.Vector(dia/2.0,0.0,-k-rtan)\n #PntA = Base.Vector(dia/2.0,0.0,-a_point)\n PntT0 = Base.Vector(0.0,0.0,-k-rtan) # helper point for real thread\n \n if (SType == 'ISO2010'): # make raised head rounding\n Pnt0arc = Base.Vector(h_arc_x,0.0,h_arc_z)\n edge1 = Part.Arc(Pnt0,Pnt0arc,Pnt1).toShape() \n else:\n edge1 = Part.makeLine(Pnt0,Pnt1) # make flat head\n \n edge2 = Part.makeLine(Pnt1,Pnt2)\n edge3 = Part.makeLine(Pnt2,Pnt3)\n edgeArc = Part.Arc(Pnt3,Pnt4,PntR).toShape() \n headWire=Part.Wire([edge1,edge2,edge3,edgeArc])\n\n\n ### make the new code with math.modf(l)\n residue, turns = math.modf((bmax)/P)\n halfturns = 2*int(turns)\n if residue < 0.5:\n a_point = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a_point = l - (turns+2.0) * P\n #halfturns = halfturns + 2\n offSet = headEnd - a_point\n PntA = Base.Vector(dia/2.0,0.0,-a_point) # Start of thread\n\n\n if self.rThread:\n edgeZ1 = Part.makeLine(PntR,PntT0)\n edgeZ0 = Part.makeLine(PntT0,Pnt0)\n aWire=Part.Wire([headWire, edgeZ1, edgeZ0])else:\n # bolt points\n PntB1 = Base.Vector(dia/2.0,0.0,-l)\n PntB2 = Base.Vector(0.0,0.0,-l)\n \n edgeB2 = Part.makeLine(PntB1,PntB2)\n edgeZ0 = Part.makeLine(PntB2,Pnt0)\n\n if a_point <= r:\n edgeB1 = Part.makeLine(PntR,PntB1)\n aWire=Part.Wire([headWire, edgeB1, edgeB2, edgeZ0])\n else:\n edgeRA = Part.makeLine(PntR,PntA)\n edgeB1 = Part.makeLine(PntA,PntB1)\n aWire=Part.Wire([headWire, edgeRA, edgeB1, edgeB2, edgeZ0])\n\n aFace =Part.Face(aWire)\n head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\")\n\n #Parameter for slot-recess: dk_max, n_min, k, t_min\n slot = Part.makePlane(dk_max, n_min, \\\n Base.Vector(dk_max/2.0,-n_min/2.0,ht+1.0),Base.Vector(0.0,0.0,-1.0))\n slot = slot.extrude(Base.Vector(0.0,0.0,-t_min-1.0))\n #Part.show(slot)\n head = head.cut(slot)\n #FreeCAD.Console.PrintMessage(\"der Kopf geschnitten: \" + str(dia) + \"\\n\")\n #Part.show(head)if self.rThread:\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n #Part.show(rthread)\n headFaces = []\n if (SType == 'ISO2009'):\n for i in range(0,len(head.Faces)-2):\n headFaces.append(head.Faces[i])\n headFaces.append(head.Faces[len(head.Faces)-1])\n \n if (SType == 'ISO1580') or (SType == 'ISO2010'):\n for i in range(0,len(head.Faces)-1):\n headFaces.append(head.Faces[i])\n\n for threadFace in rthread.Faces:\n headFaces.append(threadFace)\n\n newHeadShell = Part.Shell(headFaces)\n #Part.show(newHeadShell)\n head = Part.Solid(newHeadShell)\n\n return head\n\n\n # ISO 7045 Pan head screws with type H or type Z cross recess\n # ISO 14583 Hexalobular socket pan head screws \n def makeIso7045(self, SType ='ISO7045', ThreadType ='M6',l=25.0):\n dia = self.getDia(ThreadType)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit l: \" + str(l) + \"\\n\")\n P, a, b, dk_max,da, k, r, rf, x, cT, mH, mZ = iso7045def[ThreadType]\n #FreeCAD.Console.PrintMessage(\"der Kopf mit iso: \" + str(dk_max) + \"\\n\")\n\n #Lengths and angles for calculation of head rounding\n beta = math.asin(dk_max /2.0 / rf) # angle of head edge\n #print 'beta: ', math.degrees(beta)\n tan_beta = math.tan(beta) \n\n\n if SType == 'ISO14583':\n tt, A, t_mean = iso14583def[ThreadType]\n beta_A = math.asin(A/2.0 / rf) # angle of recess edge\n tan_beta_A = math.tan(beta_A)\n\n alpha = (beta_A + beta)/2.0 # half angle\n #print 'alpha: ', math.degrees(alpha)\n # heigth of head edge\n he = k - A/2.0/tan_beta_A + (dk_max/2.0) / tan_beta \n #print 'he: ', he\n h_arc_x = rf * math.sin(alpha) \n h_arc_z = k - A/2.0/tan_beta_A + rf * math.cos(alpha)\n #FreeCAD.Console.PrintMessage(\"h_arc_z: \" + str(h_arc_z) + \"\\n\")\n else:\n alpha = beta/2.0 # half angle\n #print 'alpha: ', math.degrees(alpha)\n # heigth of head edge\n he = k - rf + (dk_max/2.0) / tan_beta \n #print 'he: ', he\n h_arc_x = rf * math.sin(alpha) \n h_arc_z = k - rf + rf * math.cos(alpha)\n #FreeCAD.Console.PrintMessage(\"h_arc_z: \" + str(h_arc_z) + \"\\n\")if (b > (l - 1.0*P)):\n bmax = l- 1.0*P\n else:\n bmax = b\n\n ### make the new code with math.modf(l)\n residue, turns = math.modf((bmax)/P)\n halfturns = 2*int(turns)\n if residue < 0.5:\n a_point = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a_point = l - (turns+2.0) * P\n #halfturns = halfturns + 2\n offSet = r - a_point\n #FreeCAD.Console.PrintMessage(\"The transition at a: \" + str(a) + \" turns \" + str(turns) + \"\\n\")\n \n sqrt2_ = 1.0/math.sqrt(2.0)#Head Points \n Pnt1 = Base.Vector(h_arc_x,0.0,h_arc_z)\n Pnt2 = Base.Vector(dk_max/2.0,0.0,he) \n Pnt3 = Base.Vector(dk_max/2.0,0.0,0.0)\n Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n Pnt5 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet\n Pnt6 = Base.Vector(dia/2.0,0.0,-r) # end of fillet\n Pnt7 = Base.Vector(dia/2.0,0.0,-a_point) # Start of thread\n #FreeCAD.Console.PrintMessage(\"Points defined a_point: \" + str(a_point) + \"\\n\")\n\n\n if (SType == 'ISO14583'):\n #Pnt0 = Base.Vector(0.0,0.0,k-A/4.0)\n Pnt0 = Base.Vector(0.0,0.0,k-A/8.0)\n PntFlat = Base.Vector(A/8.0,0.0,k-A/8.0)\n PntCham = Base.Vector(A/1.99,0.0,k)\n edgeCham0 = Part.makeLine(Pnt0,PntFlat) \n edgeCham1 = Part.makeLine(PntFlat,PntCham) \n edgeCham2 = Part.Arc(PntCham,Pnt1,Pnt2).toShape() \n #edge1 = Part.Wire([edgeCham0,edgeCham1,edgeCham2]) \n edge1 = Part.Wire([edgeCham0,edgeCham1])\n edge2 = Part.makeLine(Pnt2,Pnt3)\n edge2 = Part.Wire([edgeCham2, edge2])\n # Part.show(edge2)\n \n # Here is the next approach to shorten the head building time\n # Make two helper points to create a cutting tool for the \n # recess and recess shell.\n PntH1 = Base.Vector(A/1.99,0.0, 2.0*k)\n PntH2 = Base.Vector(0.0,0.0, 2.0*k)\n edgeH1 = Part.makeLine(PntCham,PntH1)\n edgeH2 = Part.makeLine(PntH1,PntH2)\n edgeH3 = Part.makeLine(PntH2,Pnt0)\n \n else:\n Pnt0 = Base.Vector(0.0,0.0,k)\n edge1 = Part.Arc(Pnt0,Pnt1,Pnt2).toShape() # make round head\n edge2 = Part.makeLine(Pnt2,Pnt3)\n\n # Here is the next approach to shorten the head building time\n # Make two helper points to create a cutting tool for the \n # recess and recess shell.\n PntH1 = Base.Vector(dk_max/2.0,0.0, 2.0*k)\n PntH2 = Base.Vector(0.0,0.0, 2.0*k)\n edgeH1 = Part.makeLine(Pnt2,PntH1)\n edgeH2 = Part.makeLine(PntH1,PntH2)\n edgeH3 = Part.makeLine(PntH2,Pnt0)\n\n edge3 = Part.makeLine(Pnt3,Pnt4)\n edge4 = Part.Arc(Pnt4,Pnt5,Pnt6).toShape()\n #FreeCAD.Console.PrintMessage(\"Edges made h_arc_z: \" + str(h_arc_z) + \"\\n\")\n\n #if self.RealThread.isChecked():\n if self.rThread:\n aWire=Part.Wire([edge2,edge3,edge4])\n else:\n # bolt points\n PntB1 = Base.Vector(dia/2.0,0.0,-l)\n PntB2 = Base.Vector(0.0,0.0,-l)\n edgeB2 = Part.makeLine(PntB1,PntB2)\n if a_point <= r:\n edgeB1 = Part.makeLine(Pnt6,PntB1)\n aWire=Part.Wire([edge2, edge3, edge4, edgeB1, edgeB2])\n else:\n edge5 = Part.makeLine(Pnt6,Pnt7)\n edgeB1 = Part.makeLine(Pnt7,PntB1)\n aWire=Part.Wire([edge2, edge3, edge4, edge5, edgeB1, edgeB2])\n\nhWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell\n hFace = Part.Face(hWire)\n hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #head = Part.Solid(headShell)\n #Part.show(aWire)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\")\n headFaces = headShell.Faces\n \n if (SType == 'ISO14583'):\n recess, recessShell = self.makeIso10664_3(tt, t_mean, k)\n recessShell = recessShell.cut(hCut)\n topFace = hCut.Faces[1]\n topFace = topFace.cut(recess)\n #Part.show(topFace)\n #Part.show(recessShell)\n #Part.show(headShell)\n headFaces.append(topFace.Faces[0])\n #headFaces.append(hCut.Faces[2])\n \n else:\n #Lengths and angles for calculation of recess positioning\n beta_cr = math.asin(mH /2.0 / rf) # angle of recess edge\n tan_beta_cr = math.tan(beta_cr) \n # heigth of cross recess cutting\n hcr = k - rf + (mH/2.0) / tan_beta_cr\n #print 'hcr: ', hcr\n \n #Parameter for cross-recess type H: cT, mH\n recess, recessShell = self.makeCross_H3(cT, mH, hcr)\n recessShell = recessShell.cut(hCut)\n topFace = hCut.Faces[0]\n topFace = topFace.cut(recess)\n #Part.show(topFace)\n #Part.show(recessShell)\n #Part.show(headShell)\n headFaces.append(topFace.Faces[0])\n \n #Part.show(hCut)\n headFaces.extend(recessShell.Faces)\n \n\n #if self.RealThread.isChecked():\n if self.rThread:\n #head = self.cutIsoThread(head, dia, P, turns, l)\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n #head = head.fuse(rthread)\n #Part.show(rthread)\n for threadFace in rthread.Faces:\n headFaces.append(threadFace)\n\n newHeadShell = Part.Shell(headFaces)\n #Part.show(newHeadShell)\n head = Part.Solid(newHeadShell)\n\n return head\n\n\n # make Cheese head screw\n # ISO 1207 slotted screw\n # ISO 7048 cross recessed screw\n # ISO 14580 Hexalobular socket cheese head screws\n def makeIso1207(self,SType ='ISO1207', ThreadType ='M6',l=25.0):\n dia = self.getDia(ThreadType)\n '''\n if '(' in TreadType:\n threadString = ThreadType.lstrip('(M')\n dia = float(ThreadType.rstrip(')'))\n else:\n dia=float(ThreadType.lstrip('M'))\n '''\n #FreeCAD.Console.PrintMessage(\"der Kopf mit l: \" + str(l) + \"\\n\")\n if (SType == 'ISO1207') or (SType == 'ISO14580'):\n P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x = iso1207def[ThreadType]\n if SType == 'ISO7048':\n P, a, b, dk, dk_mean, da, k, r, x, cT, mH, mZ = iso7048def[ThreadType]\n if (SType == 'ISO14580'):\n tt, k, A, t_min = iso14580def[ThreadType]\n\n #FreeCAD.Console.PrintMessage(\"der Kopf mit iso: \" + str(dk) + \"\\n\")#Length for calculation of head fillet\n r_fil = r*2.0\n beta = math.radians(5.0) # angle of cheese head edge\n alpha = math.radians(90.0 - (90.0+5.0)/2.0)\n tan_beta = math.tan(beta) \n # top head diameter without fillet\n rK_top = dk/2.0 - k * tan_beta \n fillet_center_x = rK_top - r_fil + r_fil * tan_beta \n fillet_center_z = k - r_fil\n fillet_arc_x = fillet_center_x + r_fil * math.sin(alpha)\n fillet_arc_z = fillet_center_z + r_fil * math.cos(alpha)\n #FreeCAD.Console.PrintMessage(\"rK_top: \" + str(rK_top) + \"\\n\")\n\n if (b > (l - 1.0*P)):\n bmax = l- 1.0*P\n else:\n bmax = b\n\n ### make the new code with math.modf(l)\n residue, turns = math.modf((bmax)/P)\n halfturns = 2*int(turns)\n if residue < 0.5:\n a_point = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a_point = l - (turns+2.0) * P\n #halfturns = halfturns + 2\n offSet = r - a_point\n \n sqrt2_ = 1.0/math.sqrt(2.0)\n\n #Head Points \n Pnt2 = Base.Vector(fillet_center_x,0.0,k)\n Pnt3 = Base.Vector(fillet_arc_x,0.0,fillet_arc_z) \n Pnt4 = Base.Vector(fillet_center_x + r_fil*math.cos(beta),0.0,fillet_center_z+ r_fil * math.sin(beta))\n Pnt5 = Base.Vector(dk/2.0,0.0,0.0)\n Pnt6 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n Pnt7 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet\n Pnt8 = Base.Vector(dia/2.0,0.0,-r) # end of fillet\n Pnt9 = Base.Vector(dia/2.0,0.0,-a_point) # Start of thread\n #FreeCAD.Console.PrintMessage(\"Points defined fillet_center_x: \" + str(fillet_center_x) + \"\\n\")\n\n if (SType == 'ISO14580'):\n # Pnt0 = Base.Vector(0.0,0.0,k-A/4.0) #Center Point for countersunk\n Pnt0 = Base.Vector(0.0,0.0,k-A/8.0) #Center Point for flat countersunk\n PntFlat = Base.Vector(A/8.0,0.0,k-A/8.0) # End of flat part\n Pnt1 = Base.Vector(A/1.99,0.0,k) #countersunk edge at head\n edgeCham0 = Part.makeLine(Pnt0,PntFlat) \n edgeCham1 = Part.makeLine(PntFlat,Pnt1)\n edgeCham2 = Part.makeLine(Pnt1,Pnt2)\n edge1 = Part.Wire([edgeCham1,edgeCham2]) # make head with countersunk\n PntH1 = Base.Vector(A/1.99,0.0, 2.0*k)else:\n Pnt0 = Base.Vector(0.0,0.0,k)\n edge1 = Part.makeLine(Pnt0,Pnt2) # make flat head\n\n \n edge2 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape()\n edge3 = Part.makeLine(Pnt4,Pnt5)\n edge4 = Part.makeLine(Pnt5,Pnt6)\n edge5 = Part.Arc(Pnt6,Pnt7,Pnt8).toShape()\n #FreeCAD.Console.PrintMessage(\"Edges made fillet_center_z: \" + str(fillet_center_z) + \"\\n\")\n\n if SType == 'ISO1207':\n #Parameter for slot-recess: dk, n_min, k, t_min\n recess = Part.makePlane(dk, n_min, \\\n Base.Vector(dk/2.0,-n_min/2.0,k+1.0),Base.Vector(0.0,0.0,-1.0))\n recess = recess.extrude(Base.Vector(0.0,0.0,-t_min-1.0))\n\n if self.rThread:\n Pnt11 = Base.Vector(0.0,0.0,-r) # helper point for real thread\n edgeZ1 = Part.makeLine(Pnt8,Pnt11)\n edgeZ0 = Part.makeLine(Pnt11,Pnt0)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5, \\\n edgeZ1, edgeZ0])\n else:\n # bolt points\n PntB1 = Base.Vector(dia/2.0,0.0,-l)\n PntB2 = Base.Vector(0.0,0.0,-l)\n \n edgeB2 = Part.makeLine(PntB1,PntB2)\n \n if a_point <= r:\n edgeB1 = Part.makeLine(Pnt8,PntB1)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5, \\\n edgeB1, edgeB2])\n else:\n edge6 = Part.makeLine(Pnt8,Pnt9)\n edgeB1 = Part.makeLine(Pnt9,PntB1)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6, \\\n edgeB1, edgeB2])\n\n aFace =Part.Face(aWire)\n head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0)\n head = head.cut(recess)\n # FreeCAD.Console.PrintMessage(\"der Kopf geschnitten: \" + str(dia) + \"\\n\")\n #Part.show(head)\n if self.rThread:\n screwFaces = []\n for i in range(0, len(head.Faces)-1):\n screwFaces.append(head.Faces[i])\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n for threadFace in rthread.Faces:\n screwFaces.append(threadFace)\n \n screwShell = Part.Shell(screwFaces)\n head = Part.Solid(screwShell)\n\n\n else:\n if self.rThread:\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5 ])\n else:\n # bolt points\n PntB1 = Base.Vector(dia/2.0,0.0,-l)\n PntB2 = Base.Vector(0.0,0.0,-l)\n \n edgeB2 = Part.makeLine(PntB1,PntB2)\n \n if a_point <= r:\n edgeB1 = Part.makeLine(Pnt8,PntB1)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5, \\\n edgeB1, edgeB2])\n else:\n edge6 = Part.makeLine(Pnt8,Pnt9)\n edgeB1 = Part.makeLine(Pnt9,PntB1)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6, \\\n edgeB1, edgeB2])\n \n #aFace =Part.Face(aWire)\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\")\n \n if SType == 'ISO7048':\n # hCut should be just a cylinder\n hCut = Part.makeCylinder(fillet_center_x,k,Pnt0)\n recess, recessShell = self.makeCross_H3(cT, mH, k)\n recessShell = recessShell.cut(hCut)\n topFace = headShell.Faces[0].cut(recess)\n screwFaces = [topFace.Faces[0]]\n screwFaces.extend(recessShell.Faces)\n if (SType == 'ISO14580'):\n # Ring-cutter for recess shell\n PntH2 = Base.Vector(A/8.0,0.0, 2.0*k)\n edgeH1 = Part.makeLine(Pnt1,PntH1)\n edgeH2 = Part.makeLine(PntH1,PntH2)\n edgeH3 = Part.makeLine(PntH2,PntFlat)\n hWire = Part.Wire([edgeCham1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell\n hFace = Part.Face(hWire)\n hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n \n recess, recessShell = self.makeIso10664_3(tt, t_min, k)\n recessShell = recessShell.cut(hCut)\n topFace = headShell.Faces[0].cut(recess)\n screwFaces = [topFace.Faces[0]]\n screwFaces.extend(recessShell.Faces)\n \n for i in range(1, len(headShell.Faces)):\n screwFaces.append(headShell.Faces[i])\n \n if self.rThread:\n #head = self.cutIsoThread(head, dia, P, turns, l)\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n #head = head.fuse(rthread)\n #Part.show(rthread)\n for threadFace in rthread.Faces:\n screwFaces.append(threadFace)\n \n screwShell = Part.Shell(screwFaces)\n head = Part.Solid(screwShell)\n\n return head\n\n\n \n # make the ISO 4017 Hex-head-screw\n # make the ISO 4014 Hex-head-bolt\n def makeIso4017_2(self,SType ='ISO4017', ThreadType ='M6',l=40.0):\n dia = self.getDia(ThreadType)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit l: \" + str(l) + \"\\n\")\n if SType == 'ISO4017':\n P, c, dw, e,k,r,s = iso4017head[ThreadType]\n \n ### make the new code with math.modf(l)\n residue, turns = math.modf((l-1*P)/P)\n halfturns = 2*int(turns)\n\n if SType == 'ISO4014':\n P, b1, b2, b3, c, dw, e, k, r, s = iso4014head[ThreadType]\n if l<= 125.0:\n b = b1\n else:\n if l<= 200.0:\n b = b2\n else:\n b = b3\n \n ### make the new code with math.modf(l)\n residue, turns = math.modf((b)/P)\n halfturns = 2*int(turns)\n \n if residue < 0.5:\n a = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a = l - (turns+2.0) * P\n #halfturns = halfturns + 2\n offSet = r - asqrt2_ = 1.0/math.sqrt(2.0)\n cham = (e-s)*math.sin(math.radians(15)) # needed for chamfer at head top\n \n #Head Points Usage of k, s, cham, c, dw, dia, r, a\n #FreeCAD.Console.PrintMessage(\"der Kopf mit halfturns: \" + str(halfturns) + \"\\n\")\n Pnt0 = Base.Vector(0.0,0.0,k)\n Pnt2 = Base.Vector(s/2.0,0.0,k)\n Pnt3 = Base.Vector(s/math.sqrt(3.0),0.0,k-cham)\n Pnt4 = Base.Vector(s/math.sqrt(3.0),0.0,c)\n Pnt5 = Base.Vector(dw/2.0,0.0,c)\n Pnt6 = Base.Vector(dw/2.0,0.0,0.0)\n Pnt7 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n Pnt8 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet\n Pnt9 = Base.Vector(dia/2.0,0.0,-r) # end of fillet\n Pnt10 = Base.Vector(dia/2.0,0.0,-a) # Start of threadedge1 = Part.makeLine(Pnt0,Pnt2)\n edge2 = Part.makeLine(Pnt2,Pnt3)\n edge3 = Part.makeLine(Pnt3,Pnt4)\n edge4 = Part.makeLine(Pnt4,Pnt5)\n edge5 = Part.makeLine(Pnt5,Pnt6)\n edge6 = Part.makeLine(Pnt6,Pnt7)\n edge7 = Part.Arc(Pnt7,Pnt8,Pnt9).toShape()# create cutting tool for hexagon head \n # Parameters s, k, outer circle diameter = e/2.0+10.0 \n extrude = self.makeHextool(s, k, s*2.0)#if self.RealThread.isChecked():\n if self.rThread:\n Pnt11 = Base.Vector(0.0,0.0,-r) # helper point for real thread\n edgeZ1 = Part.makeLine(Pnt9,Pnt11)\n edgeZ0 = Part.makeLine(Pnt11,Pnt0)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7, \\\n edgeZ1, edgeZ0])\n\n aFace =Part.Face(aWire)\n head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\") # Part.show(extrude)\n head = head.cut(extrude) \n #FreeCAD.Console.PrintMessage(\"der Kopf geschnitten: \" + str(dia) + \"\\n\")\n #Part.show(head)\n \n headFaces = []\n for i in range(18):\n headFaces.append(head.Faces[i])\n\n if (dia < 3.0) or (dia > 5.0):\n rthread = self.makeShellthread(dia, P, halfturns, True, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a-2.0*P))\n #rthread.translate(Base.Vector(0.0, 0.0,-2.0*P))\n #Part.show(rthread)\n for tFace in rthread.Faces:\n headFaces.append(tFace)\n headShell = Part.Shell(headFaces)\n head = Part.Solid(headShell)\n else:\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a-2.0*P))\n #rthread.translate(Base.Vector(0.0, 0.0,-2.0*P))\n #Part.show(rthread)\n for tFace in rthread.Faces:\n headFaces.append(tFace)\n headShell = Part.Shell(headFaces)\n head = Part.Solid(headShell)\n cyl = self.cutChamfer(dia, P, l)\n #FreeCAD.Console.PrintMessage(\"vor Schnitt Ende: \" + str(dia) + \"\\n\")\n head = head.cut(cyl)\n\n else:\n # bolt points\n cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0\n \n PntB0 = Base.Vector(0.0,0.0,-a)\n PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_t)\n PntB2 = Base.Vector(dia/2.0-cham_t,0.0,-l)\n PntB3 = Base.Vector(0.0,0.0,-l)\n \n edgeB1 = Part.makeLine(Pnt10,PntB1)\n edgeB2 = Part.makeLine(PntB1,PntB2)\n edgeB3 = Part.makeLine(PntB2,PntB3)\n \n edgeZ0 = Part.makeLine(PntB3,Pnt0)\n if a <= r:\n edgeB1 = Part.makeLine(Pnt9,PntB1)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7, \\\n edgeB1, edgeB2, edgeB3, edgeZ0])\n \n else:\n edge8 = Part.makeLine(Pnt9,Pnt10)\n edgeB1 = Part.makeLine(Pnt10,PntB1)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8, \\\n edgeB1, edgeB2, edgeB3, edgeZ0])\n\n aFace =Part.Face(aWire)\n head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\") # Part.show(extrude)\n head = head.cut(extrude) \n #FreeCAD.Console.PrintMessage(\"der Kopf geschnitten: \" + str(dia) + \"\\n\")return head\n\n\n # EN 1662 Hex-head-bolt with flange - small series\n # EN 1665 Hexagon bolts with flange, heavy series\n def makeEN1662_2(self,SType ='EN1662', ThreadType ='M8',l=25.0):\n dia = self.getDia(ThreadType)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit l: \" + str(l) + \"\\n\")\n if SType == 'EN1662':\n P, b0, b1, b2, b3, c, dc, dw, e, k, kw,f, r1, s = en1662def[ThreadType]\n else:\n P, b0, b1, b2, b3, c, dc, dw, e, k, kw,f, r1, s = en1665def[ThreadType]\n if l< b0:\n b = l - 2*P\n else:\n if l<= 125.0:\n b = b1\n else:\n if l<= 200.0:\n b = b2\n else:\n b = b3#FreeCAD.Console.PrintMessage(\"der Kopf mit isoEN1662: \" + str(c) + \"\\n\")\n cham = s*(2.0/math.sqrt(3.0)-1.0)*math.sin(math.radians(25)) # needed for chamfer at head top\n\n ### make the new code with math.modf(l)\n residue, turns = math.modf((b)/P)\n halfturns = 2*int(turns)\n if residue < 0.5:\n a_point = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a_point = l - (turns+2.0) * P\n #halfturns = halfturns + 2\n offSet = r1 - a_point\n\n sqrt2_ = 1.0/math.sqrt(2.0)\n \n # Flange is made with a radius of c\n beta = math.radians(25.0)\n tan_beta = math.tan(beta)# Calculation of Arc points of flange edge using dc and c\n arc1_x = dc/2.0 - c/2.0 + (c/2.0)*math.sin(beta)\n arc1_z = c/2.0 + (c/2.0)*math.cos(beta)hF = arc1_z + (arc1_x -s/2.0) * tan_beta # height of flange at centerkmean = arc1_z + (arc1_x - s/math.sqrt(3.0)) * tan_beta + kw * 1.1 + cham\n #kmean = k * 0.95\n \n\n #Hex-Head Points\n #FreeCAD.Console.PrintMessage(\"der Kopf mit math a: \" + str(a_point) + \"\\n\")\n PntH0 = Base.Vector(0.0,0.0,kmean*0.9)\n PntH1 = Base.Vector(s/2.0*0.8 - r1/2.0,0.0,kmean*0.9)\n PntH1a = Base.Vector(s/2.0*0.8-r1/2.0+r1/2.0*sqrt2_,0.0,kmean*0.9 +r1/2.0 -r1/2.0*sqrt2_)\n PntH1b = Base.Vector(s/2.0*0.8,0.0,kmean*0.9 +r1/2.0)\n PntH2 = Base.Vector(s/2.0*0.8,0.0,kmean -r1)\n PntH2a = Base.Vector(s/2.0*0.8+r1-r1*sqrt2_,0.0,kmean -r1 +r1*sqrt2_)\n PntH2b = Base.Vector(s/2.0*0.8 + r1 ,0.0,kmean)\n PntH3 = Base.Vector(s/2.0,0.0,kmean)\n #PntH4 = Base.Vector(s/math.sqrt(3.0),0.0,kmean-cham) #s/math.sqrt(3.0)\n #PntH5 = Base.Vector(s/math.sqrt(3.0),0.0,c)\n #PntH6 = Base.Vector(0.0,0.0,c)edgeH1 = Part.makeLine(PntH0,PntH1)\n edgeH2 = Part.Arc(PntH1,PntH1a,PntH1b).toShape()\n edgeH3 = Part.makeLine(PntH1b,PntH2)\n edgeH3a = Part.Arc(PntH2,PntH2a,PntH2b).toShape() \n edgeH3b = Part.makeLine(PntH2b,PntH3)\n\n hWire=Part.Wire([edgeH1,edgeH2,edgeH3,edgeH3a,edgeH3b])\n topShell = hWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n #Part.show(topShell)# create a cutter ring to generate the chamfer at the top of the hex\n chamHori = s/math.sqrt(3.0) - s/2.0\n PntC1 = Base.Vector(s/2.0-chamHori,0.0,kmean+kmean)\n PntC2 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,kmean+kmean)\n PntC3 = Base.Vector(s/2.0-chamHori,0.0,kmean+cham)\n PntC4 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,kmean-cham-cham) #s/math.sqrt(3.0)\n edgeC1 = Part.makeLine(PntC3, PntC1)\n edgeC2 = Part.makeLine(PntC1, PntC2)\n edgeC3 = Part.makeLine(PntC2, PntC4)\n edgeC4 = Part.makeLine(PntC4, PntC3)\n cWire = Part.Wire([edgeC4, edgeC1, edgeC2, edgeC3])\n cFace = Part.Face(cWire)\n chamCut = cFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(cWire)\n #Part.show(chamCut)\n\n\n # create hexagon\n mhex=Base.Matrix()\n mhex.rotateZ(math.radians(60.0))\n polygon = []\n vhex=Base.Vector(s/math.sqrt(3.0),0.0,kmean)\n for i in range(6):\n polygon.append(vhex)\n vhex = mhex.multiply(vhex)\n polygon.append(vhex)\n hexagon = Part.makePolygon(polygon)\n hexFace = Part.Face(hexagon)\n solidHex = hexFace.extrude(Base.Vector(0.0,0.0,c-kmean))\n #Part.show(solidHex)\n hexCham = solidHex.cut(chamCut)\n #Part.show(hexCham)topFaces = topShell.FacestopFaces.append(hexCham.Faces[6])\n topFaces.append(hexCham.Faces[12])\n topFaces.append(hexCham.Faces[14])\n topFaces.append(hexCham.Faces[13])\n topFaces.append(hexCham.Faces[8])\n topFaces.append(hexCham.Faces[2])\n topFaces.append(hexCham.Faces[1])hexFaces = [hexCham.Faces[5], hexCham.Faces[11], hexCham.Faces[10]]\n hexFaces.extend([hexCham.Faces[9], hexCham.Faces[3], hexCham.Faces[0]])\n hexShell = Part.Shell(hexFaces)\n\n # Center of flange:\n Pnt0 = Base.Vector(0.0,0.0,hF)\n Pnt1 = Base.Vector(s/2.0,0.0,hF)# arc edge of flange:\n Pnt2 = Base.Vector(arc1_x,0.0,arc1_z)\n Pnt3 = Base.Vector(dc/2.0,0.0,c/2.0)\n Pnt4 = Base.Vector((dc-c)/2.0,0.0,0.0)Pnt5 = Base.Vector(dia/2.0+r1,0.0,0.0) #start of fillet between head and shank\n Pnt6 = Base.Vector(dia/2.0+r1-r1*sqrt2_,0.0,-r1+r1*sqrt2_) #arc-point of fillet\n Pnt7 = Base.Vector(dia/2.0,0.0,-r1) # end of fillet\n Pnt8 = Base.Vector(dia/2.0,0.0,-a_point) # Start of threadedge1 = Part.makeLine(Pnt0,Pnt1)\n edge2 = Part.makeLine(Pnt1,Pnt2)\n edge3 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape()\n edge4 = Part.makeLine(Pnt4,Pnt5)\n edge5 = Part.Arc(Pnt5,Pnt6,Pnt7).toShape()\n\n # make a cutter for the hexShell\n PntHC1 = Base.Vector(0.0,0.0,arc1_z)\n PntHC2 = Base.Vector(0.0,0.0,0.0)edgeHC1 = Part.makeLine(Pnt2,PntHC1)\n edgeHC2 = Part.makeLine(PntHC1,PntHC2)\n edgeHC3 = Part.makeLine(PntHC2,Pnt0)\n\n HCWire = Part.Wire([edge2, edgeHC1, edgeHC2, edgeHC3, edge1])\n HCFace = Part.Face(HCWire)\n hex2Cut = HCFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)hexShell = hexShell.cut(hex2Cut)\n #Part.show(hexShell)topFaces.extend(hexShell.Faces)# bolt points\n cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0PntB0 = Base.Vector(0.0,0.0,-a_point)\n PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_t)\n PntB2 = Base.Vector(dia/2.0-cham_t,0.0,-l)\n PntB3 = Base.Vector(0.0,0.0,-l)edgeB2 = Part.makeLine(PntB1,PntB2)\n edgeB3 = Part.makeLine(PntB2,PntB3)#if self.RealThread.isChecked():\n if self.rThread:\n aWire=Part.Wire([edge2,edge3,edge4,edge5])\n boltIndex = 4else:\n if a_point <=r1:\n edgeB1 = Part.makeLine(Pnt7,PntB1)\n aWire=Part.Wire([edge2,edge3,edge4,edge5, edgeB1, edgeB2, edgeB3])\n boltIndex = 7\n else:\n edgeB1 = Part.makeLine(Pnt8,PntB1)\n edge6 = Part.makeLine(Pnt7,Pnt8)\n aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6, \\\n edgeB1, edgeB2, edgeB3])\n boltIndex = 8\n\n\n #aFace =Part.Face(aWire)\n #Part.show(aWire)\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\")\n #Part.show(headShell)\n chamFace = headShell.Faces[0].cut(solidHex)\n #Part.show(chamFace)topFaces.append(chamFace.Faces[0])\n for i in range(1,boltIndex):\n topFaces.append(headShell.Faces[i])\nif self.rThread:\n if (dia < 3.0) or (dia > 5.0):\n rthread = self.makeShellthread(dia, P, halfturns, True, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P))\n for tFace in rthread.Faces:\n topFaces.append(tFace)\n headShell = Part.Shell(topFaces)\n screw = Part.Solid(headShell)\n else:\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P))\n for tFace in rthread.Faces:\n topFaces.append(tFace)\n headShell = Part.Shell(topFaces)\n head = Part.Solid(headShell)\n cyl = self.cutChamfer(dia, P, l)\n #FreeCAD.Console.PrintMessage(\"vor Schnitt Ende: \" + str(dia) + \"\\n\")\n screw = head.cut(cyl)\n else:\n screwShell = Part.Shell(topFaces)\n screw = Part.Solid(screwShell)\n\n return screw\n\n\n # also used for ISO 7046 countersunk flat head screws with H cross recess\n # also used for ISO 7047 raised countersunk head screws with H cross recess\n # also used for ISO 10642 Hexagon socket countersunk head screws\n # also used for ISO 14582 Hexalobular socket countersunk head screws, high head\n # also used for ISO 14584 Hexalobular socket raised countersunk head screws\n def makeIso7046(self, SType ='ISO7046', ThreadType ='M6',l=25.0):\n dia = self.getDia(ThreadType)\n #FreeCAD.Console.PrintMessage(\"der 2009Kopf mit l: \" + str(l) + \"\\n\")\n if (SType == 'ISO10642'):\n P,b,dk_theo,dk_mean,da, ds_min, e, k, r, s_mean, t, w =iso10642def[ThreadType]\n ePrax = s_mean / math.sqrt(3.0) / 0.99\n ht = 0.0\n a = 2*P\n t_mean = t\n else: #still need the data from iso2009def, but this screw can not created here\n P, a, b, dk_theo, dk_mean, k, n_min, r, t_mean, x = iso2009def[ThreadType]\n ht = 0.0 # Head heigth of flat head\n if SType == 'ISO7046':\n cT, mH, mZ = iso7046def[ThreadType]\n if (SType == 'ISO7047'):\n rf, t_mean, cT, mH, mZ = Raised_countersunk_def[ThreadType]\n #Lengths and angles for calculation of head rounding\n beta = math.asin(dk_mean /2.0 / rf) # angle of head edge\n tan_beta = math.tan(beta) \n alpha = beta/2.0 # half angle\n # heigth of raised head top\n ht = rf - (dk_mean/2.0) / tan_beta\n #print 'he: ', he\n h_arc_x = rf * math.sin(alpha) \n h_arc_z = ht - rf + rf * math.cos(alpha)\n #FreeCAD.Console.PrintMessage(\"h_arc_z: \" + str(h_arc_z) + \"\\n\")\n\n if (SType == 'ISO14582'):\n P, a, b, dk_theo, dk_mean, k, r, tt, A, t_mean = iso14582def[ThreadType]\n ePrax = A / 2.0 / 0.99\n\n if (SType == 'ISO14584'):\n P, b, dk_theo, dk_mean, f, k, r, rf, x, tt, A, t_mean = iso14584def[ThreadType]\n ePrax = A / 2.0 / 0.99\n #Lengths and angles for calculation of head rounding\n beta = math.asin(dk_mean /2.0 / rf) # angle of head edge\n tan_beta = math.tan(beta) \n ctp = - (dk_mean/2.0) / tan_beta # Center Top Edge = center for rf\n betaA = math.asin(ePrax / rf) # angle of head edge at start of recess\n ht = ctp + ePrax / math.tan(betaA)\n alpha = betaA + (beta - betaA)/2.0 # half angle of top Arc\n h_arc_x = rf * math.sin(alpha) \n h_arc_z = ctp + rf * math.cos(alpha)\n \n \n #FreeCAD.Console.PrintMessage(\"der Kopf mit iso r: \" + str(r) + \"\\n\")\n cham = (dk_theo - dk_mean)/2.0\n rad225 = math.radians(22.5)\n rad45 = math.radians(45.0)\n rtan = r*math.tan(rad225)\n #FreeCAD.Console.PrintMessage(\"Checking rtan: \" + str(rtan) + \"\\n\")if (b > (l - k - rtan/2.0 - 1.0*P)):\n bmax = l - k - rtan/2.0 - 1.0*P\n else:\n bmax = b\n\n ### make the new code with math.modf(l)\n residue, turns = math.modf((bmax)/P)\n halfturns = 2*int(turns)\n if residue < 0.5:\n a_point = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a_point = l - (turns+2.0) * P\n #halfturns = halfturns + 2\n offSet = k + rtan - a_point\n \n #Head Points\n Pnt1 = Base.Vector(dk_mean/2.0,0.0,0.0)\n Pnt2 = Base.Vector(dk_mean/2.0,0.0,-cham)\n Pnt3 = Base.Vector(dia/2.0+r-r*math.cos(rad45),0.0,-k-rtan+r*math.sin(rad45))# Arc-points\n Pnt4 = Base.Vector(dia/2.0+r-r*(math.cos(rad225)),0.0,-k-rtan+r*math.sin(rad225))\n Pnt5 = Base.Vector(dia/2.0,0.0,-k-rtan)\n Pnt6 = Base.Vector(dia/2.0,0.0,-a_point)\n\n if (SType == 'ISO10642') or (SType == 'ISO14582'):\n if (SType == 'ISO10642'):\n recess, recessShell = self.makeAllen2(s_mean, t_mean, 0.0 )\n Pnt0 = Base.Vector(ePrax/2.0,0.0,-ePrax/2.0)\n PntCham = Base.Vector(ePrax,0.0,0.0)\n edge1 = Part.makeLine(Pnt0,PntCham) \n edgeCham2 = Part.makeLine(PntCham,Pnt1) \n edge2 = Part.makeLine(Pnt1,Pnt2)\n edge2 = Part.Wire([edgeCham2,edge2])\n PntH0 = Base.Vector(ePrax/2.0,0.0, ht + k)\n PntH1 = Base.Vector(ePrax,0.0, ht + k)\n if (SType == 'ISO14582'):\n recess, recessShell = self.makeIso10664_3(tt, t_mean, 0.0) # hexalobular recess\n Pnt0 = Base.Vector(0.0,0.0,0.0)\n edge1 = Part.makeLine(Pnt0,Pnt1) \n edge2 = Part.makeLine(Pnt1,Pnt2)\n\n\n # bolt points with bolt chamfer\n cham_b = P*math.sqrt(3.0)/2.0*17.0/24.0\n \n PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_b)\n PntB2 = Base.Vector(dia/2.0-cham_b,0.0,-l)\n PntB3 = Base.Vector(0.0,0.0,-l)\n if a_point <= (k + rtan):\n edgeB0 = Part.makeLine(Pnt5,PntB1)\n else:\n edgeB0 = Part.makeLine(Pnt6,PntB1)\n edgeB2 = Part.makeLine(PntB1,PntB2)\n edgeB3 = Part.makeLine(PntB2,PntB3)\n edgeB1 = Part.Wire([edgeB2,edgeB3])\n\n else:\n # bolt points\n PntB1 = Base.Vector(dia/2.0,0.0,-l)\n PntB2 = Base.Vector(0.0,0.0,-l)\n if a_point <= (k + rtan):\n edgeB0 = Part.makeLine(Pnt5,PntB1)\n else:\n edgeB0 = Part.makeLine(Pnt6,PntB1)\n edgeB1 = Part.makeLine(PntB1,PntB2)\n\n if (SType == 'ISO7047'): # make raised head rounding\n Pnt0 = Base.Vector(0.0,0.0,ht)\n Pnt0arc = Base.Vector(h_arc_x,0.0,h_arc_z)\n edge1 = Part.Arc(Pnt0,Pnt0arc,Pnt1).toShape() \n edge2 = Part.makeLine(Pnt1,Pnt2)\n PntH0 = Base.Vector(0.0,0.0, ht + k)\n PntH1 = Base.Vector(dk_mean/2.0,0.0, ht + k)\n recess, recessShell = self.makeCross_H3(cT, mH, ht)\n if (SType == 'ISO7046'):\n # ISO7046\n Pnt0 = Base.Vector(0.0,0.0,ht)\n edge1 = Part.makeLine(Pnt0,Pnt1) # make flat head\n edge2 = Part.makeLine(Pnt1,Pnt2)\n recess, recessShell = self.makeCross_H3(cT, mH, ht)\n\n if (SType == 'ISO14584'): # make raised head rounding with chamfer\n Pnt0 = Base.Vector(ePrax/2.0,0.0,ht-ePrax/4.0)\n PntCham = Base.Vector(ePrax,0.0,ht)\n PntArc = Base.Vector(h_arc_x,0.0,h_arc_z)\n edge1 = Part.makeLine(Pnt0,PntCham) \n edgeArc = Part.Arc(PntCham,PntArc,Pnt1).toShape() \n edge2 = Part.makeLine(Pnt1,Pnt2)\n edge2 = Part.Wire([edgeArc,edge2])\n PntH0 = Base.Vector(ePrax/2.0,0.0, ht + k)\n PntH1 = Base.Vector(ePrax,0.0, ht + k)\n recess, recessShell = self.makeIso10664_3(tt, t_mean, ht) # hexalobular recess\n \n edge3 = Part.makeLine(Pnt2,Pnt3)\n edgeArc = Part.Arc(Pnt3,Pnt4,Pnt5).toShape() \n edgeArc1 = Part.makeLine(Pnt3,Pnt4) \n edgeArc2 = Part.makeLine(Pnt4,Pnt5)\n edge6 = Part.makeLine(Pnt5,Pnt6)if self.rThread:\n #aWire=Part.Wire([edge1,edge2,edge3,edgeArc])\n aWire=Part.Wire([edge2,edge3,edgeArc])\n else:\n if a_point <= (k + rtan):\n aWire=Part.Wire([edge2,edge3,edgeArc, edgeB0, edgeB1])\n else:\n aWire=Part.Wire([edge2,edge3,edgeArc,edge6, edgeB0, edgeB1])\n\n #Part.show(aWire)\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n headFaces = headShell.Faces\n #Part.show(headShell)\n\n if (SType == 'ISO7046') or (SType == 'ISO14582'):\n # hCut is just a cylinder for ISO7046\n hCut = Part.makeCylinder(dk_mean/2.0,k,Pnt0)\n #Part.show(hCut)\n topFace = hCut.Faces[2]\n else:\n edgeH1 = Part.makeLine(Pnt1,PntH1)\n edgeH2 = Part.makeLine(PntH1,PntH0)\n edgeH3 = Part.makeLine(PntH0,Pnt0)\n hWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell\n hFace = Part.Face(hWire)\n hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n topFace = hCut.Faces[0]\n\n recessShell = recessShell.cut(hCut)\n topFace = topFace.cut(recess)\n #Part.show(topFace)\n #Part.show(recessShell)\n #Part.show(headShell)\n headFaces.append(topFace.Faces[0])\n headFaces.extend(recessShell.Faces)\n \n\n if (SType == 'ISO10642') or (SType == 'ISO14582'):\n if self.rThread:\n if (dia < 3.0) or (dia > 5.0):\n #if True:\n rthread = self.makeShellthread(dia, P, halfturns, True, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n #head = head.fuse(rthread)\n #Part.show(rthread)\n for threadFace in rthread.Faces:\n headFaces.append(threadFace)\n\n screwShell = Part.Shell(headFaces)\n screw = Part.Solid(screwShell)\n else:\n '''\n # head = self.cutIsoThread(head, dia, P, turns, l)\n rthread = self.makeShellthread(dia, P, halfturns, False)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P))\n head = head.fuse(rthread)\n head = head.removeSplitter()\n cyl = self.cutChamfer(dia, P, l)\n #FreeCAD.Console.PrintMessage(\"vor Schnitt Ende: \" + str(dia) + \"\\n\")\n head = head.cut(cyl)\n '''\n \n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n #head = head.fuse(rthread)\n Part.show(rthread)\n for threadFace in rthread.Faces:\n headFaces.append(threadFace)\n\n screwShell = Part.Shell(headFaces)\n screw = Part.Solid(screwShell)\n cyl = self.cutChamfer(dia, P, l)\n screw = screw.cut(cyl)\n else:\n screwShell = Part.Shell(headFaces)\n screw = Part.Solid(screwShell)\n\n else:\n if self.rThread:\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n #head = head.fuse(rthread)\n #Part.show(rthread)\n for threadFace in rthread.Faces:\n headFaces.append(threadFace)\n\n screwShell = Part.Shell(headFaces)\n screw = Part.Solid(screwShell)\n\nreturn screw\n\n\n # make ISO 4762 Allan Screw head\n # ISO 14579 Hexalobular socket head cap screws\n def makeIso4762(self, SType ='ISO4762', ThreadType ='M6',l=25.0):\n dia = self.getDia(ThreadType)\n #FreeCAD.Console.PrintMessage(\"der 4762Kopf mit l: \" + str(l) + \"\\n\")\n P, b, dk_max, da, ds_mean, e, lf, k, r, s_mean, t, v, dw, w = iso4762def[ThreadType]\n #FreeCAD.Console.PrintMessage(\"der Kopf mit iso r: \" + str(r) + \"\\n\")\n if SType == 'ISO14579':\n tt, A, t = iso14579def[ThreadType]\n #Head Points 30° countersunk\n # Pnt0 = Base.Vector(0.0,0.0,k-A/4.0) #Center Point for countersunk\n Pnt0 = Base.Vector(0.0,0.0,k-A/8.0) #Center Point for flat countersunk\n PntFlat = Base.Vector(A/8.0,0.0,k-A/8.0) # End of flat part\n Pnt1 = Base.Vector(A/1.99,0.0,k) #countersunk edge at head\n edgeCham0 = Part.makeLine(Pnt0,PntFlat) \n edgeCham1 = Part.makeLine(PntFlat,Pnt1) \n edge1 = Part.Wire([edgeCham0,edgeCham1])\n \n # Here is the next approach to shorten the head building time\n # Make two helper points to create a cutting tool for the \n # recess and recess shell.\n PntH1 = Base.Vector(A/1.99,0.0, 2.0*k)\n\n else:\n e_cham = 2.0 * s_mean / math.sqrt(3.0)\n #Head Points 45° countersunk\n Pnt0 = Base.Vector(0.0,0.0,k-e_cham/1.99/2.0) #Center Point for countersunk\n PntFlat = Base.Vector(e_cham/1.99/2.0,0.0,k-e_cham/1.99/2.0) # End of flat part\n Pnt1 = Base.Vector(e_cham/1.99,0.0,k) #countersunk edge at head\n edgeCham0 = Part.makeLine(Pnt0,PntFlat) \n edgeCham1 = Part.makeLine(PntFlat,Pnt1) \n edge1 = Part.Wire([edgeCham0,edgeCham1])\n PntH1 = Base.Vector(e_cham/1.99,0.0, 2.0*k)\n PntH2 = Base.Vector(0.0,0.0, 2.0*k)\n edgeH1 = Part.makeLine(Pnt1,PntH1)\n edgeH2 = Part.makeLine(PntH1,PntH2)\n edgeH3 = Part.makeLine(PntH2,Pnt0)\n hWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell\n hFace = Part.Face(hWire)\n hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n '''\n\n\n PntH2 = Base.Vector(A/8.0,0.0, 2.0*k)\n edgeH1 = Part.makeLine(Pnt1,PntH1)\n edgeH2 = Part.makeLine(PntH1,PntH2)\n edgeH3 = Part.makeLine(PntH2,PntFlat)\n hWire = Part.Wire([edgeCham1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell\n hFace = Part.Face(hWire)\n hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n '''\n\n\n sqrt2_ = 1.0/math.sqrt(2.0)\n #depth = s_mean / 3.0\n\n '''\n if (b > l - 2*P):\n bmax = l-2*P\n else:\n bmax = b\n halfturns = round(2.0*(bmax+P)/P) # number of thread turns\n if self.RealThread.isChecked():\n a_real = l-(halfturns+2)*P/2.0 # point to fuse real thread\n else:\n a_real = l-halfturns*P/2.0 # starting point of thread\n if a_real < r:\n a_point = r*1.3\n else:\n a_point = a_real\n '''\n\n\n if (b > (l - 1.0*P)):\n bmax = l- 1.0*P\n else:\n bmax = b\n\n ### make the new code with math.modf(l)\n residue, turns = math.modf((bmax)/P)\n halfturns = 2*int(turns)\n if residue < 0.5:\n a_point = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a_point = l - (turns+2.0) * P\n #halfturns = halfturns + 2\n offSet = r - a_point\n #FreeCAD.Console.PrintMessage(\"The transition at a: \" + str(a) + \" turns \" + str(turns) + \"\\n\")\n\n\n \n #rad30 = math.radians(30.0)\n #Head Points\n Pnt2 = Base.Vector(dk_max/2.0-v,0.0,k) #start of fillet\n Pnt3 = Base.Vector(dk_max/2.0-v+v*sqrt2_,0.0,k-v+v*sqrt2_) #arc-point of fillet\n Pnt4 = Base.Vector(dk_max/2.0,0.0,k-v) #end of fillet\n Pnt5 = Base.Vector(dk_max/2.0,0.0,(dk_max-dw)/2.0) #we have a chamfer here\n Pnt6 = Base.Vector(dw/2.0,0.0,0.0) #end of chamfer\n Pnt7 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n Pnt8 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet\n Pnt9 = Base.Vector(dia/2.0,0.0,-r) # end of fillet\n Pnt10 = Base.Vector(dia/2.0,0.0,-a_point) # start of threadedge1 = Part.makeLine(Pnt0,Pnt1)\n edge2 = Part.makeLine(Pnt1,Pnt2)\n edge3 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape()\n edge4 = Part.makeLine(Pnt4,Pnt5)\n edge5 = Part.makeLine(Pnt5,Pnt6)\n edge6 = Part.makeLine(Pnt6,Pnt7)\n edge7 = Part.Arc(Pnt7,Pnt8,Pnt9).toShape()'''\n # bolt points\n PntB1 = Base.Vector(dia/2.0,0.0,-l-P) # Chamfer is made with a cut later\n PntB2 = Base.Vector(0.0,0.0,-l-P)\n #PntB3 = Base.Vector(0.0,0.0,-l)\n\n edgeB0 = Part.makeLine(Pnt10,PntB1)\n edgeB1 = Part.makeLine(PntB1,PntB2)\n #edgeB2 = Part.makeLine(PntB2,PntB3)\n edgeZ0 = Part.makeLine(PntB2,Pnt0)\n aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8, \\\n edgeB0, edgeB1, edgeZ0])\n '''\n\nif self.rThread:\n aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7])else:\n # bolt points\n cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0\n \n PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_t)\n PntB2 = Base.Vector(dia/2.0-cham_t,0.0,-l)\n PntB3 = Base.Vector(0.0,0.0,-l)\n \n #edgeB1 = Part.makeLine(Pnt10,PntB1)\n edgeB2 = Part.makeLine(PntB1,PntB2)\n edgeB3 = Part.makeLine(PntB2,PntB3)\n\n if a_point <= r:\n edgeB1 = Part.makeLine(Pnt9,PntB1)\n aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7, \\\n edgeB1, edgeB2, edgeB3])\n else:\n edge8 = Part.makeLine(Pnt9,Pnt10)\n edgeB1 = Part.makeLine(Pnt10,PntB1)\n aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7,edge8, \\\n edgeB1, edgeB2, edgeB3])\n #Part.show(aWire)\n\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #head = Part.Solid(headShell)\n #Part.show(aWire)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\")\n headFaces = headShell.Faces\nif SType == 'ISO14579':\n #recess = self.makeIso10664(tt, t, k) # hexalobular recess\n recess, recessShell = self.makeIso10664_3(tt, t, k) # hexalobular recess\n else:\n recess, recessShell = self.makeAllen2(s_mean, t, k )\n\n recessShell = recessShell.cut(hCut)\n topFace = hCut.Faces[1]\n #topFace = hCut.Faces[0]\n topFace = topFace.cut(recess)\n #Part.show(topFace)\n #Part.show(recessShell)\n #Part.show(headShell)\n headFaces.append(topFace.Faces[0])\n #headFaces.append(hCut.Faces[2])\n\n #allenscrew = head.cut(recess)\n #Part.show(hCut)\n headFaces.extend(recessShell.Faces)\n\n #if self.RealThread.isChecked():\n if self.rThread:\n #if (dia < 3.0) or (dia > 5.0):\n if True:\n # head = self.cutIsoThread(head, dia, P, turns, l)\n rthread = self.makeShellthread(dia, P, halfturns, True, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P))\n #Part.show(rthread)\n for tFace in rthread.Faces:\n headFaces.append(tFace)\n headShell = Part.Shell(headFaces)\n allenscrew = Part.Solid(headShell)\n\n else:\n # head = self.cutIsoThread(head, dia, P, turns, l)\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P))\n for tFace in rthread.Faces:\n headFaces.append(tFace)\n headShell = Part.Shell(headFaces)\n allenscrew = Part.Solid(headShell)\n cyl = self.cutChamfer(dia, P, l)\n # FreeCAD.Console.PrintMessage(\"vor Schnitt Ende: \" + str(dia) + \"\\n\")\n allenscrew = allenscrew.cut(cyl)\n else:\n headShell = Part.Shell(headFaces)\n allenscrew = Part.Solid(headShell)\n \n\n return allenscrew\n\n\n # make ISO 7380-1 Button head Screw \n # make ISO 7380-2 Button head Screw with collar \n # make DIN 967 cross recessed pan head Screw with collar \n def makeIso7380(self, SType ='ISO7380-1', ThreadType ='M6',l=25.0):\n dia = self.getDia(ThreadType)\n #todo: different radii for screws with thread to head or with shaft?\n sqrt2_ = 1.0/math.sqrt(2.0)if (SType =='DIN967'):\n P, b, c, da, dk, r, k, rf, x, cT, mH, mZ = din967def[ThreadType]\n \n rH = rf # radius of button arc\n alpha = math.acos((rf-k+c)/rf)\n\n #Head Points\n Pnt0 = Base.Vector(0.0,0.0,k) \n PntArc = Base.Vector(rf*math.sin(alpha/2.0),0.0,k-rf + rf*math.cos(alpha/2.0)) #arc-point of button\n Pnt1 = Base.Vector(rf*math.sin(alpha),0.0,c) #end of button arc\n PntC0 = Base.Vector((dk)/2.0,0.0,c) #collar points\n PntC2 = Base.Vector((dk)/2.0,0.0,0.0) #collar points\n Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n\n edge1 = Part.Arc(Pnt0,PntArc,Pnt1).toShape()\n edgeC0 = Part.makeLine(Pnt1,PntC0)\n edgeC1 = Part.makeLine(PntC0,PntC2)\n edge2 = Part.Wire([edgeC0, edgeC1])\n edge3 = Part.makeLine(PntC2,Pnt4)\n #Points for recessShell cutter\n PntH0 = Base.Vector(0.0,0.0,2.0*k) \n PntH1 = Base.Vector(rf*math.sin(alpha),0.0,2.0*k) \n recess, recessShell = self.makeCross_H3(cT, mH, k)\n \n else:\n if (SType =='ISO7380-1'):\n P, b, a, da, dk, dk_mean,s_mean, t_min, r, k, e, w = iso7380def[ThreadType]\n \n # Bottom of recess\n e_cham = 2.0 * s_mean / math.sqrt(3.0) / 0.99\n #depth = s_mean / 3.0\n \n ak = -(4*k**2 + e_cham**2 - dk**2)/(8*k) # helper value for button arc\n rH = math.sqrt((dk/2.0)**2 + ak**2) # radius of button arc\n alpha = (math.atan(2*(k + ak)/e_cham) + math.atan((2*ak)/dk))/2\n \n Pnt2 = Base.Vector(rH*math.cos(alpha),0.0,-ak + rH*math.sin(alpha)) #arc-point of button\n Pnt3 = Base.Vector(dk/2.0,0.0,0.0) #end of fillet\n Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n edge3 = Part.makeLine(Pnt3,Pnt4)\n \n if (SType =='ISO7380-2'):\n P, b, c, da, dk, dk_c,s_mean,t_min, r, k, e, w = iso7380_2def[ThreadType]\n \n # Bottom of recess\n e_cham = 2.0 * s_mean / math.sqrt(3.0) / 0.99\n #depth = s_mean / 3.0\n \n ak = -(4*(k-c)**2 + e_cham**2 - dk**2)/(8*(k-c)) # helper value for button arc\n rH = math.sqrt((dk/2.0)**2 + ak**2) # radius of button arc\n alpha = (math.atan(2*(k -c + ak)/e_cham) + math.atan((2*ak)/dk))/2\n \n Pnt2 = Base.Vector(rH*math.cos(alpha),0.0,c -ak + rH*math.sin(alpha)) #arc-point of button\n Pnt3 = Base.Vector(dk/2.0,0.0,c) #end of fillet\n Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank\n PntC0 = Base.Vector((dk_c-c)/2.0,0.0,c) #collar points\n PntC1 = Base.Vector(dk_c/2.0,0.0,c/2.0) #collar points\n PntC2 = Base.Vector((dk_c-c)/2.0,0.0,0.0) #collar points\n \n edgeC0 = Part.makeLine(Pnt3,PntC0)\n edgeC1 = Part.Arc(PntC0,PntC1,PntC2).toShape()\n edge3 = Part.makeLine(PntC2,Pnt4)\n edge3 = Part.Wire([edgeC0, edgeC1, edge3])\n \n #Head Points\n Pnt0 = Base.Vector(e_cham/4.0,0.0,k-e_cham/4.0) #Center Point for chamfer\n Pnt1 = Base.Vector(e_cham/2.0,0.0,k) #inner chamfer edge at head\n #Points for recessShell cutter\n PntH0 = Base.Vector(e_cham/4.0,0.0,2.0*k) \n PntH1 = Base.Vector(e_cham/2.0,0.0,2.0*k) \n \n edge1 = Part.makeLine(Pnt0,Pnt1)\n edge2 = Part.Arc(Pnt1,Pnt2,Pnt3).toShape()\n recess, recessShell = self.makeAllen2(s_mean, t_min, k)\n\n if (b > (l - 1.0*P)):\n bmax = l- 1.0*P\n else:\n bmax = b\n\n ### make the new code with math.modf(l)\n residue, turns = math.modf((bmax)/P)\n halfturns = 2*int(turns)\n if residue < 0.5:\n a_point = l - (turns+1.0) * P \n halfturns = halfturns +1\n else:\n halfturns = halfturns + 2\n a_point = l - (turns+2.0) * P\n offSet = r - a_point\n \n\n Pnt5 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet\n Pnt6 = Base.Vector(dia/2.0,0.0,-r) # end of fillet\n Pnt7 = Base.Vector(dia/2.0,0.0,-a_point) # start of thread\n\n edge4 = Part.Arc(Pnt4,Pnt5,Pnt6).toShape()\n edge5 = Part.makeLine(Pnt6,Pnt7)\n\n if (SType =='DIN967'):\n # bolt points\n PntB1 = Base.Vector(dia/2.0,0.0,-l)\n PntB2 = Base.Vector(0.0,0.0,-l)\n edgeB2 = Part.makeLine(PntB1,PntB2)\n else:\n # bolt points\n cham_b = P*math.sqrt(3.0)/2.0*17.0/24.0\n \n PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_b)\n PntB2 = Base.Vector(dia/2.0-cham_b,0.0,-l)\n PntB3 = Base.Vector(0.0,0.0,-l)\n \n edgeB2 = Part.makeLine(PntB1,PntB2)\n edgeB3 = Part.makeLine(PntB2,PntB3)\n edgeB2 = Part.Wire([edgeB2, edgeB3])\n\n if self.rThread:\n aWire=Part.Wire([edge2,edge3,edge4])\n else:\n if a_point <= r:\n edgeB1 = Part.makeLine(Pnt6,PntB1)\n aWire=Part.Wire([edge2,edge3,edge4, edgeB1, edgeB2])\n else:\n edge5 = Part.makeLine(Pnt6,Pnt7)\n edgeB1 = Part.makeLine(Pnt7,PntB1)\n aWire=Part.Wire([edge2,edge3,edge4,edge5, edgeB1, edgeB2])\n\n #Part.show(aWire)\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(headShell)\n headFaces = headShell.FacesedgeH1 = Part.makeLine(Pnt1,PntH1)\n edgeH2 = Part.makeLine(PntH1,PntH0)\n edgeH3 = Part.makeLine(PntH0,Pnt0)\n hWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell\n hFace = Part.Face(hWire)\n hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n topFace = hCut.Faces[0]\n\n recessShell = recessShell.cut(hCut)\n topFace = topFace.cut(recess)\n #Part.show(topFace)\n #Part.show(recessShell)\n #Part.show(headShell)\n headFaces.append(topFace.Faces[0])\n headFaces.extend(recessShell.Faces)\n\n\n if self.rThread:\n #if (dia < 3.0) or (dia > 5.0):\n if True:\n if (SType =='DIN967'):\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n else:\n rthread = self.makeShellthread(dia, P, halfturns, True, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n for threadFace in rthread.Faces:\n headFaces.append(threadFace)\n\n screwShell = Part.Shell(headFaces)\n screw = Part.Solid(screwShell)\n else:\n rthread = self.makeShellthread(dia, P, halfturns, False, offSet)\n rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P))\n for threadFace in rthread.Faces:\n headFaces.append(threadFace)\n\n screwShell = Part.Shell(headFaces)\n screw = Part.Solid(screwShell)\n cyl = self.cutChamfer(dia, P, l)\n screw = screw.cut(cyl)\n else:\n screwShell = Part.Shell(headFaces)\n screw = Part.Solid(screwShell)\n \n return screw\n\n\n def makeHextool(self,s_hex, k_hex, cir_hex):\n # makes a cylinder with an inner hex hole, used as cutting tool\n # create hexagon\n mhex=Base.Matrix()\n mhex.rotateZ(math.radians(60.0))\n polygon = []\n vhex=Base.Vector(s_hex/math.sqrt(3.0),0.0,-k_hex*0.1)\n for i in range(6):\n polygon.append(vhex)\n vhex = mhex.multiply(vhex)\n polygon.append(vhex)\n hexagon = Part.makePolygon(polygon)\n # create circle\n circ=Part.makeCircle(cir_hex/2.0,Base.Vector(0.0,0.0,-k_hex*0.1))\n # Create the face with the circle as outline and the hexagon as hole\n face=Part.Face([Part.Wire(circ),hexagon])# Extrude in z to create the final cutting tool\n exHex=face.extrude(Base.Vector(0.0,0.0,k_hex*1.2))\n # Part.show(exHex)\n return exHex\n\n\n def makeShellthread(self, d, P, halfrots, withcham, offSet):\n d = float(d)#rotations = int(rots)-1\n halfrots_int = int(halfrots)\n rotations = (halfrots_int / 2)-1\n if halfrots_int % 2 == 1:\n #FreeCAD.Console.PrintMessage(\"got half turn: \" + str(halfrots_int) + \"\\n\")\n halfturn = True\n # bot_off = - P/2.0 # transition of half a turn\n bot_off = 0.0 # nominal length\n else:\n halfturn = False\n bot_off = 0.0 # nominal length\n\n H=P*math.cos(math.radians(30)) # Gewindetiefe H\n r=d/2.0# helix = Part.makeHelix(P,P,d*511/1000.0,0) # make just one turn, length is identical to pitch\n helix = Part.makeHelix(P,P,d*self.Tuner/1000.0,0) # make just one turn, length is identical to pitch\n helix.translate(FreeCAD.Vector(0.0, 0.0,-P*9.0/16.0))\n \n extra_rad = P\n # points for screw profile\n ps0 = (r,0.0, 0.0)\n ps1 = (r-H*5.0/8.0,0.0, -P*5.0/16.0)\n ps2 = (r-H*17.0/24.0,0.0, -P*7.0/16.0) # Center of Arc\n ps3 = (r-H*5.0/8.0,0.0, -P*9.0/16.0 )\n ps4 = (r, 0.0, -P*14.0/16.0)\n ps5 = (r,0.0, -P)\n ps6 = (r+extra_rad,0.0, -P)\n ps7 = (r+extra_rad,0.0, 0.0) \n \n edge0 = Part.makeLine(ps0,ps1)\n edge1 = Part.Arc(FreeCAD.Vector(ps1),FreeCAD.Vector(ps2),FreeCAD.Vector(ps3)).toShape()\n edge2 = Part.makeLine(ps3,ps4)\n edge3 = Part.makeLine(ps4,ps5)\n edge4 = Part.makeLine(ps5,ps6)\n edge5 = Part.makeLine(ps6,ps7)\n edge6 = Part.makeLine(ps7,ps0)\n \n W0 = Part.Wire([edge0, edge1, edge2, edge3, edge4, edge5, edge6])makeSolid=True\n isFrenet=True\n pipe0 = Part.Wire(helix).makePipeShell([W0],makeSolid,isFrenet)\n # pipe1 = pipe0.copy()\n \n TheFaces = [] \n TheFaces.append(pipe0.Faces[0])\n #Part.show(pipe0.Faces[0])\n TheFaces.append(pipe0.Faces[1])\n #Part.show(pipe0.Faces[1])\n TheFaces.append(pipe0.Faces[2])\n #Part.show(pipe0.Faces[2])\n TheFaces.append(pipe0.Faces[3])\n #Part.show(pipe0.Faces[3])TheShell = Part.Shell(TheFaces)\n # print \"Shellpoints: \", len(TheShell.Vertexes)\ni = 1\n for i in range(rotations-2):\n TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P))\n \n for flaeche in TheShell.Faces:\n TheFaces.append(flaeche)#FreeCAD.Console.PrintMessage(\"Base-Shell: \" + str(i) + \"\\n\")\n # Make separate faces for the tip of the screw\n botFaces = []\n for i in range(rotations-2, rotations, 1):\n TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P))\n \n for flaeche in TheShell.Faces:\n botFaces.append(flaeche)\n #FreeCAD.Console.PrintMessage(\"Bottom-Shell: \" + str(i) + \"\\n\")\n \n # making additional faces for transition to cylinder\n \n pc1 = (r + H/16.0,0.0,P*1/32.0)\n pc2 = (r-H*5.0/8.0,0.0,-P*5.0/16.0 )\n pc3 = (r-H*17.0/24.0,0.0, -P*7.0/16.0 ) # Center of Arc\n pc4 = (r-H*5.0/8.0,0.0, -P*9.0/16.0 )\n pc5 = (r+ H/16.0, 0.0, -P*29.0/32.0 ) \n \n edgec0 = Part.makeLine(pc5,pc1)\n edgec1 = Part.makeLine(pc1,pc2)\n edgec2 = Part.Arc(FreeCAD.Vector(pc2),FreeCAD.Vector(pc3),FreeCAD.Vector(pc4)).toShape()\n edgec3 = Part.makeLine(pc4,pc5)\n \n cut_profile = Part.Wire([edgec1, edgec2, edgec3, edgec0 ])alpha_rad = math.atan(2*H*17.0/24.0/P)\n alpha = math.degrees(alpha_rad)\n Hyp = P/math.cos(alpha_rad)\n # tuning = 511/1000.0\n tuning = self.Tuner/1000.0\n angled_Helix = Part.makeHelix(Hyp,Hyp*1.002/2.0,d*tuning,alpha)SH_faces = []if halfturn:\n half_Helix = Part.makeHelix(P,P/2.0,d*self.Tuner/1000.0,0) # make just half a turn\n angled_Helix.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),180)\n angled_Helix.translate(FreeCAD.Vector(0.0, 0.0,P/2.0))\n # Part.show(half_Helix)\n # Part.show(angled_Helix)\n pipe_cut = Part.Wire([half_Helix, angled_Helix]).makePipeShell([cut_profile],True,isFrenet)\n SH_faces.append(pipe_cut.Faces[0])\n SH_faces.append(pipe_cut.Faces[1])\n SH_faces.append(pipe_cut.Faces[2])\n SH_faces.append(pipe_cut.Faces[4])\n SH_faces.append(pipe_cut.Faces[5])\n SH_faces.append(pipe_cut.Faces[6])\n \n else:\n pipe_cut = Part.Wire(angled_Helix).makePipeShell([cut_profile],True,isFrenet)\n SH_faces.append(pipe_cut.Faces[0])\n SH_faces.append(pipe_cut.Faces[1])\n SH_faces.append(pipe_cut.Faces[2])\n \n # Part.show(pipe_cut)\n Shell_helix = Part.Shell(SH_faces)# rect_helix_profile, needed for cutting a tube-shell\n pr1 = (r +H/16.0, 0.0, 0.0)\n pr2 = (r -H/16.0, 0.0, 0.0)\n pr3 = (r -H/16.0, 0.0, P)\n pr4 = (r +H/16.0, 0.0, P)\n \n edge_r1 = Part.makeLine(pr1,pr2)\n edge_r2 = Part.makeLine(pr2,pr3)\n edge_r3 = Part.makeLine(pr3,pr4)\n edge_r4 = Part.makeLine(pr4,pr1)\n rect_profile = Part.Wire([edge_r1, edge_r2, edge_r3, edge_r4 ])\n rect_helix = Part.Wire(helix).makePipeShell([rect_profile], True, isFrenet)\n # if halfturn:\n # rect_helix.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),180)\n rect_helix.translate(FreeCAD.Vector(0.0, 0.0,- P))\n # Part.show(rect_helix)# rect_ring, nedded for cutting the Shell_helix\n pr5 = (r +H*1.1, 0.0, P*1.1)\n pr6 = (r, 0.0, P*1.1)\n pr7 = (r, 0.0, -P*1.1)\n pr8 = (r +H*1.1, 0.0, -P*1.1)edge_r5 = Part.makeLine(pr5,pr6)\n edge_r6 = Part.makeLine(pr6,pr7)\n edge_r7 = Part.makeLine(pr7,pr8)\n edge_r8 = Part.makeLine(pr8,pr5)\n rect_profile = Part.Wire([edge_r5, edge_r6, edge_r7, edge_r8 ])rect_Face =Part.Face(rect_profile)\n rect_ring= rect_Face.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(rect_ring)Shell_helix = Shell_helix.cut(rect_ring)\n Shell_helix.translate(FreeCAD.Vector(0.0, 0.0, P))\n # Part.show(Shell_helix)# shell_ring, the transition to a cylinder\n pr9 = (r, 0.0, P-offSet)\n pr10 = (r, 0.0, -P )\n edge_r9 = Part.makeLine(pr9,pr10)\n shell_ring= edge_r9.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n \n shell_ring = shell_ring.cut(pipe_cut)\n #Part.show(shell_ring)\n shell_ring = shell_ring.cut(rect_helix)\n shell_ring.translate(FreeCAD.Vector(0.0, 0.0, P))\n #Part.show(shell_ring)for flaeche in shell_ring.Faces:\n TheFaces.append(flaeche)\n \n for flaeche in Shell_helix.Faces:\n TheFaces.append(flaeche)\n \n if withcham:\n #FreeCAD.Console.PrintMessage(\"with chamfer: \" + str(i) + \"\\n\")\n # cutting of the bottom Faces\n # bot_off = 0.0 # nominal length\n cham_off = H/8.0\n cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0\n \n # points for chamfer: common-Method\n pch0 = (0.0, 0.0, -(rotations)*P + bot_off) # bottom center\n pch1 = (r-cham_t,0.0, -(rotations)*P + bot_off)\n pch2 = (r+cham_off, 0.0, -(rotations)*P + cham_t +cham_off + bot_off)\n pch3 = (r+cham_off, 0.0, -(rotations)*P + 3.0*P + bot_off)\n pch4 = (0.0, 0.0, -(rotations)*P + 3.0*P + bot_off) edgech0 = Part.makeLine(pch0,pch1)\n edgech1 = Part.makeLine(pch1,pch2)\n edgech2 = Part.makeLine(pch2,pch3)\n edgech3 = Part.makeLine(pch3,pch4)\n edgech4 = Part.makeLine(pch4,pch0) Wch_wire = Part.Wire([edgech0, edgech1, edgech2, edgech3, edgech4])\n cham_Face =Part.Face(Wch_wire)\n cham_Solid = cham_Face.revolve(Base.Vector(0.0,0.0,-(rotations-1)*P),Base.Vector(0.0,0.0,1.0),360)\n # Part.show(cham_Solid)\n \n BotShell = Part.Shell(botFaces)\n BotShell = BotShell.common(cham_Solid)\n # Part.show(BotShell)\n \n cham_faces = []\n cham_faces.append(cham_Solid.Faces[0])\n cham_faces.append(cham_Solid.Faces[1])\n cham_Shell = Part.Shell(cham_faces)\n # Part.show(cham_Shell) pipe0.translate(FreeCAD.Vector(0.0, 0.0, -(rotations-1)*P))\n # Part.show(pipe0)\n \n # Part.show(Fillet_shell)\n cham_Shell = cham_Shell.cut(pipe0)\n pipe0.translate(FreeCAD.Vector(0.0, 0.0, -P))\n # Part.show(pipe0)\n cham_Shell = cham_Shell.cut(pipe0) '''\n botFaces2 = []\n for flaeche in BotShell.Faces:\n botFaces2.append(flaeche)\n for flaeche in cham_Shell.Faces:\n botFaces2.append(flaeche)\n '''\n \n else: # tip of screw without chamfer\n #FreeCAD.Console.PrintMessage(\"without chamfer: \" + str(i) + \"\\n\")\n\n commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 3.0*P)\n commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations)*P+bot_off))\n #commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations+3)*P+bot_off))\n #Part.show(commonbox)\n \n BotShell = Part.Shell(botFaces)\n #Part.show(BotShell) BotShell = BotShell.common(commonbox)\n #BotShell = BotShell.cut(commonbox)\n bot_edges =[]\n bot_z = 1.0e-5 -(rotations)*P + bot_off\n \n for kante in BotShell.Edges:\n if (kante.Vertexes[0].Point.z<=bot_z) and (kante.Vertexes[1].Point.z<=bot_z):\n bot_edges.append(kante)\n # Part.show(kante)\n bot_wire = Part.Wire(Part.__sortEdges__(bot_edges))\n \n #botFaces2 = []\n #for flaeche in BotShell.Faces:\n # botFaces2.append(flaeche) \n \n bot_face = Part.Face(bot_wire)\n bot_face.reverse()\n #botFaces2.append(bot_face)'''\n\n BotShell2 = Part.Shell(botFaces2)\n # Part.show(BotShell2)TheShell2 = Part.Shell(TheFaces)# This gives a shell\n FaceList = []\n for flaeche in TheShell2.Faces:\n FaceList.append(flaeche)\n for flaeche in BotShell2.Faces:\n FaceList.append(flaeche)TheShell = Part.Shell(FaceList)\n # Part.show(TheShell)\n '''\n for flaeche in BotShell.Faces:\n TheFaces.append(flaeche)\n if withcham:\n for flaeche in cham_Shell.Faces:\n TheFaces.append(flaeche)\n else: \n TheFaces.append(bot_face)\n TheShell = Part.Shell(TheFaces)#print self.Tuner, \" \", TheShell.ShapeType, \" \", TheShell.isValid(), \" hrots: \", halfrots_int, \" Shellpunkte: \", len(TheShell.Vertexes)\n\n return TheShell\n\n\n # if da<>None: make Shell for a nut else: make a screw tap\n def makeInnerThread_2(self, d, P, rotations, da, l):\n d = float(d)\n bot_off = 0.0 # nominal length\n\n H=P*math.cos(math.radians(30)) # Gewindetiefe H\n r=d/2.0helix = Part.makeHelix(P,P,d*self.Tuner/1000.0,0) # make just one turn, length is identical to pitch\n helix.translate(FreeCAD.Vector(0.0, 0.0,-P*9.0/16.0))\n \n extra_rad = P\n\n # points for inner thread profile\n ps0 = (r,0.0, 0.0)\n ps1 = (r-H*5.0/8.0,0.0, -P*5.0/16.0)\n ps2 = (r-H*5.0/8.0,0.0, -P*9.0/16.0 )\n ps3 = (r, 0.0, -P*14.0/16.0)\n ps4 = (r+H*1/24.0,0.0, -P*31.0/32.0) # Center of Arc\n ps5 = (r,0.0, -P)\n ps6 = (r+extra_rad,0.0, -P)\n ps7 = (r+extra_rad,0.0, 0.0) \n\n #ps6 = (r-extra_rad,0.0, -P)\n #ps7 = (r-extra_rad,0.0, 0.0) \n \n edge0 = Part.makeLine(ps0,ps1)\n edge1 = Part.makeLine(ps1,ps2)\n edge2 = Part.makeLine(ps2,ps3)\n edge3 = Part.Arc(FreeCAD.Vector(ps3),FreeCAD.Vector(ps4),FreeCAD.Vector(ps5)).toShape()\n edge4 = Part.makeLine(ps5,ps6)\n edge5 = Part.makeLine(ps6,ps7)\n edge6 = Part.makeLine(ps7,ps0)\n \n W0 = Part.Wire([edge0, edge1, edge2, edge3, edge4, edge5, edge6])\n # Part.show(W0)makeSolid=True\n isFrenet=True\n pipe0 = Part.Wire(helix).makePipeShell([W0],makeSolid,isFrenet)\n # pipe1 = pipe0.copy()\n \n TheFaces = [] \n TheFaces.append(pipe0.Faces[0])\n TheFaces.append(pipe0.Faces[1])\n TheFaces.append(pipe0.Faces[2])\n TheFaces.append(pipe0.Faces[3])TheShell = Part.Shell(TheFaces)\n # print \"Shellpoints: \", len(TheShell.Vertexes)\n\n # Handling of the top faces\n if da <> None:\n TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P))\n for flaeche in TheShell.Faces:\n TheFaces.append(flaeche)\n TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P))\n for flaeche in TheShell.Faces:\n TheFaces.append(flaeche)\n\n cham_i_delta = da/2.0 - (r-H)\n cham_i = cham_i_delta * math.tan(math.radians(15.0))\n \n offSet = rotations*P - l\n #FreeCAD.Console.PrintMessage(\"Der Offset: \" + str(offSet/P) + \"\\n\")\n \n # points for chamfer: common-Method\n pch0 = (da/2.0-cham_i_delta, 0.0, -cham_i - offSet) # bottom chamfer\n pch1 = (da/2.0, 0.0, 0.0 - offSet) #\n pch2 = (da/2.0, 0.0, -4.0*P - offSet)\n pch3 = (da/2.0-cham_i_delta, 0.0, -4.0*P - offSet) edgech0 = Part.makeLine(pch0,pch1)\n edgech1 = Part.makeLine(pch1,pch2)\n edgech2 = Part.makeLine(pch2,pch3)\n edgech3 = Part.makeLine(pch3,pch0) Wch_wire = Part.Wire([edgech0, edgech1, edgech2, edgech3])\n cham_Face =Part.Face(Wch_wire)\n cham_Solid = cham_Face.revolve(Base.Vector(0.0,0.0,-(rotations-1)*P),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(cham_Solid)\n #Part.show(Wch_wire)\n \n rawTopShell = Part.Shell(TheFaces)\n topShell = rawTopShell.common(cham_Solid)\n\n # Making a Cutter for the cham face\n commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 2.0*P)\n commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-2.0*P))\n #Part.show(commonbox)\n \n cutterShell = rawTopShell.common(commonbox)\n bot_edges =[]\n bot_z = 1.0e-5 -2.0*P\n \n for kante in cutterShell.Edges:\n if (kante.Vertexes[0].Point.z<=bot_z) and (kante.Vertexes[1].Point.z<=bot_z):\n bot_edges.append(kante)\n # Part.show(kante)\n bot_wire = Part.Wire(Part.__sortEdges__(bot_edges))\n \n bot_face = Part.Face(bot_wire)\n bot_face.reverse()\n t_face = bot_face.copy()\n t_face.translate(Base.Vector(0.0, 0.0, 2.0*P))\n cutterFaces = cutterShell.Faces\n cutterFaces.append(bot_face.Faces[0])\n cutterFaces.append(t_face.Faces[0])\n cutShell = Part.Shell(cutterFaces)\n chamFcutter = Part.Solid(cutShell)\n \n #Part.show(chamFcutter) \n topCham = cham_Solid.Faces[0]\n topCham = topCham.cut(chamFcutter)\n\n #Part.show(topCham)\n TheFaces = [topCham.Faces[0]]\n TheFaces.extend(topShell.Faces)\n\n for i in range(rotations-4):\n TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P))\n for flaeche in TheShell.Faces:\n TheFaces.append(flaeche)\n\n\n else:\n commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 3.0*P)\n commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(3.0)*P))\n topShell = TheShell.common(commonbox)\n top_edges =[]\n top_z = -1.0e-5 \n \n for kante in topShell.Edges:\n if (kante.Vertexes[0].Point.z>=top_z) and (kante.Vertexes[1].Point.z>=top_z):\n top_edges.append(kante)\n # Part.show(kante)\n top_wire = Part.Wire(Part.__sortEdges__(top_edges))\n top_face = Part.Face(top_wire)\n \n TheFaces = [top_face.Faces[0]]\n TheFaces.extend(topShell.Faces)\n\n for i in range(rotations-2):\n TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P))\n for flaeche in TheShell.Faces:\n TheFaces.append(flaeche)#FreeCAD.Console.PrintMessage(\"Base-Shell: \" + str(i) + \"\\n\")\n # Make separate faces for the tip of the screw\n botFaces = []\n for i in range(rotations-2, rotations, 1):\n TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P))\n \n for flaeche in TheShell.Faces:\n botFaces.append(flaeche)\n #FreeCAD.Console.PrintMessage(\"Bottom-Shell: \" + str(i) + \"\\n\")if da <> None:\n # points for chamfer: common-Method\n pch0 = (da/2.0-cham_i_delta, 0.0, -(rotations)*P + cham_i) # bottom chamfer\n pch1 = (da/2.0, 0.0, -(rotations)*P) #\n pch2 = (da/2.0, 0.0, -(rotations)*P + 3.0*P)\n pch3 = (da/2.0-cham_i_delta, 0.0, -(rotations)*P + 3.0*P)\n #pch4 = (r-2.0*cham_i_delta, 0.0, -(rotations)*P + 3.0*P) edgech0 = Part.makeLine(pch0,pch1)\n edgech1 = Part.makeLine(pch1,pch2)\n edgech2 = Part.makeLine(pch2,pch3)\n edgech3 = Part.makeLine(pch3,pch0) Wch_wire = Part.Wire([edgech0, edgech1, edgech2, edgech3])\n cham_Face =Part.Face(Wch_wire)\n cham_Solid = cham_Face.revolve(Base.Vector(0.0,0.0,-(rotations-1)*P),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(cham_Solid)\n #Part.show(Wch_wire)\n \n BotShell = Part.Shell(botFaces)\n #Part.show(BotShell)\n chamFcutter.translate(FreeCAD.Vector(0.0, 0.0,-(rotations-1)*P))\n #Part.show(chamFcutter)\n \n \n BotShell = BotShell.common(cham_Solid)\n #Part.show(BotShell)\n \n cham_face = cham_Solid.Faces[0]\n cham_face = cham_face.cut(chamFcutter)\n #Part.show(cham_face) for flaeche in BotShell.Faces:\n TheFaces.append(flaeche)\n if da <> None:\n TheFaces.append(cham_face.Faces[0])\n else: \n TheFaces.append(bot_face)\n TheShell = Part.Shell(TheFaces) #print self.Tuner, \" \", TheShell.ShapeType, \" \", TheShell.isValid(), \" hrots: \", halfrots_int, \" Shellpunkte: \", len(TheShell.Vertexes)\n \n return TheShell\n\n\n \n else: # make of screw tap\n #FreeCAD.Console.PrintMessage(\"without chamfer: \" + str(i) + \"\\n\")\n\n commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 3.0*P)\n commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations)*P+bot_off))\n #commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations+3)*P+bot_off))\n #Part.show(commonbox)\n \n BotShell = Part.Shell(botFaces)\n #Part.show(BotShell) BotShell = BotShell.common(commonbox)\n #BotShell = BotShell.cut(commonbox)\n bot_edges =[]\n bot_z = 1.0e-5 -(rotations)*P + bot_off\n \n for kante in BotShell.Edges:\n if (kante.Vertexes[0].Point.z<=bot_z) and (kante.Vertexes[1].Point.z<=bot_z):\n bot_edges.append(kante)\n # Part.show(kante)\n bot_wire = Part.Wire(Part.__sortEdges__(bot_edges))\n \n bot_face = Part.Face(bot_wire)\n bot_face.reverse() for flaeche in BotShell.Faces:\n TheFaces.append(flaeche)\n if da <> None:\n for flaeche in cham_Shell.Faces:\n TheFaces.append(flaeche)\n else: \n TheFaces.append(bot_face)\n TheShell = Part.Shell(TheFaces)\n TheSolid = Part.Solid(TheShell) #print self.Tuner, \" \", TheShell.ShapeType, \" \", TheShell.isValid(), \" hrots: \", halfrots_int, \" Shellpunkte: \", len(TheShell.Vertexes)\n \n return TheSolid\n\n\n # make the ISO 4032 Hex-nut\n # make the ISO 4033 Hex-nut\n def makeIso4032(self,SType ='ISO4032', ThreadType ='M6'):\n dia = self.getDia(ThreadType)\n if SType == 'ISO4032':\n # P, c, damax, dw, e, m, mw, s_nom\n P, c, da, dw, e, m, mw, s = iso4032def[ThreadType]\n if SType == 'ISO4033':\n # P, c, damax, dw, e, m, mw, s_nom\n P, c, da, dw, e, m, mw, s = iso4033def[ThreadType]\n if SType == 'ISO4035':\n # P, c, damax, dw, e, m, mw, s_nom\n P, c, da, dw, e, m, mw, s = iso4035def[ThreadType]\n \n residue, turns = math.modf(m/P)\n #halfturns = 2*int(turns)\n \n if residue > 0.0:\n turns += 1.0\n #halfturns = halfturns +2\n #offSet = r - asqrt2_ = 1.0/math.sqrt(2.0)\n cham = (e-s)*math.sin(math.radians(15)) # needed for chamfer at nut top\n H=P*math.cos(math.radians(30)) # Gewindetiefe H\n cham_i_delta = da/2.0 - (dia/2.0-H*5.0/8.0)\n cham_i = cham_i_delta * math.tan(math.radians(15.0))\n \n\n if self.rThread:\n Pnt0 = Base.Vector(da/2.0-2.0*cham_i_delta,0.0,m - 2.0*cham_i)\n Pnt7 = Base.Vector(da/2.0-2.0*cham_i_delta,0.0,0.0+ 2.0*cham_i)\n else:\n Pnt0 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,m - cham_i)\n Pnt7 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,0.0+ cham_i)\n\n Pnt1 = Base.Vector(da/2.0,0.0,m)\n Pnt2 = Base.Vector(s/2.0,0.0,m)\n Pnt3 = Base.Vector(s/math.sqrt(3.0),0.0,m-cham)\n Pnt4 = Base.Vector(s/math.sqrt(3.0),0.0,cham)\n Pnt5 = Base.Vector(s/2.0,0.0,0.0)\n Pnt6 = Base.Vector(da/2.0,0.0,0.0)edge0 = Part.makeLine(Pnt0,Pnt1)\n edge1 = Part.makeLine(Pnt1,Pnt2)\n edge2 = Part.makeLine(Pnt2,Pnt3)\n edge3 = Part.makeLine(Pnt3,Pnt4)\n edge4 = Part.makeLine(Pnt4,Pnt5)\n edge5 = Part.makeLine(Pnt5,Pnt6)\n edge6 = Part.makeLine(Pnt6,Pnt7)\n edge7 = Part.makeLine(Pnt7,Pnt0)# create cutting tool for hexagon head \n # Parameters s, k, outer circle diameter = e/2.0+10.0 \n extrude = self.makeHextool(s, m, s*2.0)\n\n aWire=Part.Wire([edge0,edge1,edge2,edge3,edge4,edge5,edge6,edge7])\n #Part.show(aWire)\n aFace =Part.Face(aWire)\n head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0)\n #Part.show(head)\n \n #Part.show(extrude)\n nut = head.cut(extrude)\n # Part.show(nut)\n\n if self.rThread:\n '''\n threadCutter = self.makeInnerThread(dia, P, int(turns), None, m)\n # Part.show(threadCutter)\n threadCutter.translate(Base.Vector(0.0, 0.0,turns*P))\n nut = nut.cut(threadCutter)\n '''\n nutFaces = [nut.Faces[2]]\n for i in range(4,25):\n nutFaces.append(nut.Faces[i])\n\n\n threadShell = self.makeInnerThread_2(dia, P, int(turns), da, m)\n threadShell.translate(Base.Vector(0.0, 0.0,turns*P))\n #Part.show(threadShell)\n nutFaces.extend(threadShell.Faces)\n \n nutShell = Part.Shell(nutFaces)\n nut = Part.Solid(nutShell)\n #Part.show(nutShell)return nut\n\n\n # EN 1661 Hexagon nuts with flange\n # chamfer at top of hexagon is wrong = more than 30°\n def makeEN1661(self, ThreadType ='M8'):\n dia = self.getDia(ThreadType)\n P, da, c, dc, dw, e, m, mw, r1, s = en1661def[ThreadType]\n\n residue, turns = math.modf(m/P)\n #halfturns = 2*int(turns)\n \n if residue > 0.0:\n turns += 1.0#FreeCAD.Console.PrintMessage(\"the nut with isoEN1661: \" + str(c) + \"\\n\")\n cham = s*(2.0/math.sqrt(3.0)-1.0)*math.sin(math.radians(25)) # needed for chamfer at head top\n\n sqrt2_ = 1.0/math.sqrt(2.0)\n \n # Flange is made with a radius of c\n beta = math.radians(25.0)\n tan_beta = math.tan(beta)# Calculation of Arc points of flange edge using dc and c\n arc1_x = dc/2.0 - c/2.0 + (c/2.0)*math.sin(beta)\n arc1_z = c/2.0 + (c/2.0)*math.cos(beta)hF = arc1_z + (arc1_x -s/2.0) * tan_beta # height of flange at center#kmean = arc1_z + (arc1_x - s/math.sqrt(3.0)) * tan_beta + mw * 1.1 + cham\n #kmean = k * 0.95\n \n\n #Hex-Head Points\n #FreeCAD.Console.PrintMessage(\"the nut with kmean: \" + str(m) + \"\\n\")\n PntH0 = Base.Vector(da/2.0,0.0,m)\n PntH1 = Base.Vector(s/2.0,0.0,m)\n edgeH1 = Part.makeLine(PntH0,PntH1)\n\n hWire=Part.Wire([edgeH1])\n topShell = hWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(hWire)\n #Part.show(topShell)# create a cutter ring to generate the chamfer at the top of the hex\n chamHori = s/math.sqrt(3.0) - s/2.0\n PntC1 = Base.Vector(s/2.0-chamHori,0.0,m+m)\n PntC2 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,m+m)\n PntC3 = Base.Vector(s/2.0-chamHori,0.0,m+cham)\n PntC4 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,m-cham-cham) #s/math.sqrt(3.0)\n edgeC1 = Part.makeLine(PntC3, PntC1)\n edgeC2 = Part.makeLine(PntC1, PntC2)\n edgeC3 = Part.makeLine(PntC2, PntC4)\n edgeC4 = Part.makeLine(PntC4, PntC3)\n cWire = Part.Wire([edgeC4, edgeC1, edgeC2, edgeC3])\n cFace = Part.Face(cWire)\n chamCut = cFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #Part.show(cWire)\n #Part.show(chamCut)\n\n\n # create hexagon\n mhex=Base.Matrix()\n mhex.rotateZ(math.radians(60.0))\n polygon = []\n vhex=Base.Vector(s/math.sqrt(3.0),0.0,m)\n for i in range(6):\n polygon.append(vhex)\n vhex = mhex.multiply(vhex)\n polygon.append(vhex)\n hexagon = Part.makePolygon(polygon)\n hexFace = Part.Face(hexagon)\n solidHex = hexFace.extrude(Base.Vector(0.0,0.0,c-m))\n #Part.show(solidHex)\n hexCham = solidHex.cut(chamCut)\n #Part.show(hexCham)topFaces = topShell.FacestopFaces.append(hexCham.Faces[1])\n topFaces.append(hexCham.Faces[2])\n topFaces.append(hexCham.Faces[8])\n topFaces.append(hexCham.Faces[13])\n topFaces.append(hexCham.Faces[14])\n topFaces.append(hexCham.Faces[12])\n topFaces.append(hexCham.Faces[6])hexFaces = [hexCham.Faces[5], hexCham.Faces[11], hexCham.Faces[10]]\n hexFaces.extend([hexCham.Faces[9], hexCham.Faces[3], hexCham.Faces[0]])\n hexShell = Part.Shell(hexFaces)\n\n\n H=P*math.cos(math.radians(30)) # Gewindetiefe H\n cham_i_delta = da/2.0 - (dia/2.0-H*5.0/8.0)\n cham_i = cham_i_delta * math.tan(math.radians(15.0))\n \n # Center of flange:\n Pnt0 = Base.Vector(0.0,0.0,hF)\n Pnt1 = Base.Vector(s/2.0,0.0,hF)# arc edge of flange:\n Pnt2 = Base.Vector(arc1_x,0.0,arc1_z)\n Pnt3 = Base.Vector(dc/2.0,0.0,c/2.0)\n Pnt4 = Base.Vector((dc-c)/2.0,0.0,0.0)\n Pnt5 = Base.Vector(da/2.0,0.0,0.0) #start of fillet between flat and threadedge1 = Part.makeLine(Pnt0,Pnt1)\n edge2 = Part.makeLine(Pnt1,Pnt2)\n edge3 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape()\n edge4 = Part.makeLine(Pnt4,Pnt5)\n\n # make a cutter for the hexShell\n PntHC1 = Base.Vector(0.0,0.0,arc1_z)\n PntHC2 = Base.Vector(0.0,0.0,0.0)edgeHC1 = Part.makeLine(Pnt2,PntHC1)\n edgeHC2 = Part.makeLine(PntHC1,PntHC2)\n edgeHC3 = Part.makeLine(PntHC2,Pnt0)\n\n HCWire = Part.Wire([edge2, edgeHC1, edgeHC2, edgeHC3, edge1])\n HCFace = Part.Face(HCWire)\n hex2Cut = HCFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)hexShell = hexShell.cut(hex2Cut)\n #Part.show(hexShell)topFaces.extend(hexShell.Faces)if self.rThread:\n aWire=Part.Wire([edge2,edge3,edge4])\n boltIndex = 3else:\n Pnt7 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,m - cham_i)\n Pnt6 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,0.0+ cham_i)\n edge5 = Part.makeLine(Pnt5,Pnt6)\n edge6 = Part.makeLine(Pnt6,Pnt7)\n edge7 = Part.makeLine(Pnt7,PntH0)\n aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7])\n boltIndex = 6\n\n\n #aFace =Part.Face(aWire)\n #Part.show(aWire)\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n #FreeCAD.Console.PrintMessage(\"der Kopf mit revolve: \" + str(dia) + \"\\n\")\n #Part.show(headShell)\n chamFace = headShell.Faces[0].cut(solidHex)\n #Part.show(chamFace)topFaces.append(chamFace.Faces[0])\n for i in range(1,boltIndex):\n topFaces.append(headShell.Faces[i])\nif self.rThread:\n #rthread = self.makeShellthread(dia, P, halfturns, True, offSet)\n #rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P))\n threadShell = self.makeInnerThread_2(dia, P, int(turns), da, m)\n threadShell.translate(Base.Vector(0.0, 0.0,turns*P))\n #Part.show(threadShell)\n for tFace in threadShell.Faces:\n topFaces.append(tFace)\n headShell = Part.Shell(topFaces)\n screw = Part.Solid(headShell)\n else:\n screwShell = Part.Shell(topFaces)\n screw = Part.Solid(screwShell)\n\n return screw\n\n\n # make ISO 7380-1 Button head Screw \n # make ISO 7380-2 Button head Screw with collar \n # make DIN 967 cross recessed pan head Screw with collar \n def makeScrewTap(self, ThreadType ='M6',l=25.0):\n dia = self.getDia(ThreadType)\n\n P, tunIn, tunEx = tuningTable[ThreadType]\n\n residue, turns = math.modf((l)/P)\n turns += 1.0\n #FreeCAD.Console.PrintMessage(\"ScrewTap residue: \" + str(residue) + \" turns: \" + str(turns) + \"\\n\")\n \n\n if self.rThread:\n screwTap = self.makeInnerThread_2(dia, P, int(turns), None, 0.0)\n screwTap.translate(Base.Vector(0.0, 0.0,(1-residue)*P))\n else:\n H=P*math.cos(math.radians(30)) # Gewindetiefe H\n r=dia/2.0 # points for inner thread profile\n Pnt0 = Base.Vector(0.0,0.0,(1-residue)*P) \n Pnt1 = Base.Vector(r-H*5.0/8.0,0.0,(1-residue)*P) \n Pnt2 = Base.Vector(r-H*5.0/8.0,0.0,-l) \n Pnt3 = Base.Vector(0.0,0.0,-l) \n \n edge1 = Part.makeLine(Pnt0,Pnt1)\n edge2 = Part.makeLine(Pnt1,Pnt2)\n edge3 = Part.makeLine(Pnt2,Pnt3)\n aWire=Part.Wire([edge1,edge2,edge3])\n headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0)\n screwTap = Part.Solid(headShell)\n\n return screwTap\n\n\n def cutChamfer(self, dia_cC, P_cC, l_cC):\n cham_t = P_cC*math.sqrt(3.0)/2.0*17.0/24.0\n PntC0 = Base.Vector(0.0,0.0,-l_cC)\n PntC1 = Base.Vector(dia_cC/2.0-cham_t,0.0,-l_cC)\n PntC2 = Base.Vector(dia_cC/2.0+cham_t,0.0,-l_cC+cham_t+cham_t)\n PntC3 = Base.Vector(dia_cC/2.0+cham_t,0.0,-l_cC-P_cC-cham_t)\n PntC4 = Base.Vector(0.0,0.0,-l_cC-P_cC-cham_t)edgeC1 = Part.makeLine(PntC0,PntC1)\n edgeC2 = Part.makeLine(PntC1,PntC2)\n edgeC3 = Part.makeLine(PntC2,PntC3)\n edgeC4 = Part.makeLine(PntC3,PntC4)\n edgeC5 = Part.makeLine(PntC4,PntC0)\n CWire=Part.Wire([edgeC1,edgeC2,edgeC3,edgeC4,edgeC5])\n #Part.show(CWire)\n CFace =Part.Face(CWire)\n cyl = CFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n return cyl\n\n\n # cross recess type H\n def makeCross_H3(self, CrossType = '2', m = 6.9, h = 0.0):\n # m = diameter of cross at top of screw at reference level for penetration depth\n b, e_mean, g, f_mean, r, t1, alpha, beta = iso4757def[CrossType]rad265 = math.radians(26.5)\n rad28 = math.radians(28.0)\n tg = (m-g)/2.0/math.tan(rad265) # depth at radius of g\n t_tot = tg + g/2.0 * math.tan(rad28) # total depth# print 'tg: ', tg,' t_tot: ', t_tot\n hm = m / 4.0\n hmc = m / 2.0\n rmax = m / 2.0 + hm*math.tan(rad265)Pnt0 = Base.Vector(0.0,0.0,hm)\n Pnt1 = Base.Vector(rmax,0.0,hm)\n Pnt3 = Base.Vector(0.0,0.0,0.0)\n Pnt4 = Base.Vector(g/2.0,0.0,-tg)\n Pnt5 = Base.Vector(0.0,0.0,-t_tot)edge1 = Part.makeLine(Pnt0,Pnt1)\n edge3 = Part.makeLine(Pnt1,Pnt4)\n edge4 = Part.makeLine(Pnt4,Pnt5)\n # FreeCAD.Console.PrintMessage(\"Edges made Pnt2: \" + str(Pnt2) + \"\\n\")aWire=Part.Wire([edge1,edge3,edge4])\n crossShell = aWire.revolve(Pnt3,Base.Vector(0.0,0.0,1.0),360)\n # FreeCAD.Console.PrintMessage(\"Peak-wire revolved: \" + str(e_mean) + \"\\n\")\n cross = Part.Solid(crossShell)\n #Part.show(cross)\n \n # the need to cut 4 corners out of the above shape.\n # Definition of corner\n # The angles 92 degrees and alpha are defined on a plane which has \n # an angle of beta against our coordinate system.\n # The projected angles are needed for easier calculation!\n rad_alpha = math.radians(alpha/2.0)\n rad92 = math.radians(92.0/2.0)\n rad_beta = math.radians(beta)rad_alpha_p = math.atan(math.tan(rad_alpha)/math.cos(rad_beta))\n rad92_p = math.atan(math.tan(rad92)/math.cos(rad_beta))tb = tg + (g-b)/2.0 * math.tan(rad28) # depth at dimension b\n rbtop = b/2.0 + (hmc + tb)*math.tan(rad_beta) # radius of b-corner at hm\n rbtot = b/2.0 - (t_tot - tb)*math.tan(rad_beta) # radius of b-corner at t_totdre = e_mean/2.0 / math.tan(rad_alpha_p) # delta between corner b and corner e in x direction\n #FreeCAD.Console.PrintMessage(\"delta calculated: \" + str(dre) + \"\\n\")\n \n dx = m/2.0 * math.cos(rad92_p)\n dy = m/2.0 * math.sin(rad92_p)\n \n PntC0 = Base.Vector(rbtop,0.0,hmc)\n PntC1 = Base.Vector(rbtot,0.0,-t_tot)\n PntC2 = Base.Vector(rbtop+dre,+e_mean/2.0,hmc)\n PntC3 = Base.Vector(rbtot+dre,+e_mean/2.0,-t_tot)\n PntC4 = Base.Vector(rbtop+dre,-e_mean/2.0,hmc)\n PntC5 = Base.Vector(rbtot+dre,-e_mean/2.0,-t_tot)PntC6 = Base.Vector(rbtop+dre+dx,+e_mean/2.0+dy,hmc)\n #PntC7 = Base.Vector(rbtot+dre+dx,+e_mean/2.0+dy,-t_tot)\n PntC7 = Base.Vector(rbtot+dre+2.0*dx,+e_mean+2.0*dy,-t_tot)\n PntC8 = Base.Vector(rbtop+dre+dx,-e_mean/2.0-dy,hmc)\n #PntC9 = Base.Vector(rbtot+dre+dx,-e_mean/2.0-dy,-t_tot)\n PntC9 = Base.Vector(rbtot+dre+2.0*dx,-e_mean-2.0*dy,-t_tot)\n \n #wire_hm = Part.makePolygon([PntC0,PntC2,PntC6,PntC8,PntC4,PntC0])\n #face_hm =Part.Face(wire_hm)\n #Part.show(face_hm)\n \n wire_t_tot = Part.makePolygon([PntC1,PntC3,PntC7,PntC9,PntC5,PntC1])\n # Part.show(wire_t_tot)\n edgeC1 = Part.makeLine(PntC0,PntC1)\n #FreeCAD.Console.PrintMessage(\"edgeC1 mit PntC9\" + str(PntC9) + \"\\n\")\n \n makeSolid=True\n isFrenet=False\n corner = Part.Wire(edgeC1).makePipeShell([wire_t_tot],makeSolid,isFrenet)\n #Part.show(corner)rot_axis = Base.Vector(0.,0.,1.0)\n sin_res = math.sin(math.radians(90)/2.0)\n cos_res = math.cos(math.radians(90)/2.0)\n rot_axis.multiply(-sin_res) # Calculation of Quaternion-Elements\n #FreeCAD.Console.PrintMessage(\"Quaternion-Elements\" + str(cos_res) + \"\\n\")\n \n pl_rot = FreeCAD.Placement()\n pl_rot.Rotation = (rot_axis.x,rot_axis.y,rot_axis.z,cos_res) #Rotation-Quaternion 90° z-AxiscrossShell = crossShell.cut(corner)\n #Part.show(crossShell)\n cutplace = corner.PlacementcornerFaces = []\n cornerFaces.append(corner.Faces[0])\n cornerFaces.append(corner.Faces[1])\n cornerFaces.append(corner.Faces[3])\n cornerFaces.append(corner.Faces[4])\n \n cornerShell = Part.Shell(cornerFaces)\n cornerShell = cornerShell.common(cross)\n addPlace = cornerShell.PlacementcrossFaces = cornerShell.Faces\n \n for i in range(3):\n cutplace.Rotation = pl_rot.Rotation.multiply(corner.Placement.Rotation)\n crossShell = crossShell.cut(corner)\n addPlace.Rotation = pl_rot.Rotation.multiply(cornerShell.Placement.Rotation)\n for coFace in cornerShell.Faces:\n crossFaces.append(coFace)\n\n #Part.show(crossShell)\n for i in range(1,6):\n crossFaces.append(crossShell.Faces[i])\n\n crossShell0 = Part.Shell(crossFaces)crossFaces.append(crossShell.Faces[0])\n crossShell = Part.Shell(crossFaces)cross = Part.Solid(crossShell)\n \n\n #FreeCAD.Console.PrintMessage(\"Placement: \" + str(pl_rot) + \"\\n\")\n \n cross.Placement.Base = Base.Vector(0.0,0.0,h)\n crossShell0.Placement.Base = Base.Vector(0.0,0.0,h)\n #Part.show(crossShell0)\n #Part.show(cross)\n return cross, crossShell0\n\n\n # Allen recess cutting tool\n # Parameters used: s_mean, k, t_min, dk\n def makeAllen2(self, s_a = 3.0, t_a = 1.5, h_a = 2.0 ):\n # h_a top height location of cutting tool \n # s_a hex width\n # t_a dept of the allen\n # dk_a diameter not needed anymore\n\n e_cham = 2.0 * s_a / math.sqrt(3.0)\n depth = s_a / 3.0\n #FreeCAD.Console.PrintMessage(\"allen tool: \" + str(s_a) + \"\\n\")\n\n\n # Points for an arc at the peak of the cone\n rCone = e_cham/4.0\n hyp = (depth*math.sqrt(e_cham**2/depth**2+1.0)*rCone)/e_cham\n radAlpha = math.atan(e_cham/depth)\n radBeta = math.pi/2.0 - radAlpha\n zrConeCenter=hyp - depth -t_a\n xArc1=math.sin(radBeta)*rCone\n zArc1=zrConeCenter - math.cos(radBeta)*rCone\n xArc2=math.sin(radBeta/2.0)*rCone\n zArc2=zrConeCenter - math.cos(radBeta/2.0)*rCone\n zArc3 = zrConeCenter - rCone\n\n # The round part of the cutting tool, we need for the allen hex recess\n PntH1 = Base.Vector(0.0,0.0,-t_a-depth-depth)\n PntH2 = Base.Vector(e_cham,0.0,-t_a-depth-depth)\n PntH3 = Base.Vector(e_cham,0.0,-t_a+depth)\n PntH4 = Base.Vector(0.0,0.0,-t_a-depth)\n\n PntA1 = Base.Vector(xArc1,0.0,zArc1)\n PntA2 = Base.Vector(xArc2,0.0,zArc2)\n PntA3 = Base.Vector(0.0,0.0,zArc3)edgeA1 = Part.Arc(PntA1,PntA2,PntA3).toShape()edgeH1 = Part.makeLine(PntH1,PntH2)\n edgeH2 = Part.makeLine(PntH2,PntH3)\n edgeH3 = Part.makeLine(PntH3,PntA1)\n edgeH4 = Part.makeLine(PntA3,PntH1)\n\n hWire=Part.Wire([edgeH1,edgeH2,edgeH3,edgeA1,edgeH4])\n # Part.show(hWire)\n hFace =Part.Face(hWire)\n roundtool = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n\n # create hexagon\n mhex=Base.Matrix()\n mhex.rotateZ(math.radians(60.0))\n polygon = []\n vhex=Base.Vector(s_a/math.sqrt(3.0),0.0,1.0)\n for i in range(6):\n polygon.append(vhex)\n vhex = mhex.multiply(vhex)\n polygon.append(vhex)\n hexagon = Part.makePolygon(polygon)\n hexFace = Part.Face(hexagon)\n solidHex = hexFace.extrude(Base.Vector(0.0,0.0,-1.0-t_a-depth*1.1))\n allen = solidHex.cut(roundtool)\n #Part.show(allen)\n\n allenFaces = [allen.Faces[0]]\n for i in range(2,9):\n allenFaces.append(allen.Faces[i])\n allenShell = Part.Shell(allenFaces)\n solidHex.Placement.Base = Base.Vector(0.0,0.0,h_a)\n allenShell.Placement.Base = Base.Vector(0.0,0.0,h_a)\n return solidHex, allenShell \n\n\n # ISO 10664 Hexalobular internal driving feature for bolts and screws\n def makeIso10664_3(self,RType ='T20',t_hl=3.0, h_hl = 0):\n # t_hl depth of the recess\n # h_hl top height location of Cutting tool\n A, B, Re = iso10664def[RType]\n sqrt_3 = math.sqrt(3.0)\n depth=A/4.0\n offSet = 1.0\n\n # Chamfer cutter for the hexalobular recess\n PntH1 = Base.Vector(0.0,0.0,-t_hl-depth-1.0)\n #PntH2 = Base.Vector(A/2.0*1.02,0.0,-t_hl-depth-1.0)\n #PntH3 = Base.Vector(A/2.0*1.02,0.0,-t_hl)\n PntH2 = Base.Vector(A,0.0,-t_hl-depth-1.0)\n PntH3 = Base.Vector(A,0.0,-t_hl+depth)\n PntH4 = Base.Vector(0.0,0.0,-t_hl-depth)# Points for an arc at the peak of the cone\n rCone = A/4.0\n hyp = (depth*math.sqrt(A**2/depth**2+1.0)*rCone)/A\n radAlpha = math.atan(A/depth)\n radBeta = math.pi/2.0 - radAlpha\n zrConeCenter=hyp - depth -t_hl\n xArc1=math.sin(radBeta)*rCone\n zArc1=zrConeCenter - math.cos(radBeta)*rCone\n xArc2=math.sin(radBeta/2.0)*rCone\n zArc2=zrConeCenter - math.cos(radBeta/2.0)*rCone\n zArc3 = zrConeCenter - rCone\n\n PntA1 = Base.Vector(xArc1,0.0,zArc1)\n PntA2 = Base.Vector(xArc2,0.0,zArc2)\n PntA3 = Base.Vector(0.0,0.0,zArc3)edgeA1 = Part.Arc(PntA1,PntA2,PntA3).toShape()edgeH1 = Part.makeLine(PntH1,PntH2)\n edgeH2 = Part.makeLine(PntH2,PntH3)\n edgeH3 = Part.makeLine(PntH3,PntA1)\n edgeH4 = Part.makeLine(PntA3,PntH1)\n\n hWire=Part.Wire([edgeH1,edgeH2,edgeH3,edgeA1])\n cutShell = hWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360)\n cutTool = Part.Solid(cutShell)\n Ri = -((B+sqrt_3*(2.*Re-A))*B+(A-4.*Re)*A)/(4.*B-2.*sqrt_3*A+(4.*sqrt_3-8.)*Re)\n #print '2nd Ri last solution: ', Ri\n beta=math.acos(A/(4*Ri+4*Re)-(2*Re)/(4*Ri+4*Re))-math.pi/6\n #print 'beta: ', beta\n Rh=(sqrt_3*(A/2.0-Re))/2.0\n Re_x = A/2.0 - Re + Re*math.sin(beta)\n Re_y = Re*math.cos(beta)\n Ri_y = B/4.0\n Ri_x = sqrt_3*B/4.0mhex=Base.Matrix()\n mhex.rotateZ(math.radians(60.0))\n hexlobWireList = []PntRe0=Base.Vector(Re_x,-Re_y,offSet)\n PntRe1=Base.Vector(A/2.0,0.0,offSet)\n PntRe2=Base.Vector(Re_x,Re_y,offSet)\n edge0 = Part.Arc(PntRe0,PntRe1,PntRe2).toShape()\n #Part.show(edge0)\n hexlobWireList.append(edge0)PntRi = Base.Vector(Ri_x,Ri_y,offSet)\n PntRi2 = mhex.multiply(PntRe0)\n edge1 = Part.Arc(PntRe2,PntRi,PntRi2).toShape()\n #Part.show(edge1)\n hexlobWireList.append(edge1)\n \n for i in range(5):\n PntRe1 = mhex.multiply(PntRe1)\n PntRe2 = mhex.multiply(PntRe2)\n edge0 = Part.Arc(PntRi2,PntRe1,PntRe2).toShape()\n hexlobWireList.append(edge0)\n PntRi = mhex.multiply(PntRi)\n PntRi2 = mhex.multiply(PntRi2)\n if i == 5:\n edge1 = Part.Arc(PntRe2,PntRi,PntRe0).toShape()\n else:\n edge1 = Part.Arc(PntRe2,PntRi,PntRi2).toShape()\n hexlobWireList.append(edge1)\n hexlobWire=Part.Wire(hexlobWireList)\n #Part.show(hWire)\n \n face=Part.Face(hexlobWire)# Extrude in z to create the cutting tool for the screw-head-face\n Helo=face.extrude(Base.Vector(0.0,0.0,-t_hl-depth-offSet))\n # Make the recess-shell for the screw-head-shellhexlob = Helo.cut(cutTool)\n #Part.show(hexlob)\n hexlobFaces = [hexlob.Faces[0]]\n for i in range(2,15):\n hexlobFaces.append(hexlob.Faces[i])\n\n hexlobShell = Part.Shell(hexlobFaces)\n \n hexlobShell.Placement.Base = Base.Vector(0.0,0.0,h_hl)\n Helo.Placement.Base = Base.Vector(0.0,0.0,h_hl)\n\n return Helo, hexlobShell\n\n def setThreadType(self, TType = 'simple'):\n self.simpThread = False\n self.symThread = False\n self.rThread = False\n if TType == 'simple':\n self.simpThread = True\n if TType == 'symbol':\n self.symThread = True\n if TType == 'real':\n self.rThread = True\n\n def setTuner(self, myTuner = 511):\n self.Tuner = myTuner\n\n def getDia(self,ThreadType):\n if '(' in ThreadType:\n threadString = ThreadType.lstrip('(M')\n dia = float(threadString.rstrip(')'))\n else:\n dia=float(ThreadType.lstrip('M'))\n return dia\n\n \nclass ScrewMacro(object):\n d = QtGui.QWidget()\n d.ui = Ui_ScrewMaker()\n d.ui.setupUi(d)\n if __name__ == '__main__':\n d.show()\n\n\ndef main():\n o = ScrewMacro()\n\nif __name__ == '__main__':\n main()\n\n}}\n\n## Link\n\nThe forum [Screw Maker](https://forum.freecadweb.org/viewtopic.php?f=22&t=6558&start=30#p95929)\n\n\n---\n⏵ [documentation index](../README.md) > Macro screw maker1 2/en\n"} {"id": "freecad-docs:wiki/translations/en/Manual_The_FreeCAD_document.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Manual_The_FreeCAD_document.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Manual_The_FreeCAD_document.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "9a0f06e3bdd291d80a2b835792e5ef7f06199746028c051dae1c4e400a49de9e", "bytes": 2438, "tokens": 579, "text": "# Manual:The FreeCAD document/en\n{{Manual:TOC}}\n\nA FreeCAD document forms the core of your design environment, encapsulating all the objects and elements that make up your scene. It can contain a variety of objects created across different workbenches, allowing for seamless integration and flexibility as you can switch between workbenches while working within the same document. A document is essentially the file that you save to your disk containing all your work, and FreeCAD allows you to open multiple documents simultaneously, as well as multiple views of the same document.\n\nWithin the document, you can organize objects into groups, each with a unique name for easy identification and management. This management of groups, objects, and their names chiefly occurs within the [tree view](tree_view.md). Here, users can craft new groups, assign objects to these groups, and perform deletions. More detailed customizations such as renaming objects, changing their visual properties like color, or adjusting visibility, can be done by right-clicking an object or a group in the Tree View. Additional functionalities may also be available depending on the active workbench.\n\nObjects in a FreeCAD document vary widely in type, as each workbench introduces its unique kind of objects. For example, the [Mesh Workbench](Mesh_Workbench.md) is known for adding mesh objects, while the [Part Workbench](Part_Workbench.md) provides Part objects. In any FreeCAD session, if at least one document is open, that document is considered active and is displayed in the current 3D view. This is the document you are actively modifying. Switching tabs to another document makes the newly selected tab the active document, and most operations will be applied to it.\n\nFreeCAD documents are saved in the .FCStd file format, which utilizes a zip-based compound structure akin to formats used by software like LibreOffice. If technical issues arise, the document can often be unzipped, allowing direct access to its contents for troubleshooting or data recovery purposes. This capability provides an additional safety net, ensuring that your design work can be preserved and recovered even under unexpected circumstances.\n\n![](images/FreeCAD_022_Document.png )\n\n**Read more**\n\n- [The FreeCAD document](Document_structure.md)\n- [File Format FCStd](File_Format_FCStd.md)\n\n\n---\n⏵ [documentation index](../README.md) > Manual:The FreeCAD document/en\n"} {"id": "freecad-docs:wiki/translations/en/Mesh_EvaluateSolid.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Mesh_EvaluateSolid.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Mesh_EvaluateSolid.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "37be70e1bca9388bcde9433021ada7cf4ba94a8cf76083a546f97f0824c0b6cd", "bytes": 983, "tokens": 324, "text": "---\n GuiCommand:\n Name: Mesh EvaluateSolid\n MenuLocation: Meshes , Analyze , Check solid mesh\n Workbenches: Mesh_Workbench\n SeeAlso: Arch_SelectNonSolidMeshes\n---\n\n# Mesh EvaluateSolid/en\n\n## Description\n\nThe **Mesh EvaluateSolid** command checks if a mesh object is solid. A solid mesh object does not have any holes.\n\n## Usage\n\n1. Select a single mesh object.\n2. There are several ways to invoke the command:\n - Press the ** [Check solid mesh](Mesh_EvaluateSolid.md)** button.\n - Select the **Meshes → Analyze → Check solid mesh** option from the menu.\n3. The **Solid Mesh** dialog box opens informing that the selected mesh object is solid or not.\n4. Press the **OK** button to close the dialog box and finish the command.\n\n\n{{Mesh Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh EvaluateSolid/en\n"} {"id": "freecad-docs:wiki/translations/en/Mesh_SplitComponents.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Mesh_SplitComponents.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Mesh_SplitComponents.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e2eb8a6bfa1295de2c60a56ec5cebe683773a06b2570898459cf17308b446567", "bytes": 1208, "tokens": 402, "text": "---\n GuiCommand:\n Name: Mesh SplitComponents\n MenuLocation: Meshes , Split by components\n Workbenches: Mesh_Workbench\n Version: 0.19\n SeeAlso: Mesh_Merge\n---\n\n# Mesh SplitComponents/en\n\n## Description\n\nThe **Mesh SplitComponents** command splits a mesh object into its components. A mesh component is a complete group of connected faces. For each component a new non-parametric mesh object, a [Mesh Feature](Mesh_Feature.md), is created. If the original mesh object contains only one component, and this is usually the case, a single new mesh object, effectively a copy, is created. This command is the counterpart of the [Mesh Merge](Mesh_Merge.md) command.\n\n## Usage\n\n1. Select a single mesh object.\n2. There are several ways to invoke the command:\n - Press the ** [Split by components](Mesh_SplitComponents.md)** button.\n - Select the **Meshes → Split by components** option from the menu.\n\n## Properties\n\nSee: [Mesh Feature](Mesh_Feature.md).\n\n\n{{Mesh Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh SplitComponents/en\n"} {"id": "freecad-docs:wiki/translations/en/OpenSCAD_ColorCodeShape.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/OpenSCAD_ColorCodeShape.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/OpenSCAD_ColorCodeShape.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "421a4c9fa6976663f42be9930589027642ae8228b3db2f64bcdadc2223596d9e", "bytes": 467, "tokens": 185, "text": "---\n GuiCommand:\n Name: OpenSCAD ColorCodeShape‏‎\n MenuLocation: OpenSCAD , ColorCodeShape‏‎\n Workbenches: OpenSCAD_Workbench\n---\n\n# OpenSCAD ColorCodeShape/en\n\n## Description\n\n## Usage\n\n## Limitations\n\n## Notes\n\n- Source: \n\n\n{{OpenSCAD_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [OpenSCAD](OpenSCAD_Workbench.md) > OpenSCAD ColorCodeShape/en\n"} {"id": "freecad-docs:wiki/translations/en/PartDesign_AdditiveCone.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/PartDesign_AdditiveCone.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/PartDesign_AdditiveCone.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "49265454249d1969367495e52828df0a5dbe6787d38082249f531a8ee5971da3", "bytes": 2015, "tokens": 625, "text": "---\n GuiCommand:\n Name: PartDesign AdditiveCone\n MenuLocation: Part Design , Create an additive primitive , Additive Cone\n Workbenches: PartDesign_Workbench\n Version: 0.17\n SeeAlso: PartDesign_CompPrimitiveAdditive, PartDesign_SubtractiveCone\n---\n\n# PartDesign AdditiveCone/en\n\n## Description\n\nInserts a primitive cone in the active Body as the first feature, or fuses it to the existing feature(s).\n\n\"\"\n\n## Usage\n\n1. Press the ** '''Additive Cone'''** button. **Note**: the Additive Cone is part of an icon menu labelled *Create an additive primitive*. After launching FreeCAD, the Additive Box is the one displayed in the toolbar. To get to the Cone button, click on the down arrow besides the visible icon and select Additive Cone in the menu.\n2. Set the Primitive parameters (for a complete cone, set one of the radii to zero) and the [Attachment](Part_EditAttachment.md).\n3. Click **OK**.\n4. A Cone feature appears under the active Body.\n\n## Options\n\nThe Cone can be edited after its creation in two ways:\n\n- Double-clicking it in the Model tree, or by right-clicking and selecting **Edit primitive** in the contextual menu; this brings up the Primitive parameters.\n- Via the [Property editor](Property_editor.md).\n\n## Properties\n\n- **Attachment**: defines the attachment mode as well as the Attachment Offset. See [Part EditAttachment](Part_EditAttachment.md).\n\n- **Label**: label given to the Cone object. Change to suit your needs.\n\n- **Radius1**: the radius value at the cone\\'s base.\n\n- **Radius2**: the radius value at the cone\\'s top. A non-zero value creates a truncated cone.\n\n- **Height**: the height of the cone along its axis.\n\n- **Angle**: angle of rotation of the cross section (360 degrees in a full cone).\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign AdditiveCone/en\n"} {"id": "freecad-docs:wiki/translations/en/PartDesign_AdditivePrism.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/PartDesign_AdditivePrism.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/PartDesign_AdditivePrism.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0a3939485c34e6840753531de7743668bbea3c73382e39f6064a55589419bb88", "bytes": 2143, "tokens": 652, "text": "---\n GuiCommand:\n Name: PartDesign AdditivePrism\n MenuLocation: Part Design , Create an additive primitive , Additive Prism\n Workbenches: PartDesign_Workbench\n Version: 0.17\n SeeAlso: PartDesign_CompPrimitiveAdditive, PartDesign_SubtractivePrism\n---\n\n# PartDesign AdditivePrism/en\n\n## Description\n\nInserts a primitive prism in the active Body as the first feature, or fuses it to the existing feature(s).\n\n\"\"\n\n## Usage\n\n1. Press the ** '''Additive Prism'''** button. **Note**: the Additive Prism is part of an icon menu labelled *Create an additive primitive*. After launching FreeCAD, the Additive Box is the one displayed in the toolbar. To get the Prism, click on the down arrow besides the visible icon and select Additive Prism in the menu.\n2. Set the Primitive parameters and [Attachment](Part_EditAttachment.md).\n3. Click **OK**.\n4. A Prism feature appears under the active Body.\n\n## Options\n\nIt is possible to create skewed prisms by specifying angles in respect to the normal vector of the chosen attachment.\n\nThe Prism can be edited after its creation in two ways:\n\n- Double-clicking it in the Model tree, or by right-clicking and selecting **Edit primitive** in the contextual menu; this brings up the Primitive parameters.\n- Via the [Property editor](Property_editor.md).\n\n## Properties\n\n- **Attachment**: defines the attachment mode as well as the Attachment Offset. See [Part EditAttachment](Part_EditAttachment.md).\n\n- **Label**: label given to the Prism object. Change to suit your needs.\n\n- **Polygon**: number of sides in the polygon cross-section of the prism.\n\n- **Circumradius**: [circumscribed radius](https://en.wikipedia.org/wiki/Circumscribed_circle) of the polygon cross-section of the prism.\n\n- **Height**: height of the prism.\n\n- **First Angle**: angle in first direction.\n\n- **Second Angle**: angle in second direction.\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign AdditivePrism/en\n"} {"id": "freecad-docs:wiki/translations/en/PartDesign_Bearingholder_Tutorial_I.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/PartDesign_Bearingholder_Tutorial_I.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/PartDesign_Bearingholder_Tutorial_I.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "a719ae1ca559b083e902e9d3b2213554d9b69edcb82afa9a3eaeb99482d47ee1", "bytes": 15924, "tokens": 4132, "text": "---\n TutorialInfo:\n Topic: Modeling\n Level: Experienced User\n Author: NormandC\n Time: \n FCVersion: 0.19.23300 or higher\n Files: \n---\n\n# PartDesign Bearingholder Tutorial I/en\n\n\n**This tutorial was originally written for a now deprecated development version of FreeCAD. This tutorial requires a complete rewrite to align with the PartDesign changes that will be in the upcoming v0.17 release.**\n\n\n![Bearing Holder Tutorial - Finished bearing holder (top)\\|thumb\\|right\\|400px](images/HolderTop1-1.jpg )\n\n## Purpose in Brief \n\nThe purpose of the tutorial is to introduce you to two different work flows for creating a cast part with drafts and fillets. Depending on what other CAD programs you have been using, one or the other might be familiar to you. As a working example we will be modeling a simple bearing holder.\n\nThis is the first part of the tutorial. It will use what might be called the \\'single body\\' work flow, using the (simpler) top part of the holder as an example.\n\nObviously, to follow through this tutorial you must activate the PartDesign workbench.\n\n~~You can find my version of the part created by this tutorial [http://ubuntuone.com/5gok0J4dye3Fo4BKWMGWVa here](http://ubuntuone.com/5gok0J4dye3Fo4BKWMGWVa_here.md).~~ *The file is no longer available, a new one will be provided at some later date*.\n\n## Design data \n\nThe holder should be able to hold a diameter 90mm bearing with a width of up to 33mm (e.g. DIN 630 type 2308). The bearing requires a shoulder height of at least 4.5mm in the holder (and on the shaft). The top part of the holder will be bolted to the bottom with two 12mm bolts. There should be a groove on both sides of the bearing able to hold a standard shaft sealing ring DIN 3760: 38x55x7 or 40x55x7 on one side, 50x68x8 on the other side.\n\nThe holder will be a sand cast with a minimum wall thickness of 5mm, a draft angle of 2 degrees, and a minimum fillet radius of 3mm.\n\n== Setting up the skeleton geometry ==\n\n![Bearing holder with the two most important skeleton planes\\|thumb\\|right\\|text-top\\|400px](images/HolderTop1-2.jpg )\n\nThe idea of skeleton geometry is to capture the basic design dimensions in a single datum feature (e.g. a plane or an axis). When the design dimension changes, all that needs to be done is to change the skeleton feature. If the model is well built, then all its feature will recompute to reflect the design change. This reduces the danger that in a complex model, where the basic design dimensions are used in multiple places, you forget to change it somewhere.\n\nThe alternative to skeleton geometry is to have a table of the basic design dimensions that assign a symbolic name to each dimension, and then use the symbolic name wherever the dimensions is required to build the model. FreeCAD does not allow this approach yet.\n\n![Base planes and all datum planes\\|thumb\\|right\\|text-top\\|400px](images/HolderTop1-3.jpg )\n\nFor the case of the bearing holder, the two most important design dimensions are the distance between the bolts (which limits the size of the bearing that can be used) and the height of the bolt heads. The dimensions chosen are\n\n- Distance between bolts: Radius of bearing (45) + wall thickness (5) plus radius of hole for bolt (7) = 57mm, so the vertical plane will be 57mm offset from the YZ-plane. To create this datum plane, select the YZ-plane and then choose to create a new datum plane. Enter the offset in the dialog that opens up\n- Height of bolt heads: This was chosen as an offset of 28mm from the XZ-plane\n\nFor convenience, two further datum planes can be created to reflect the amount of material that must be cut away from the sides of the bearing holder. They are offset +22 and -22 from the XY-plane.\n\nIt is advisable to give clear names to the skeleton geometry. Most of the time, you will want to turn off visibility for datum planes because they clutter up the screen, and if the planes have self-explanatory names you can just pick them by name instead of from the screen.\n\n## The solid geometry \n\n\"Sketch Now its time to start creating some real geometry. The sketch for the first pad is shown on the right. It is placed on the XY-plane. There are just three dimensions: The inner radius (22.5mm), the machining allowance (3mm) at the base as an offset to the XZ-plane and the distance from the datum plane representing the bolt axis (7mm). This means that if you later move the datum plane, the pad will automatically adjust its outer radius. Remember that before you can use the datum plane for dimensioning, you need to introduce it as external geometry to the sketcher.\n\nYou are probably wondering why there is a small straight segment at the bottom of each arc. This segment ensures that there will be a draft angle of 2 degrees on the arcs. This might look like a lot of work for a very small benefit, but many CAD programs (and maybe FreeCAD one day) have tools that highlight a solid model in different colours and immediately show you all faces where the draft angle is not correct. You don\\'t want that to happen to your model, especially after putting on a lot of fillets!\n\nWhen you have done the sketch (which is a bit tricky because of the 2 degree tangential lines), just pad it symmetrically to the sketch plane with a length of 62mm: 34mm for the bearing, 2x 9mm for the sealing rings, 2x 5mm for the wall thickness.\n\"Sketch Next we want to cut away some material where the sealing rings are, because their outer diameter is much less than the bearing\\'s. The easiest way to create the sketches is to select the sketch of the pad and then choose \\\"Duplicate selection\\\" from the edit menu. You can then remap the sketch to the side of the pad, and modify it as shown in the picture.\n\nThe only two important dimensions in the sketch are 3mm of machining allowance at the bottom, and a inner diameter of 78mm: 68mm for the outer diameter of the sealing ring + 2x 5mm wall thickness. Since the sealing ring on the other side will only have a diameter of 55mm, the cut-out can be 65mm here.\n\nAfter you have created the sketch, pocket it up to the datum plane marking the bearing side plus 5mm wall thickness. If you ever want to modify the holder to be able to hold wider bearings, all you have to do is to change the dimension of these datum planes, and the cut-out depth will follow along.\n\"Sketch To reduce the amount of machining required, we also want to cut away some material inside the holder. Again, duplicating the sketch of the first pad is convenient. It doesn\\'t even have to be remapped. Again, the only important dimensions are the machining allowance (3mm) and the outer diameters: 84mm for the place where the bearing will be (90mm - 2x machining allowance), 49mm for the smaller sealing ring (55mm - 2x 3mm) and 62mm for the larger sealing ring.\n\nAfter creating the sketches, pocket them: Symetrically 28mm for the bearing cut-out (34mm - 2x machining allowance) and one-sided 23mm for the cut-outs for the sealing rings: 34mm / 2 for half the bearing width + 9mm for the sealing rings - 3mm machining allowance.\n\"Main Your part should now look like the picture on the right. Note how the different cut-aways combine to create an almost uniform wall thickness, which will make the casting easier and less liable to have pores.\n\"Sketch Now all that remains is to create some material for the bolts to go through. You might be tempted to sketch these as a circle and then pad them, but this will head you for trouble when you try to put the draft onto them later (I assume that is a weakness of OpenCascade). So to circumvent the problems, it is better to create a sketch with the draft angle included and then rotate it through 360 degrees.\n\nHere again the skeleton planes come in useful. You will need the bolt axis plane and the bolt head plane as external geometry. Then, create a straight line for the rotation axis and make sure it is constrained to the bolt axis plane reference. Toggle it to be construction geometry. Then, sketch the rest of the contour. The important dimensions are the machining allowance at the top and bottom and the radius of 12mm: 7mm for the hole radius + 5mm wall thickness.\n\"Finished Create a revolution feature from the sketch and then mirror it on the YZ-plane. This is all the solid geometry we need to model. The rest is draft and fillets.\n\n## Applying draft to the side faces \n\n\"The The next step is to apply drafts on all faces. Its important to consider the location of the neutral plane, that is, the plane which the face is \\\"rotated\\\" around. If we choose as neutral plane the bottom of the holder, then we will have a problem with the wall thickness in the top part of the holder. Therefore, we create a datum plane at an offset of 40mm from the XZ plane as a compromise between the top of the holder becoming to thin and the bottom becoming to wide.\n\"Applying To put draft on a face, select this face and create the draft feature. You can then select more faces to apply the draft on. If you have a large part, it is advisable to draft only one face at a time. This means that if you change the geometry and a draft fails, only this one feature will fail, whereas if you put all faces in one draft feature, then the whole feature might fail because of one face failing. For a small part like the bearing holder, its sufficient to create two draft features: One for the four outside faces, and one for the inside faces.\n\nThe dialog will force you to select a neutral plane before completing. You can leave the pull direction empty, in this case it will be normal to the neutral plane. Don\\'t forget to set the draft angle to 2 degrees.\n\n## Filleting the holder \n\n\"Fillet We can now fillet the part. The picture shows the first set of fillets. Start with the small circular fillets and make them 4mm radius. Even though 3mm would be enough as per specification of the part, a radius of 4mm means that after machining 1mm of the fillet is left, reducing the sharp edge produced by the machining. The large fillets are 6mm radius to help spread the force from the bolts into the rest of the part. It would be nice to make this radius even larger, but unfortunately OpenCascade can\\'t handle overlapping fillets yet.\n\nAs with drafts, in a complex part you should fillet only one edge at a time to avoid unnecessary failures if the base geometry changes.\n\"Filleting The rest of the fillets are simply 3mm radius. Looking at the picture on the right, the two highlighted fillets could actually be filleted with 5mm to achieve a more uniform wall thickness for the casting. After machining, the minimum wall thickness of 5mm would still be maintained. But again the fact that OpenCascade can\\'t handle overlapping fillets prevents us from doing this for the inner of the two highlighted fillets.\n\"Filleting Filleting the inside of the part presents us with a difficulty that cannot be solved with the current tools in the PartDesign workbench. The highlighted edge cannot be filleted at all, again because the rounds would overlap. This could be worked around by creating a sweep instead of a fillet, except that sweeps are not implemented in PartDesign yet. For the time being, we are forced to leave the edge as it is.\n\"The The picture on the right shows the finished part in the state it will be before machining (except for the one edge that is impossible to fillet). You will notice that one edge that runs around the whole part has been left unfilleted on purpose. This is the edge where the bottom and the top of the mould meet. Here, no fillet is possible (and none is required anyway).\n\n## Machining\n\n\"Machining \"Machining Now we can cut away the material that will be machined off the raw cast part. This is very easy with the skeleton geometry defined. The idea is to create all machining features (Pockets and Grooves) using datum features only. This means they will be totally independent of the solid geometry of the bearing holder, which gives us some big advantages:\n\n- No matter how you change the solid geometry, the features for the machining can never fail.\n- You can create the machining geometry before finalizing the solid, which gives you useful visual feedback.\n- If you move the skeleton datum planes, then both the solid geometry and the machining will adapt automatically.\n- If you make a mistake in your solid geometry, the machining will still be in the correct position, and very likely the mistake will become glaringly obvious (e.g. a wall thickness becoming 2mm instead of 5mm). Whereas if you reference the machining to the solid geometry, it will adapt to the error in the solid and e.g. maintain the 5mm wall thickness, just in the same wrong location as the solid is.\n\nBefore starting on the machining geometry, I like to place a datum point in the tree and name it something like \\\"Machining_starts_here\\\". This is useful if you want to switch between the raw and the machined state of the part because you can see at a glance where to move the insert point to get the raw state.\n\nTo machine the bottom of the holder, just sketch a large rectangle on the XZ plane and pocket it. For the top, sketch a circle on the datum plane defining the bolt head location, and then mirror the pocket on the YZ plane. In the same way, create a pocket for the hole which the bolt will go through and mirror it. To machine the inside of the holder, create a sketch on the YZ plane and groove it.\n\"Finished Once you have done the machining, you can have a nice visual effect by colouring all the machined faces so that you can see at one glance which parts are raw casting and which are machined after casting.\n\n## Final notes \n\nWe have modelled the bearing holder top with the dimensions it will have after casting. To create the casting mould, you need to apply shrinkage to your part because after casting, when the hot metal cools down, it will shrink by a few percent (depending on the material). Usually it is best to leave the application of shrinkage to the foundry making the part because they have the required special knowledge. They should also tell you if your part has problematic areas, e.g. very thick walls suddenly joining to very thin sections without a properly tapered section between them.\n\n## Part Two \n\n[PartDesign Bearingholder Tutorial II](PartDesign_Bearingholder_Tutorial_II.md)\n\n\n---\n⏵ [documentation index](../README.md) > [Tutorials](Category_Tutorials.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign Bearingholder Tutorial I/en\n"} {"id": "freecad-docs:wiki/translations/en/PartDesign_Draft.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/PartDesign_Draft.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/PartDesign_Draft.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8b4a362e1b0501ab4e325f577f18d31cb72016e5abb3593d64e42bfbcff03d62", "bytes": 5539, "tokens": 1608, "text": "---\n GuiCommand:\n Name: PartDesign Draft\n MenuLocation: Part Design , Apply a dress-up feature , Draft\n Workbenches: PartDesign_Workbench\n---\n\n# PartDesign Draft/en\n\n## Description\n\nThe \"\" **PartDesign Draft** tool creates angular draft on the selected faces of an object. It adds a **Draft** object to the document with its corresponding representation in the [Tree view](Tree_view.md).\n\n --\n ![Select one or more faces of the object before starting the tool. Here, 2 faces have been selected.](images/PartDesign_Draft-01.png ) ![Showing Draft Parameters in TaskPanel.](images/PartDesign_Draft-02.png ) ![2 faces have been added, and a 10 deg. draft applied. The bottom plane has remained dimensionally stable, while the draft has made the top plane smaller.](images/PartDesign_Draft-03.png ) ![The Neutral Plane has been changed to the top. Now, the top plane has stayed dimensionally stable, while the draft has made the bottom plane larger.](images/PartDesign_Draft-04.png ) ![Pull direction is set to the lower right edge, resulting in the draft pulling to the left.](images/PartDesign_Draft-05.png ) ![Checking the Reverse Direction box has applied an inward draft rather than outward.](images/PartDesign_Draft-06.png ) \n --\n\n\n## Usage\n\n### Add a draft \n\n1. Optionally [activate](PartDesign_Body#Active_status.md) the Body to apply the Draft to.\n2. Select one or more faces of the Body.\n3. There are several ways to invoke the tool:\n - Press the ** [Draft](PartDesign_Draft.md)** button.\n - Select the **Part Design → Apply a dress-up feature → Draft** option from the menu.\n4. If there is no active Body, and there are two or more Bodies in the document, the **Active Body Required** dialog will open and prompt you to activate one. If there is a single Body it will be activated automatically.\n5. The **Draft parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n6. Press the **OK** button to finish.\n\n: *Remember*:\n - Since there must be at least one face for the feature, the last remaining face in the list cannot be removed.\n\n### Edit a draft \n\n1. Do one of the following:\n - Double-click the Draft object in the [Tree view](Tree_view.md).\n - Right-click the Draft object in the [Tree view](Tree_view.md) and select **Edit Draft** from the context menu.\n2. The **Draft parameters** [task panel](Task_panel.md) opens. See [Options](#Options.md) for more information.\n3. Press the **OK** button to finish.\n\n## Options\n\n- **Add face**: Add faces to the selection by pressing the **Add face** button and selecting more faces.\n\n- **Remove face**: Choose a way to remove faces from the selection:\n\n - Select one or more faces in the list and press the **Del** key or right-click the list and select **Remove** from the context menu.\n - Press the **Remove face** button. All previously selected faces are highlighted in purple. Select each face to be removed.\n\n- **Draft angle**: Set the Draft angle either by entering a value or by clicking the up/down arrows.\n\n- **Neutral plane**: Set the the neutral plane by pressing the **Neutral plane** button and selecting the plane that must not change dimensionally.\n\n- **Pull direction**: Set the the pull direction by pressing the **Pull direction** button, then select an edge. Pull Direction is only effective if the Neutral Plane has been set. Results can be unpredictable.\n\n- **Reverse pull direction**: Invert the pull direction by checking the **Reverse pull direction** checkbox. This will toggle the draft between positive and negative angles.\n\n## Notes\n\n- The Draft tool will only work on faces that are not tangentially connected to other faces. A common mistake is to attempt to apply draft to a face that already has a fillet applied to it. To solve this, remove the fillet, apply the draft as needed, then re-apply the fillet.\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA PartDesign Draft object is derived from a [Part Feature](Part_Feature.md) object and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{Properties_Title|Base}}\n\n- **Angle|Angle**: Cannot be negative. Default: {{value|1.5 °}}.\n\n- **Reversed|Bool**: Default: `False`.\n\n- **Base|LinkSub**: Sub-link to the parent feature\\'s list of selected edges and faces.\n\n- **Support Transform|Bool**: Include the base additive/subtractive shape when used in pattern features. If disabled, only the dressed part of the shape is used for patterning. Default: `False`.\n\n- **Add Sub Shape|PartShape|hidden**\n \n\n- **Base Feature|Link|hidden**: Link to the parent feature.\n\n- **_ Body|LinkHidden|hidden**: Link to the parent body.\n\n\n{{Properties_Title|Draft}}\n\n- **Neutral Plane|LinkSub**: Sub-link to the parent feature\\'s list containing the neutral plane.\n\n- **Pull Direction|LinkSub**\n \n\n\n{{Properties_Title|Part Design}}\n\n- **Refine|Bool**: Refine shape (clean up redundant edges) after adding/subtracting. The default value is determined by the **Automatically refine model after sketch-based operation** preference. See [PartDesign Preferences](PartDesign_Preferences#General.md).\n\n\n{{PartDesign Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [PartDesign](PartDesign_Workbench.md) > PartDesign Draft/en\n"} {"id": "freecad-docs:wiki/translations/en/Part_Boolean.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Part_Boolean.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Part_Boolean.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "db1de703f2de73675ac792e0f7df42f32b6634afa0aaf0651ad7098dc33f4c5f", "bytes": 3086, "tokens": 991, "text": "---\n GuiCommand:\n Name: Part Boolean\n MenuLocation: Part , Boolean , Boolean...\n Workbenches: Part_Workbench\n SeeAlso: Part_Cut, Part_Fuse, Part_Common, Part_Section\n---\n\n# Part Boolean/en\n\n## Description\n\n\n**[ [Part Boolean](Part_Boolean.md)**\n\nis a generic all-in-one boolean tool. It allows you to specify the objects and operation to perform via a single dialog.\n\nFor quicker access to these operations, use **[ [Part Cut](Part_Cut.md)**, **[ [Part Fuse](Part_Fuse.md)**, **[ [Part Common](Part_Common.md)** and **[ [Part Section](Part_Section.md)**.\n\n![](images/PartBooleansDialog.png )\n\n\n*Dialog to select objects and perform boolean operations with them.*\n\n## Usage\n\nSee the individual commands:\n\n- ** [Part Cut](Part_Cut.md)\n**\n \n\n- ** [Part Fuse](Part_Fuse.md)\n**\n \n\n- ** [Part Common](Part_Common.md)\n**\n \n\n- ** [Part Section](Part_Section.md)\n**\n \n\n## Coplanar problems \n\nThe boolean operations are performed by the internal geometry kernel, [OpenCASCADE Technology](OpenCASCADE.md) (OCCT). This library sometimes has problems producing boolean results when the input objects share an edge or a face. To be sure the boolean operation is successful the recommendation is that the shapes intersect each other clearly; this means that in most cases, one shape should protrude or be larger in size than the other shape.\n\nIn cases of coplanarity, even if the first boolean operation succeeds, subsequent boolean operations may fail. In this case, the problem may not be in the last operation done, but in the older ones, that is, in the nested operations as indicated in the [tree view](Tree_view.md). To troubleshoot these issues, it is recommended to use the **[ [Part CheckGeometry](Part_CheckGeometry.md)** tool to inspect all objects for problems.\n\n\"\"\n\n\"\"\n\n\n*Left: shapes that share a face, a boolean cut may produce incorrect results. Right: shapes that intersect each other clearly, the boolean cut will be successful in most cases.*\n\n\"\"\n\n\"\"\n\n\n*Left: shapes that share a face, a boolean union may produce incorrect results. Right: shapes that intersect each other clearly, the boolean union will be successful in most cases.*\n\n\n{{Part_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part Boolean/en\n"} {"id": "freecad-docs:wiki/translations/en/Part_BoxSelection.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Part_BoxSelection.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Part_BoxSelection.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "75416a4e39ce81341aa355b884c10d48d5ddd8a3439476142163c98066ea1ae6", "bytes": 865, "tokens": 290, "text": "---\n GuiCommand:\n Name: Part BoxSelection\n MenuLocation: Part , Box selection\n Workbenches: Part_Workbench\n Version: 0.18\n SeeAlso: Std_BoxSelection, Std_BoxElementSelection\n---\n\n# Part BoxSelection/en\n\n## Description\n\nThe \"\" **Part BoxSelection** command selects faces from a user defined rectangular area, a box, in the [3D view](3D_view.md).\n\n## Usage\n\n1. Select the **Edit → Box selection** option from the menu.\n2. Drag a rectangle to select faces that are (partially) inside the rectangle, or touched by it.\n\n## Notes\n\n- To box select whole objects use [Std BoxSelection](Std_BoxSelection.md) instead.\n\n\n{{Part_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part BoxSelection/en\n"} {"id": "freecad-docs:wiki/translations/en/Part_Offset2D.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Part_Offset2D.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Part_Offset2D.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d4abb73b916c3a1bb0a2c49b3c5a02679292a9805fd12497a767460e734602e3", "bytes": 5138, "tokens": 1624, "text": "---\n GuiCommand:\n Name: Part Offset2D\n MenuLocation: Part , 2D Offset\n Workbenches: Part_Workbench\n Version: 0.17\n SeeAlso: Part_Offset, Part_Thickness, Draft_Offset\n---\n\n# Part Offset2D/en\n\n## Description\n\nThe \"\" **Part Offset2D** tool constructs a wire, parallel to the original wire, at a certain distance from it. Or enlarges/shrinks a planar face, similarly.\n\nThe wire/face must be planar. There can be multiple wires in one object, not necessarily coplanar.\n\n![600px](images/Part_Offset2D_Demo.png)\n\n## Usage\n\n1. Select an object to offset.\n2. Press the ** [2D Offset](Part_Offset2D.md)** button.\n3. Set up the offset in the [Task Panel](Task_panel.md).\n4. Press **OK**.\n\n## Notes\n\n- [App Link](App_Link.md) objects linked to the appropriate object types and [App Part](App_Part.md) containers with the appropriate visible objects inside can also be used as source objects. (v0.20) \n\n## Known issues \n\n- Most of non-default modes will only work with OCC 7.0.0 or later.\n\n- Using the tool can crash FreeCAD (see next point). On Windows, these crashes are converted to exceptions and don\\'t generally cause FreeCAD to close; on other OS\\'es it is not the case, so it is advisable to save project before attempting to use the tool. Ellipses are not handled either.\n\n- Enlarging faces with circular holes by an amount large enough to cause holes to close up, a crash occurs (OCC 7.0.0). The problem seems to be specific to circles; other shapes seem to close out properly.\n\n- When offsetting circles that have non-zero Placement, the result is placed wrongly. (OCC 7.0.0)\n\n- When offsetting circles, sometimes they are offset in unexpected direction (e.g. inward instead of outward). (OCC 7.0.0)\n\n- Fill=\\\"true\\\" doesn\\'t work when collectively offsetting open wires in \\\"Skin\\\" mode\n\n- \\\"Tangent\\\" join mode doesn\\'t work (OCC 7.0.0)\n\n- Offsetting wires made of single line segment is not supported (because line segment doesn\\'t define a plane). Single line segments cannot participate in collective offset either.\n\n## Properties\n\n- **Source**: Link to original shape\n\n- **Value**: The distance to enlarge the wire/face by. If negative, the wire/face is shrunk instead.\n\n- **Mode**(\\\"Pipe\\\" or \\\"Skin\\\"): sets how non-closed wires are processed. If \\\"Pipe\\\", the wire is outlined as if it was an extremely thin closed contour. If \\\"Skin\\\", an open wire is created.\n\n: ![600px](images/Part_Offset2D_Mode.png)\n\n- **Join**(\\\"Arc\\\", \\\"Tangent\\\", \\\"Intersection\\\"): sets the behavior around kinks. If \\\"Arc\\\", offset segments are connected with an arc of circle, centered at the vertex. \\\"Tangent\\\" is unsupported on OCC7.0.0. \\\"Intersection\\\": offset segments are extended till they intersect.\n\n: ![600px](images/Part_Offset2D_Join.png)\n\n- **Intersection**(\\\"false\\\", \\\"true\\\"): sets if multiple wires are treated collectively or independently. If \\\"false\\\", wires are offset independently, intersections between resulting wires are ignored. If \\\"true\\\", the wires are offset in collective manner.\n\n: ![600px](images/Part_Offset2D_Intersection.png)\n\n\n: Only wires within a compound are coupled. For example, if the structure is like compound(wire1, wire2, compound(wire3, wire4)), wire1 and wire2 will be treated collectively, but independently from wire3 and wire4. Likewise, wire3 and wire4 are treated collectively, but independently of wire1+wire2.\n\n\n: Also, in collective mode, directions of wires are important, and influence direction of offset. This is in tight relationship with how holes in faces are treated.\n\n\n: Wires being treated collectively must be coplanar. Wires being offset independently don\\'t have to be coplanar.\n\n- **Fill**(\\\"false\\\", \\\"true\\\"): if \\\"true\\\", the space between original wire/face and the offset is filled with a face.\n\n: ![600px](images/Part_Offset2D_Fill.png)\n\n## Scripting\n\nThe tool can by used in [macros](Macros.md) and from the [Python](Python.md) console by using the following function: {{code|code=\nf = App.ActiveDocument.addObject(\"Part::Offset2D\", \"Offset2D\")\nf.Source = #some object\nf.Value = 10.0\n}}\n\n2D offset is also available as a method of Part.Shape. Example: {{code|code=\nimport Part\ncircle = Part.Circle().toShape()\nenlarged_circle = circle.makeOffset2D(10.0)\nPart.show(circle)\nPart.show(enlarged_circle)\n# makeOffset2D(offset, join = 0, fill = False, openResult = false, intersection = false)\n# \n# * offset: distance to expand the shape by. \n# \n# * join: method of offsetting non-tangent joints. 0 = arcs, 1 = tangent, 2 =\n# intersection\n# \n# * fill: if true, the output is a face filling the space covered by offset. If\n# false, the output is a wire/face.\n# \n# * openResult: True for \"Skin\" mode; False for Pipe mode. \n# \n# * intersection: collective offset\n# \n# Returns: result of offsetting (wire or face or compound of those). Compounding\n# structure follows that of source shape.\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part Offset2D/en\n"} {"id": "freecad-docs:wiki/translations/en/Part_PointsFromMesh.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Part_PointsFromMesh.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Part_PointsFromMesh.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "bc48d3699c11d11910a79671a2e2688704ffc48731d95d6a4ef4b909b8c5012e", "bytes": 1381, "tokens": 447, "text": "---\n GuiCommand:\n Name: Part PointsFromMesh‎\n MenuLocation: Part , Create points object from geometry\n Workbenches: Part_Workbench\n Version: 0.19\n SeeAlso: Part_ShapeFromMesh, Part_MakeSolid, Part_RefineShape\n---\n\n# Part PointsFromMesh/en\n\n## Description\n\nThe \"\" **Part PointsFromMesh** command creates points objects from geometric objects.\n\nThe resulting shapes are compounds of vertices, which can be used as reference to further create lines, sketches and faces with other commands, like those from the \"\" [Sketcher](Sketcher_Workbench.md) or the \"\" [Draft](Draft_Workbench.md) workbenches.\n\n## Usage\n\n1. Select one or more objects.\n2. Select the **Part → Create points object from geometry** option from the menu.\n3. The **Distance in parameter space** dialog opens.\n4. Enter a distance value.\n5. Press the **OK** button.\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nThe created objects are [Part Feature](Part_Feature.md) objects with no additional properties.\n\n\n{{Part_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part PointsFromMesh/en\n"} {"id": "freecad-docs:wiki/translations/en/Part_SelectFilter.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Part_SelectFilter.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Part_SelectFilter.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "44b1c3bedefa0536e707c4e8d965b238778a5c7ce56f890f5103a4b31fa3752a", "bytes": 2467, "tokens": 762, "text": "---\n GuiCommand:\n Name: Part SelectFilter\n Workbenches: All\n Shortcut: **X** **S** / **E** **S** / **F** **S** / **C** **S**\n Version: 1.0\n---\n\n# Part SelectFilter/en\n\n## Description\n\nThe **Part SelectFilter** command can be used to restrict selection in the [3D view](3D_view.md) to vertices, edges or faces, or to remove that restriction.\n\n## Usage\n\n### \"\" Vertex selection \n\n1. This option only allows the selection of vertices.\n2. There are several ways to invoke this option:\n - Click on the black down arrow to the right of the **** button in the toolbar and select the ** Vertex selection** option from the flyout. Note: the button image will change depending on the selected option.\n - Use the keyboard shortcut: **X** then **S**.\n\n### \"\" Edge selection \n\n1. This option only allows the selection of edges.\n2. There are several ways to invoke this option:\n - Select the ** Edge selection** option from the toolbar. See above.\n - Use the keyboard shortcut: **E** then **S**.\n\n### \"\" Face selection \n\n1. This option only allows the selection of faces.\n2. There are several ways to invoke this option:\n - Select the ** Face selection** option from the toolbar. See above.\n - Use the keyboard shortcut: **F** then **S**.\n\n### \"\" All selection filters cleared \n\n1. This option allows the selection of all subelements and of whole objects.\n2. There are several ways to invoke this option:\n - Select the ** All selection filters cleared** option from the toolbar. See above.\n - Use the keyboard shortcut: **C** then **S**.\n\n## Notes\n\n- Selecting from the [Tree view](Tree_view.md) is impossible with the vertex, edge and face selection options.\n- The vertex, edge and face selection options do not work together with [Std BoxSelection](Std_BoxSelection.md) or [Std BoxElementSelection](Std_BoxElementSelection.md).\n\n\n---\n⏵ [documentation index](../README.md) > [Part](Part_Workbench.md) > Part SelectFilter/en\n"} {"id": "freecad-docs:wiki/translations/en/Path_DressupRampEntry.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Path_DressupRampEntry.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Path_DressupRampEntry.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "83d14b720d4fbb73b688b2f46b1c3e7cffb9d8240c0edfd78e978eaf3df96115", "bytes": 168, "tokens": 79, "text": "# Path DressupRampEntry/en\n1. REDIRECT [CAM_DressupRampEntry/en](CAM_DressupRampEntry/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > Path DressupRampEntry/en\n"} {"id": "freecad-docs:wiki/translations/en/Path_ToolBit.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Path_ToolBit.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Path_ToolBit.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "99b04aec810202e8346a17833791e7514e9419022e21482b84243e48ae8528da", "bytes": 132, "tokens": 61, "text": "# Path ToolBit/en\n1. REDIRECT [CAM_ToolBit/en](CAM_ToolBit/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > Path ToolBit/en\n"} {"id": "freecad-docs:wiki/translations/en/Placement_API.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Placement_API.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Placement_API.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "386cd63587fcf8c3ba174b1df8e6c8e03776fd6f5956ed88dd3007d694ca293e", "bytes": 1590, "tokens": 496, "text": "# Placement API/en\n**(October 2019) Do not edit this page. The information is incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation], or generate the documentation yourself, see [Source documentation](Source_documentation.md).**\n\nIn FreeCAD, Placement defines an object\\'s position and rotation. The Placement concept is explained in detail here: [Placement](Placement.md).\n\nExample of setting a document object\\'s Placement: \n```python\nmyObj = FreeCAD.ActiveDocument.ActiveObject\npl = FreeCAD.Placement()\npl.move(FreeCAD.Vector(2,0,0))\nmyObj.Placement = pl\n```\n\n\n{{APIClass|Placement| ) or (Placement) or (Matrix) or (Base, Rotation) or (Base,Rotation,Center) or (Base,Axis,Angle|Constructs a placement, empty or with the given arguments, or as a copy of the given placement.}}\n\n\n{{APIProperty|Base|a vector representing the Placement's position.}}\n\n\n{{APIProperty|Rotation|a quaternion representing the Placement's rotation.}}\n\n\n{{APIFunction|inverse| |computes the inverse placement|a placement.}}\n\n\n{{APIFunction|move|Vector|moves the Placement along the given vector|nothing}}\n\n\n{{APIFunction|multVec|Vector|applies the Placement to the given vector|the resulting vector.}}\n\n\n{{APIFunction|multiply|Placement|multiplies this placement with another one|the resulting placement.}}\n\n\n{{APIFunction|toMatrix| | |a matrix representing the Placement's transformation.}}\n\n\n---\n⏵ [documentation index](../README.md) > [API](Category_API.md) > [Poweruser Documentation](Category_Poweruser%20Documentation.md) > Placement API/en\n"} {"id": "freecad-docs:wiki/translations/en/Release_notes_0.18.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Release_notes_0.18.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Release_notes_0.18.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "973051a588a769089e6841eeadda7a9d00a82115976c741d2c11513d48fd74e8", "bytes": 15428, "tokens": 4513, "text": "# Release notes 0.18/en\nFreeCAD 0.18 was released on 12 March, 2019, get it from [GitHub](https://github.com/FreeCAD/FreeCAD/releases/tag/0.18.3). The complete list of changes can be found in the [MantisBT bugtracker FC 0.18 changelog](https://www.freecadweb.org/tracker/changelog_page.php?version_id=78).\n\nOlder FreeCAD release notes can be found in [Feature list](Feature_list#Release_notes.md).\n\n## Highlights\n\nExtended [TechDraw](#TechDraw_Workbench.md) tools\n\n\"Model\n\n\nNew [sketcher](#Sketcher_Workbench.md) tools, more stable and robust [PartDesign](#PartDesign_Workbench.md)\n\n\"Model\n\n\nEnhanced and extended [Arch and BIM](#Arch_Workbench.md) tools\n\n\"Model\n\n\n## General\n\n- Redesigned Start center\n- The Document tree (Model tab) now offers 3 options for how all documents are displayed, with the option set from the menu **View → Document Tree** :\n - Single Document (Only display the currently active document)\n - Multi Document (Display all documents as it used to be up to FreeCAD 0.17)\n - Collapse/Expand (Expand the active document and collapse all others)\n- When a task is active and requires user input, an icon showing a pencil now appears on the Tasks tab and disappears when the task is completed.\n- The 3D view now benefits from a new **[Navigation Cube](Navigation_Cube.md)** to quickly orientate the view. It also has a small menu to set the projection to orthographic or perspective, as well as to fit the content to the view. The placement of the navigation cube can be set in **Preferences → Display → 3D View** and it can also be hidden.\n- Generic support for US Civil / Transportation Engineering units has been added. These units include ft, ft\\^2, ft\\^3, mph, and angles as degrees/minutes/seconds. These units allow for expression of feet in decimal form, as opposed to US Building, which forces fractions of inches.\n- It is now possible to specify a custom background image for FreeCAD\\'s main window using the option [**Preferences → General → Enable tiled background**](Preferences_Editor#General.md).\n\n center 0.18 screenshot.jpg\\|thumb\\|left\\|The redesigned Start center Navigation Cube.png\\|thumb\\|left\\|The navigation cube with background image.jpg\\|thumb\\|left\\|FreeCAD with a custom background image\n\n\n## Arch Workbench \n\n\"The\n\n- [Walls](Arch_Wall.md) can now be displayed as a stack of blocks. There are many options to configure their size and how blocks must be stacked.\n- [Building Parts](Arch_BuildingPart.md) are the new use-for-all Arch container. They can group any number of objects, they can be used to make floors (storeys), buildings (the [Arch Floor](Arch_Floor.md) and [Arch Building](Arch_Building.md) tools now produce Building Parts), or any other group of Arch objects. They can be moved like [Parts](Std_Part.md), and they are [clonable](Draft_Clone.md) and [referencable](Arch_Reference.md)!\n- The [BIM Workbench](BIM_Workbench.md) (added via the [Addon Manager](Std_AddonMgr.md)), is a new external, experimental counterpart of [Arch](Arch_Workbench.md). In it, we test new features and workflows in a more free environment. Be sure to give it a test ride!\n- [Windows](Arch_Window.md) have new presets such as a 4-pane sliding window, plus, if the [Parts Library](https://github.com/FreeCAD/FreeCAD-library/tree/c5eea12cdda7a3e6349323808815f63b0f97ef2e) is installed, all the doors and windows from the library.\n- [Panels](Arch_Panel.md) can now do different kinds of corrugated panels, such as undulated sheets, or even sandwich panels.\n- [Structure](Arch_Structure.md) objects have a new beam drawing mode, which allow you to click two points to place a structural element between them.\n- All IFC types are now available for all Arch objects. Any object can be exported to any other type to IFC.\n- [Window placement](Arch_Window.md) has been fully redesigned. Correctly placing windows in host objects, which was before a real pain to do is now much easier.\n- Dynamic window parameters: The size of the window frames is now a window property, so it is now possible to adjust the thickness of preset windows without the need to edit their components or base sketches.\n- IFC Property Sets are now supported by all Arch objects.\n- The IFC importer and exporter have been greatly enhanced with a wealth of new features: Property sets support, grid support, file compression, shared profiles, groups support, quantity sets, etc\\...\n- [Materials](Arch_SetMaterial.md) now support hierarchy, if you give a material another material as father, they appear correctly stacked in the tree.\n- All Arch objects and materials now support classification systems (not yet supported by IFC import/export).\n- [External references](Arch_Reference.md) now allow you to link parts from another FreeCAD file into a FreeCAD file.\n\n- But there is much more! Check the [Arch/BIM development reports](https://github.com/yorikvanhavre/BIM_Workbench/wiki) to see everything that has been done there this year.\n\n## Draft Workbench \n\n\"More\n\n- The [Draft Scale](Draft_Scale.md) tool has been fully redesigned, and has now more options and is much more comfortable to use\n- The [Draft Text](Draft_Text.md) tool has also been fully redesigned, it now has its own parametric object with many more options. Warning, these new texts are not supported by 0.17\n- [Draft Wires](Draft_Wire.md) now have a right-click option that allows to force-flatten them on their median plane\n- New [Draft Join](Draft_Join.md) tool, which allows you to join individual wires and lines into a single wire\n- New [Draft Split](Draft_Split.md) tool, which splits a line or a wire at a point to create another wire or line\n- Pressing the **** key while drawing in draft mode cycles the snapping object target, allowing you to snap on objects that are obscured by others\n- The Draft AddPoint tool has been improved to more reliably add nodes on lines and wires exactly where you click\n\n\n## FEM Workbench \n\n\"The In 0.17, tons of new features were added to FEM. Thus, the main focus for FEM in the 0.18 release of FreeCAD was not adding even more new features and tools, but making the existing ones more stable and fixing as many bugs as possible. FEM got 470 commits during FreeCAD 0.18 development cycle [1](https://forum.freecadweb.org/viewtopic.php?f=10&t=13154&p=297292#p297110).\n\n### General Improvements on the code base \n\n- Tons of bug fixes.\n- Code refactoring and cleaning. Get rid of duplicate code.\n- Fix a lot of typos in code and visible messages.\n- Python 3 compatibility fixes.\n- More unit tests were added.\n- Possibility to compile FreeCAD with external up-to-date SMESH.\n\n### Tools\n\n- A clipping plane tool was added to be able to select solids that are inside other solids.\n- The VTK warp filter got some love.\n- An analysis type for CalculiX model checking was added.\n\n### Material\n\nThe material handling was improved. It is now possible to use the global FreeCAD material editor. See also [material cards](Release_notes_0.18#Material_Handling.md). For this the the FEM material task panel was polished.\n\n## Part Workbench \n\n- The [Check Geometry](Part_CheckGeometry.md) tool now opens a small window with a progress bar and a **Cancel** button to end the task if it takes too long.\n- The new [Defeaturing](Defeaturing_Workbench.md) tool is based on the tool of the same name included in OCCT 7.3.0. It can remove selected attributes on a solid such as holes, protrusions, gaps, chamfers, fillets, etc. For more info, see [3D Model Defeaturing](https://dev.opencascade.org/index.php?q=node/1211) article on the OCCT website. Please note that if FreeCAD is built on an older version that OCCT 7.3.0, this tool won\\'t be available and will be greyed out.\n\n- The new [SliceApart](Part_SliceApart.md) tool is based on the [Slice to Compound](Part_Slice.md) and includes an automatic compound explode for easily splitting objects.\n\n## PartDesign Workbench \n\n- The new [Local Coordinate System](PartDesign_CoordinateSystem.md) tool now allows the addition of a local coordinate system visualization to several datum objects.\n\n## Path Workbench \n\n### General Improvements \n\n- Path can now correctly display gcode with ABC axis words\n- Improvements to Tool editor -- Simplified edit for selective tool types\n\n### Job Improvements \n\n- Jobs can now have multiple base objects\n- Job container organisation has been improved\n- Default Values for Operation Settings can be controlled through SetupSheets\n\n### Operations\n\n- New Adaptive Clearing Operation\n- New Deburr Operaton\n- new AxisMap dressup does limited 4th axis by mapping a linear direction to a rotary axis\n- Support for 2D objects and individual edge milling through Engrave and Deburr\n- RampEntry dressup now has a configurable start point\n- PocketShape Operation can now \\'use outline\\'\n\n### Post Processors \n\n- grbl_post -- argument to suppress tool change commands\n- grbl_g81 post processor\n\n## Sketcher Workbench \n\n\"Sketcher\n\n- The new **[View section](Sketcher_ViewSection.md)** tool creates a section plane that removes matter on the model that is in front of the sketch plane. This can be useful when the sketch plane is located inside a solid model. Pressing the View section tool again toggles the view back to a full view.\n- The **Sketcher solver** benefited from improvements and is now better at detecting redundant and conflicting constraints, especially those induced by symmetric constraints.\n- New **[Constrain Diameter](Sketcher_ConstrainDiameter.md)** tool added\n- **DoF Finder** is a new utility to help find degrees of freedom. In the Solver messages widget in the Tasks panel, the traditional message *Under-constrained sketch with x degrees of freedom* now underlines the *x degrees* text in blue. Clicking on it will highlight in green, in the 3D view, the elements that are not fully constrained.\n- **Sketcher Auto Remove Redundants** is a new checkbox in the Solver messages box. When enabled, it will prevent creation of redundant constraint when the user is sketching and applying constraints, and it will automatically delete the redundant constraints.\n- There is a new command to delete all constraints at once. It can be found in the menu **Sketch → Sketcher tools → Delete All Constraints**.\n- New option in **Preferences → Sketcher → General → Hide base length units for supported unit systems**. This hides the unit for dimensional constraints while in sketch editing mode.\n- Size of vertices (points) can now be set in **Preferences → Display → 3D View → Marker size**.\n- New **[Move](Sketcher_Move.md)** command to move all selected geometry from the last selected point. It can be access under the Clone tool drop down.\n- Added *Extended Information* checkbox to the Constraints list widget.\n\nRelevant forum links:\n\n- [Recent Several Sketcher improvements](https://forum.freecadweb.org/viewtopic.php?f=9&t=29192)\n- [Feature #1632: Allow entering of diameter instead of radius for circle radius constraint](https://forum.freecadweb.org/viewtopic.php?f=8&t=29152)\n- [Sketcher Auto Remove Redundants mode](https://forum.freecadweb.org/viewtopic.php?f=9&t=30594)\n- [Constraints extended naming](https://forum.freecadweb.org/viewtopic.php?f=10&t=28890)\n\n## Spreadsheet Workbench \n\n## Surface Workbench \n\n## TechDraw Workbench \n\nThe TechDraw Workbench received a number of additions and improvements for v0.18.\n\n- New export Page to Dxf\n- new tutorial for TechDraw\n- improved dimension formatting for isometric views, angles, text location\n- improved error messages\n- improved section view formatting\n- allow custom line groups\n- additional preferences\n- easier edge & center mark selection\n- view direction based on current 3d view or selected face\n- added +/\\* tolerances to dimensions\n- new 3 point angle dimension\n- RMB context menu\n- keyboard zooming (Ctl+/-)\n- support for DMS dimensions\n\n## Material Handling \n\n\"A The material handling has been improved. It is now possible to create **material cards** for every material. The cards can contain all information, physical properties, architectural specification, web links, comments. etc. The cards are text files with the file suffix **.FCMat** and can be used for all workbenches of FreeCAD.\n\nFreeCAD provides material cards for standard metals, plastics and different types of steel.\n\n## Additional Modules \n\nSome of the new community modules that were actively developed during the 0.18 development cycle.\n\n- [A2plus](A2plus_Workbench.md) is a new workbench to assemble different parts in FreeCAD. It is an extension of the Assembly2 workbench providing an extended color and transparency handling for parts and a new constraint using the center of mass of parts.\n\n- [Curves](https://github.com/tomate44/CurvesWB), a collection of tools to create and edit NURBS curves and surfaces.\n\n- [Nurbs](https://github.com/microelly2/freecad-nurbs), a collection of scripts for managing freeform surfaces and curves.\n\n- [Silk](https://github.com/edwardvmills/Silk), a collection of NURBS surface modeling tools focused on low degree and seam continuity.\n\n- [Flamingo Workbench](Flamingo_Workbench.md), a set of customized FreeCAD commands and objects that help to speed-up the drawing of frames and pipelines.\n\n- [Civil Engineering/Transportation Workbench](Civil_Engineering_Workbench.md)\n\n- [GDT](https://github.com/juanvanyo/FreeCAD-GDT), geometric dimensioning and tolerancing (GD&T).\n\n- [InventorLoader](https://github.com/jmplonka/InventorLoader) to import Autodesk Inventor files (in progress).\n\n- [Kicad StepUp Workbench](https://www.freecadweb.org/wiki/KicadStepUp_Workbench) is aimed to help KiCad and FreeCAD users in ECAD and MCAD collaboration.\n\n- [CadQuery FreeCAD Module](https://github.com/jmwright/cadquery-freecad-module/wiki) is a workbench that allows users to write Python scripts, and is tailored to those based on the CadQuery CAD scripting API. A new code editor is made available, and script variables can be edited dynamically through the use of a parameter dialog. The workbench also adds a menu that includes normal file operations for CadQuery scripts (open, new, close, etc), and example scripts to help users learn new concepts.\n\n- [Defeaturing Workbench](Defeaturing_Workbench.md) is intended for editing imported STEP models, removal of the selected features from the model.\n\n\n---\n⏵ [documentation index](../README.md) > [News](Category_News.md) > [Documentation](Category_Documentation.md) > [Releases](Category_Releases.md) > Release notes 0.18/en\n"} {"id": "freecad-docs:wiki/translations/en/Report_view.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Report_view.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Report_view.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2626930ee7f8944d365f700a303415c86be36ecf72c308d5331580062b09fd32", "bytes": 3306, "tokens": 891, "text": "# Report view/en\n## Introduction\n\nThe [Report view](Report_view.md) is a panel that shows text messages from FreeCAD processes and tools. It is available in the menu **{{StdMenu|[View](Std_View_Menu.md)** → Panels → Report view}}.\n\nCertain properties of this panel, like color of the text and whether to display it automatically on warnings or errors, can be configured in the **General → Report view** tab of the [Preferences Editor](Preferences_Editor#Report_view.md).\n\n\"\"\n\n\n*The report view showing messages when FreeCAD has just started.*\n\n## Messages\n\n\n**See also:**\n\n[Console API](Console_API.md), and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe report view displays messages from the internal FreeCAD `Console` class.\n\n- `FreeCAD.Console.PrintMessage(\"text\")`, print any sort of informative message, that doesn\\'t imply any misbehavior; for example, print the coordinates of points, the result of a distance calculation, the number of vertices in a shape, etc. By default, in black color.\n\n- `FreeCAD.Console.PrintWarning(\"text\")`, print messages that are intended to warn the user about strange behavior in the application. Warnings should be shown when some functionality is missing but the software still works acceptably. By default, in yellow color.\n\n- `FreeCAD.Console.PrintError(\"text\")`, print messages that are intended to be error messages, that is, when a critical component is missing that makes a certain operation fail. By default, in red color.\n\n- `FreeCAD.Console.PrintLog(\"text\")`, print messages that are going into the logs. These messages could be anything that is valuable to troubleshoot a problem in the future by reading the logs, for example, starting or closing a workbench. By default, in blue color.\n\nThese functions can be used from the [Python console](Python_console.md) directly, or from [macros](Macros.md) and custom workbenches.\n\n\"\"\n\n\n*Example messages in the report view: a general message, a warning, an error, and a logged message.*\n\n## Actions\n\nRight clicking the report view opens a context menu with the following commands:\n\n- **Options**:\n\n - \n **Display message types**\n \n : see [Preferences Editor](Preferences_Editor#Output_window.md).\n\n - \n **Show output window on**\n \n : idem.\n\n - \n **Redirect Python output**\n \n : idem.\n\n - \n **Redirect Python errors**\n \n : idem.\n\n - \n **Go to end**\n \n : if checked the report view will scroll to the bottom when a new message is added.\n\n- **Copy**: stores the selected text in the clipboard for later pasting; it is disabled if nothing is selected.\n\n- **Select all**: selects all text in the report view.\n\n- **Clear**: erases all messages in the report view. This is useful if you want to troubleshoot a tool that prints messages to the report view, and want to be sure there are no old messages from previous tools.\n\n- **Save As**: save the messages in the report view to a text file.\n\n\n{{Interface navi\n\n}} {{Std Base navi}}\n\n\n---\n⏵ [documentation index](../README.md) > Report view/en\n"} {"id": "freecad-docs:wiki/translations/en/Robot_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Robot_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Robot_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5c9b21fca0beafe4d5ccf6f8fe81a9d50577ef7f8fe9c0750ed0d3b9bfa947b3", "bytes": 4490, "tokens": 1477, "text": "# Robot Workbench/en\n**The Robot Workbench is unmaintained. If you have experience with the topic and are interested in maintaining it, please state your intention in the developer's section of the [https://forum.freecadweb.org/index.php FreeCAD forum].\n\nThe reason this workbench is still in the master source code is because this workbench is programmed in C++. If this workbench could be programmed in Python, then it could be made an [external workbench](external_workbenches.md) and it could be moved to a separate repository.\n**\n\n## Introduction\n\n\"Robot\n\nThe \"\" [Robot Workbench](Robot_Workbench.md) is a tool to simulate a standard [6-axis industrial robot](Robot_6-Axis.md), like [Kuka](http://kuka.com/).\n\nYou can do the following tasks:\n\n- Set up a simulation environment with a robot and work pieces.\n- Create and fill up movement trajectories.\n- Decompose features of a CAD part to a trajectory.\n- Simulate the robot movement and reaching distance.\n- Export the trajectory to a robot program file.\n\nTo get started try the [Robot tutorial](Robot_tutorial.md), and see the programming interface in the [RobotExample.py](https://github.com/FreeCAD/FreeCAD_sf_master/blob/master/src/Mod/Robot/RobotExample.py) example file.\n\n\n\"\"\n\n## Tools\n\nHere the principal commands you can use to create a robot set-up.\n\n### Robots\n\nThe tools to create and manage the 6-Axis robots\n\n- \"\" [Create a robot](Robot_CreateRobot.md): Insert a new robot into the scene\n- \"\" [Simulate a trajectory](Robot_Simulate.md): Opens the simulation dialog and lets you simulate\n- \"\" [Export a trajectory](Robot_Export.md): Export a robot program file\n- \"\" [Set home position](Robot_SetHomePos.md): Set the home position of a robot\n- \"\" [Restore home position](Robot_RestoreHomePos.md): move the robot to its home position\n\n### Trajectories\n\nTools to create and manipulate trajectories. There are two kinds, the parametric and non parametric ones.\n\n#### Non parametric trajectories \n\n- \"\" [Create a trajectory](Robot_CreateTrajectory.md): Inserts a new empty trajectory-object into the scene\n- \"\" [Set the default orientation](Robot_SetDefaultOrientation.md): Set the orientation way-points gets created by default\n- \"\" [Set the default speed parameter](Robot_SetDefaultValues.md): Set the default values for way-point creation\n- \"\" [Insert a waypoint](Robot_InsertWaypoint.md): Insert a way-point from the current robot position into a trajectory\n- \"\" [Insert a waypoint preselected](Robot_InsertWaypointPre.md): Insert a way-point from the current mouse position into a trajectory\n\n#### Parametric trajectories \n\n- \"\" [Create a trajectory out of edges](Robot_Edge2Trac.md): Insert a new object which decompose edges to a trajectory\n- \"\" [Dress-up a trajectory](Robot_TrajectoryDressUp.md): Lets you override one or more properties of a trajectory\n- \"\" [Trajectory compound](Robot_TrajectoryCompound.md): Create a compound out of some single trajectories\n\n## Scripting\n\nSee the [Robot API example](Robot_API_example.md) for a description of the functions used to model the robot displacements.\n\n## Tutorials\n\n- [Robot 6-Axis](Robot_6-Axis.md)\n- [VRML Preparation for Robot Simulation](VRML_Preparation_for_Robot_Simulation.md)\n\n\n{{Robot Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Workbenches](Category_Workbenches.md) > [Robot](Category_Robot.md) > Robot Workbench/en\n"} {"id": "freecad-docs:wiki/translations/en/SearchBar_Mod.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/SearchBar_Mod.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/SearchBar_Mod.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "2cc61186e17511d55898c15e56324de3408388d03f315d908bce1ce582e44813", "bytes": 1018, "tokens": 327, "text": "# \"SearchBar SearchBar Mod/en\n\n\n## Introduction\n\nThis is an extension that adds a search bar next to the [what\\'s this?](Std_WhatsThis.md) tool. The search results include tools, objects and preferences. Other mods can extend it by registering a result provider.\n\n\"\" \n*Screenshot of the search bar, with results in its drop-down menu and extra info about the result in a separate pane*\n\nPlease report bugs via the [issue tracker on GitHub](https://github.com/SuzanneSoy/SearchBar/issues).\n\n- Author: [Suzanne Soy](User:Suzanne.soy.md)\n- Source code on github: \n\n## Installation\n\nFor manual installation see [Installing more workbenches](Installing_more_workbenches.md).\n\n\n---\n⏵ [documentation index](../README.md) > [Addons](Category_Addons.md) > [External Workbenches](Category_External%20Workbenches.md) > SearchBar Mod/en\n"} {"id": "freecad-docs:wiki/translations/en/Shape.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Shape.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Shape.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "75ec4b3ae9e5396fd7b9d950d97b04814fbf0785fe68e6756d384532094b7225", "bytes": 2502, "tokens": 854, "text": "# Shape/en\n## Introduction\n\nIn FreeCAD the word \\\"[Shape](Shape.md)\\\" is normally used to refer to a [Part TopoShape](Part_TopoShape.md) (`Part::TopoShape` class), a type of object that gives an element its 3D geometrical and parametric representation (cube, pyramid, sphere, cylinder, fusion, etc.).\n\nEssentially all objects that are displayed in the [3D view](3D_view.md) have a [TopoShape](Part_TopoShape.md), with the exception of \\\"[Meshes](Mesh.md)\\\", which have a [MeshObject](Mesh_MeshObject.md) (`Mesh::MeshObject` class).\n\nSee [Part TopoShape](Part_TopoShape.md) for more information about this type of object.\n\n![](images/Shape_and_mesh.svg )\n\n\n*Left: parametric [shape](Shape.md) defined by properties. Right: [mesh](Mesh.md), defined by vertices and triangular surfaces.*\n\n## Usage\n\nShapes are normally created by internal functions of the [Part Workbench](Part_Workbench.md), and are ultimately defined by the [OpenCASCADE Technology](OpenCASCADE.md) kernel (OCCT).\n\nOnce a Shape is created, it can be used and modified by all [workbenches](Workbenches.md) by creating [scripted objects](scripted_objects.md) around that Shape.\n\nEssentially, every object derived from a [Part Feature](Part_Feature.md) (`Part::Feature` class) is expected to hold and manipulate a Shape.\n\nAny OpenCascade Shape has a tesselation mainly to view the Shape on screen. More information about this can be found in this German [forum post](https://forum.freecad.org/viewtopic.php?t=77521&start=10#p674947) and in the [OpenCascad Mesh documentation](https://dev.opencascade.org/doc/overview/html/occt_user_guides__mesh.html).\n\n## Notes\n\nIn informal usage, a \\\"Shape\\\" may be any geometrical figure that is visible in the [3D view](3D_view.md), and thus its concept may be confused with that of \\\"[Body](Body.md)\\\" or \\\"[Part](Part.md)\\\".\n\nHowever, when more precision is required, the distinction must be made.\n\n- A \\\"[Body](Body.md)\\\" is an object derived from a [Part Feature](Part_Feature.md) (`Part::Feature` class), created with the [PartDesign Workbench](PartDesign_Workbench.md).\n- A \\\"Shape\\\" is an internal object, embedded within the \\\"[Body](Body.md)\\\".\n- A \\\"[Part](Part.md)\\\" is used to group several \\\"[Bodies](Body.md)\\\" to form an [assembly](assembly.md). A \\\"Part\\\" has a collection of \\\"Shapes\\\", but doesn\\'t have a \\\"Shape\\\" of its own.\n\n\n {{Document objects navi}}\n\n\n---\n⏵ [documentation index](../README.md) > [Glossary](Category_Glossary.md) > [Part](Category_Part.md) > Shape/en\n"} {"id": "freecad-docs:wiki/translations/en/SheetMetal_Workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/SheetMetal_Workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/SheetMetal_Workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b1b64d0f2c82a576def875b8368d5671287f4d2d9b74833e4067f6c2d2814fec", "bytes": 15725, "tokens": 5047, "text": "# SheetMetal Workbench/en\n}\n\n\"SheetMetal\n\n\n## Introduction\n\n\"\" [SheetMetal](SheetMetal_Workbench.md) is an [external workbench](External_workbenches.md) and does not belong to the standard FreeCAD installation. It has been developed to supply tools to create and unfold sheet metal objects.\n\nCharacteristics of sheet metal objects are:\n\n- They have a constant thickness\n- They can be unfolded, if they are made of planar walls and cylindrical connections only\n\nThe unfolding tool in both of its versions is not restricted to parts made with tools from this workbench, but can handle [Part](Part_Workbench.md) and [PartDesign](PartDesign_Workbench.md) objects as well, as long as they meet above characteristics.\n\n\"\" \n*Rear: the sheet metal model built with the SheetMetal add-on
In front of it: the unfolded solid
At the forefront: the unfold sketch with bending lines for export to DXF.*\n\nIf the export in DXF is used to control machines (Lasercut for example), you have to modify the DXF to remove the lines showing the folds, as these lines may be used for cutting by the machine.\n\n## Installation\n\nThis workbench can be installed from the [Addon Manager](Std_AddonMgr.md). For manual installation see [Installing more workbenches](Installing_more_workbenches.md).\n\n## Tools\n\n- \"\" [Make Base Wall](SheetMetal_AddBase.md): Creates a sheet metal base object from a sketch, either a profile or a plate.\n\n- \"\" [Make Wall](SheetMetal_AddWall.md): Adds a flange on each selected edge of a base plate. (The flange can be turned into a hem by modifying its angle.)\n\n- \"\" [Extend Face](SheetMetal_Extrude.md): Extends a sheet metal plate at a selected edge face along its normal. (By adding an outline sketch it can be used to create interlocking geometry.)\n\n- \"\" [Fold a Wall](SheetMetal_AddFoldWall.md): Folds a face at a chosen line with a specified bend radius.\n\n- \"\" [Unfold](SheetMetal_Unfold.md): Flattens a folded sheet metal object and generates an unfold solid and an outline sketch with bend lines (provides a dialog to set parameters).\n\n- \"\" [Unattended Unfold](SheetMetal_UnattendedUnfold.md): Flattens a folded sheet metal object and generates an unfold solid and an outline sketch with bend lines (if parameters have already been set).\n\n- \"\" [Unfold Update](SheetMetal_UnfoldUpdate.md): Updates all unfold objects.\n\n- \"\" [Add Corner Relief](SheetMetal_AddCornerRelief.md): Adds a corner relief to a corner.\n\n- \"\" [Make Relief](SheetMetal_AddRelief.md): 1st step to convert a shell object into an unfoldable sheet metal object, adds a relief (cutout) to a corner.\n\n- \"\" [Make Junction](SheetMetal_AddJunction.md): 2nd step to convert a shell object into an unfoldable sheet metal object, creates an open junction on the edge of two walls.\n\n- \"\" [Make Bend](SheetMetal_AddBend.md): 3rd step to convert a shell object into an unfoldable sheet metal object, replaces sharp edges with round bends.\n\n- \"\" [Sketch On Sheet metal](SheetMetal_SketchOnSheet.md): Cuts a sketch based hole pattern along the folded walls of a sheet metal object.\n\n- \"\" [Extruded Cutout](SheetMetal_AddCutout.md): Creates an extruded cutout from a sketch extrusion.\n\n- \"\" [Make Forming in Wall](SheetMetal_Forming.md): Embosses shapes with or without holes into a sheet metal plate.\n\n- \"\" [Add base shape](SheetMetal_BaseShape.md): Adds a basic sheet metal object from parameters (introduced in version 0.3.10).\n\n## Brief description \n\nThis workbench provides tools for the two main tasks:\n\n- Create sheet metal objects\n- Unfold sheet metal objects\n\nThis section is meant to give a rough idea of how to use the supplied tools. More detailed information can be found on each tool\\'s own page (see above) or in the linked tutorials (see below).\n\n### Create a sheet metal object \n\n#### Start with a profile \n\n1. Create an open polyline (preferably with the [Sketcher Workbench](Sketcher_Workbench.md))\n2. Use the \"\" [Make Base Wall](SheetMetal_AddBase.md) command to create a sheet metal profile.\n\n#### Start with a blank \n\n1. Create a closed polyline (preferably with the sketcher)\n2. Use the \"\" [Make Base Wall](SheetMetal_AddBase.md) command to create a sheet metal blank.\n\n#### Start with a base shape \n\n1. Use the \"\" [Add base shape](SheetMetal_BaseShape.md) comand to add a basic sheet metal object from parameters (introduced in version 0.3.10).\n\n#### Start with a PartDesign Pad \n\n1. Create a closed polyline (preferably with the sketcher)\n2. Use the \"\" [PartDesign Pad](PartDesign_Pad.md) command to create a prismatic body.\n3. The \"\" [PartDesign Thickness](PartDesign_Thickness.md) command will make it an object of constant thickness.\n4. To make it unfoldable it needs some gaps or connections between the walls:\n 1. The \"\" [Make Relief](SheetMetal_AddRelief.md) command will cut off selected corners.\n 2. The \"\" [Make Junction](SheetMetal_AddJunction.md) command will create junctions with gaps between adjoining walls that need to be disjoined.\n 3. The \"\" [Make Bend](SheetMetal_AddBend.md) command will create cylindrical connections for the remaining walls that need to stay joined.\n\nSome parameters will be inherited from the parent object(s) but it is better to check the relevant parameters at each stage.\n\nIt should now be checked if the resulting sheet metal object can be unfolded. (see [Unfold\\...](#Unfold_a_sheet_metal_object.md) below).\n\n#### Adding more features \n\nThe unfoldable basic sheet metal objects can be extended:\n\n1. Use the \"\" [Extend Face](SheetMetal_Extrude.md) command to enlarge walls.\n2. The \"\" [Make Wall](SheetMetal_AddWall.md) command will add new flanges or hems to the existing object.\n3. Use the \"\" [Add Corner Relief](SheetMetal_AddCornerRelief.md) command to add or reshape corner reliefs.\n4. The \"\" [Fold a Wall](SheetMetal_AddFoldWall.md) command will fold a wall at a chosen line, i.e. it will trimm a wall at said line, relocate the cut away side, and rejoin them with a cylindrical connection.\n5. Use the \"\" [Sketch on Sheet metal](SheetMetal_SketchOnSheet.md) command to cut holes into the object starting on a chosen wall and then following the adjoined walls and connections.\n6. The \"\" [Make Forming in Wall](SheetMetal_Forming.md) command will stamp a shape into a plate (wall).\n\n: \n\n : After the creation of a WallForming feature the SheetMetal object is **no longer unfoldable**!\n\nSeveral tools from other workbenches can be used to add holes or to reshape edges.\n\n### Unfold a sheet metal object \n\nTo unfold a sheet metal object activate the \"\" [Unfold](SheetMetal_Unfold.md) or the \"\" [Unattended Unfold](SheetMetal_UnattendedUnfold.md) tool.\n\nThe result will be a 3D object with an optional outline sketch including bend lines.\n\n### Examples\n\nUntil tutorial pages are available on this wiki there is an [Examples](SheetMetal_Examples.md) page.\n\n\"\" \"\" \"\" \"\" \"\"\n\nIt contains some hints about [properties](SheetMetal_Examples#SheetMetal_properties.md) as well.\n\n## Limitations\n\n- The workbench is affected by the [topological naming issue](Glossary#Topological_Naming.md) that is inherent to FreeCAD. If an edit of a bend earlier in the history of the part renumbers the faces, then the following bends may be affected and switch faces. If the bend features do not break, you can double-click on it to get a dialog where you can select the proper face in the [3D view](3D_view.md), and update the Bend.\n- The Unfold tool has some limitations, and will fail in certain complex situations. When it fails, try to select a different face.\n- Frequent case of crash: take a lot of precautions not to cut in the hinges (the folds) either along the faces or in the angles nor to make holes or notches through the angles.\n\n## Tutorials\n\n\n
\n\n### SheetMetal Tutorial by meme2704 \n\nThe following tutorial is reproduced from the PDF tutorial mentioned in [Links](#Links.md).\n\n\n
\n\n#### Presentation of the workbench \n\nAfter downloading the extension and install, open it. ![](images/sm1.png )\n\n#### 1st operation \n\n- Get the base: use either the workbenches \\\"part\\\" or \\\"draft\\\", make 1 sketch that will contain all holes and any cuts, extrude this base to the thickness of the sheet.\n- Bear in mind that the edges will always be in addition as well as the folding radii.\n\n![](images/sm2.png )\n\n#### 2nd operation \n\n- Open the SheetMetal workbench.\n- Select 1 thickness of the edge (edge) of the base plate and click on the \\\"bend\\\" tool 90° default bend angle can be changed from 0 to 90°.\n- Edge height is 10mm by default, editable from 0.1 to xxxmm.\n- Bending radius is by default equal to thickness, editable from 0.1 to xxmm (never put 0).\n- Gap1, gap2 is the withdrawal of the folded edge from the corner of the base (0 accept).\n- Invert default: false folds to Z +, true to ZReliefd cuts the corner between the fold and the base (inactive if gap = 0).\n- Reliefw adds 1 slot between the crop and the edge (inactive if reliefd = 0).\n\n![](images/sm3.png ) Repeat as many times as there are sides to bend.\nFolding 1 return with use of \\\"extend\\\".\n![](images/sm4a.png ) To add 1 back repeat the same operation by selecting the thickness of the concerned edge.\nTo reduce the space between the 2 edges, use \\\"extends\\\".\nSelect the thickness and specify the length to add.\nNote that if the extension of the 1st edge is made before the fold of the return, it will not be taken into account, if 1 identical fold is added to the extension, it will appear correct but the unfolding will not be done.\nFolding of 1 2nd edge:\nNow we must separate the 2 edges otherwise they will merge and unfolding will be impossible.\n\\* 1st method: make 1 withdrawal of 1 edge.\n\n- - Give 1 value slightly greater than gap1 (or gap2), at zero there is still fusion.\n- 2nd method make 1 cut at 45 ° see further, use this tool.\n\n![](images/sm5a.png )\n\n#### Unfolding\n\nChoose 1 reference face (here the orange face) and click on the button in the toolbar.\nWe obtain the blue part of which it is enough to modify the values X, Y, or Z to see it in totality.\n![](images/sm6.png )\n\n#### Cut the flaps at 45° \n\nAfter folding the flaps without having made a withdrawal, the shape thus appears. ![](images/sm7a.png ) To do it must split at 45 ° (or following the bisector flaps are unequal width).\n\\* Create 1 new skit related to the common part of the 2 flaps.\n\n- Create 1 linked stop by selecting the outer edge of the \\\"hinge\\\".\n- Draw 1 triangle whose top is constrained at the end, oriented 1 side at 45 °, give the small side 1 minimum width (0.1mm is enough), and make 1 pocket.\n\nBe careful not to scratch the \\\"hinge\\\" where the nakedness of bound the tip of the triangle at the edge of the fold line. ![](images/sm8a.png ) Unfolding ![](images/sm9.png )\n\n#### Piercing edges and flaps \n\nMake these holes and cuts after folding and before unfolding.\nAlways take care not to \\\"scratch\\\" the fold lines.\n![](images/sm10.png )\n\n#### Make wired flaps \n\nMake 1 fold on the edge of the side, at 45 ° of 0.1mm long, then 1 other reverse at 45 ° of the length of the contiguous flap, then extend the opposite side, it will pass over and they will not be merged.\n![](images/sm11.png )\n\n#### Special case of this same pierced edge \n\nIn this particular case, unfolding only works by choosing the yellow face as a reference.\n![](images/sm12.png )\n\n#### Special case hole straddling the folds \n\nPreviously it is said several times that it is not necessary to cut the folding lines.\nHow to do ?\n![](images/sm13.png )\n\n- Make the base with its half-round hole and make the 2 half-sided and the 2 half-folds separately.\n- Then make 1 extension on 1 of the sides of the width of the opening minus 0.1mm, the 2 edges thus remain separated.\n- Then on this extension (in green) draw the contour of the cut and make 1 pocket\n- The result is the red piece above, and the unfolding works, stays the line that separated the 2 edges previously\n\n![](images/sm14.png )\n\n\n
\n\n\n
\n\n## Videos\n\n- [The Elegant SheetMetal Workbench](https://www.youtube.com/watch?v=xidvQYkC4so) by Joko Engineering\n\n## Links\n\n- [Macro Sheet Metal Unfolder](Macro_Sheet_Metal_Unfolder.md), the original macro the Unfold tool is based on.\n- [An English and French tutorial in PDF format](https://forum.freecadweb.org/viewtopic.php?f=3&t=25002) on the FreeCAD forum.\n- Report bugs/Request features: .\n\n## References\n\n- Author:\n - Folding tools: Copyright 2015-2018 by Shai Seger\n - Unfolding tool: Copyright 2014 by Ulrich Brammer\n- License: [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html)\n- Source code on github: \n\n\n---\n⏵ [documentation index](../README.md) > [SheetMetal](Category_SheetMetal.md) > [Addons](Category_Addons.md) > [External Command Reference](Category_External%20Command%20Reference.md) > SheetMetal Workbench/en\n"} {"id": "freecad-docs:wiki/translations/en/Sketcher_ConstrainHorVer.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Sketcher_ConstrainHorVer.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Sketcher_ConstrainHorVer.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b81a238f47b1af5ae321fdcc3021ddc8f565fc021c6512169a4e0624959b4c95", "bytes": 2976, "tokens": 951, "text": "---\n GuiCommand:\n Name: Sketcher ConstrainHorVer\n MenuLocation: Sketch , Sketcher constraints , Constrain horizontal/vertical\n Workbenches: Sketcher_Workbench\n Shortcut: **A**\n Version: 1.0\n SeeAlso: Sketcher_ConstrainHorizontal, Sketcher_ConstrainVertical\n---\n\n# Sketcher ConstrainHorVer/en\n\n## Description\n\nThe \"\" [Sketcher ConstrainHorVer](Sketcher_ConstrainHorVer.md) tool constrains lines or pairs of points to be horizontal (parallel to the horizontal axis of the sketch) or vertical, whichever is closest to the current alignment.\n\nThis tool combines the [Sketcher ConstrainHorizontal](Sketcher_ConstrainHorizontal.md) and [Sketcher ConstrainVertical](Sketcher_ConstrainVertical.md) tools.\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\n### [Continue mode](Sketcher_Workbench#Continue_modes.md) \n\n1. Make sure there is no selection.\n2. There are several ways to invoke the tool:\n - If the **Auto tool for Horizontal/Vertical** [preference](Sketcher_Preferences#General.md) is selected (default): press the ** [Constrain horizontal/vertical](Sketcher_ConstrainHorVer.md)** button.\n - Select the **Sketch → Sketcher constraints → Constrain horizontal/vertical** option from the menu.\n - Right-click in the [3D view](3D_view.md) and select the **Constrain → Constrain horizontal/vertical** option from the context menu.\n - Use the keyboard shortcut: **A**.\n3. The cursor changes to a cross with the tool icon.\n4. Do one of the following:\n - Select two points.\n - Select a single line.\n5. A constraint is added.\n6. Optionally keep creating constraints.\n7. To finish, right-click or press **Esc**, or start another geometry or constraint creation tool.\n\n### Run-once mode \n\n1. Do one of the following:\n - Select two or more points (the selection order can be relevant see [Notes](#Notes.md)).\n - Select one or more lines. Points can be included in the selection, but will be ignored.\n2. Invoke the tool as explained above, or with the following additional option:\n - Right-click in the [3D view](3D_view.md) and select the ** Constrain horizontal/vertical** option from the context menu.\n3. Depending on the selection one or more constraints are added.\n\n## Notes\n\n- More than 2 points are processed in the selection order, one pair at a time. The 1st point is paired with the 2nd. When they are constrained the 2nd point may move. The new location of the 2nd point determines which constraint is applied when the 2nd and 3rd point are constrained, etc.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher ConstrainHorVer/en\n"} {"id": "freecad-docs:wiki/translations/en/Sketcher_Create3PointCircle.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Sketcher_Create3PointCircle.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Sketcher_Create3PointCircle.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f17250fa42847a85f68904d019c9d9c8ea356a29b720a70597aad59414ab04fc", "bytes": 1342, "tokens": 478, "text": "---\n GuiCommand:\n Name: Sketcher Create3PointCircle\n MenuLocation: Sketch , Sketcher geometries , Create circle by 3 points\n Workbenches: Sketcher_Workbench\n Shortcut: **G** **3** **C**\n SeeAlso: Sketcher_CreateCircle\n---\n\n# Sketcher Create3PointCircle/en\n\n## Description\n\nThe \"\" [Sketcher Create 3PointCircle](Sketcher_Create3PointCircle.md) tool creates a circle by three points along the circle. (v1.0) : This is the same tool as [Sketcher CreateCircle](Sketcher_CreateCircle.md) but with a different initial mode.\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\n1. There are several ways to invoke the tool:\n - Press the ** [3 rim points](Sketcher_Create3PointCircle.md)** button.\n - Select the **Sketcher → Sketcher geometries → Create circle by 3 points** option from the menu.\n - Use the keyboard shortcut: **G** then **3**, then **C**.\n2. For further steps see [Sketcher CreateCircle](Sketcher_CreateCircle#Usage.md).\n\n\n{{Sketcher Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher Create3PointCircle/en\n"} {"id": "freecad-docs:wiki/translations/en/Sketcher_CreateHexagon.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Sketcher_CreateHexagon.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Sketcher_CreateHexagon.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8998f8d9fdcb88046370dc601d77d7aa0fba38fb5d0b4d2e80b0ce5a71f9d47d", "bytes": 1521, "tokens": 546, "text": "---\n GuiCommand:\n Name: Sketcher CreateHexagon\n MenuLocation: Sketch , Sketcher geometries , Create hexagon\n Workbenches: Sketcher_Workbench\n Shortcut: **G** **P** **6**\n Version: 0.15\n SeeAlso: Sketcher_CreateRegularPolygon\n---\n\n# Sketcher CreateHexagon/en\n\n## Description\n\nThe \"\" [Sketcher CreateHexagon](Sketcher_CreateHexagon.md) tool creates a hexagon. (v1.0) : This is the same tool as [Sketcher CreateRegularPolygon](Sketcher_CreateRegularPolygon.md) but with the number of sides preset to 6.\n\n![](images/SketcherCreateHexagonExample.png‎ )\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\n1. There are several ways to invoke the tool:\n - Press the ** [Hexagon](Sketcher_CreateHexagon.md)** button.\n - Select the **Sketcher → Sketcher geometries → Create hexagon** option from the menu.\n - Right-click in the [3D view](3D_view.md) and select the ** Create hexagon** option from the context menu.\n - Use the keyboard shortcut: **G** then **P**, then **6**.\n2. For further steps see [Sketcher CreateRegularPolygon](Sketcher_CreateRegularPolygon#Usage.md).\n\n\n{{Sketcher Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher CreateHexagon/en\n"} {"id": "freecad-docs:wiki/translations/en/Sketcher_CreatePoint.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Sketcher_CreatePoint.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Sketcher_CreatePoint.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "9bcbd5b6261f7bf4bce0d1fd9dc2611b4529db9e079dc11eb61bfbfe1bfbf71a", "bytes": 1860, "tokens": 614, "text": "---\n GuiCommand:\n Name: Sketcher CreatePoint\n MenuLocation: Sketch , Sketcher geometries , Create point\n Workbenches: Sketcher_Workbench\n Shortcut: **G** **Y**\n---\n\n# Sketcher CreatePoint/en\n\n## Description\n\nThe \"\" [Sketcher CreatePoint](Sketcher_CreatePoint.md) tool creates a point.\n\n## Usage\n\nSee also: [Drawing aids](Sketcher_Workbench#Drawing_aids.md).\n\nPos-OVP = Positional [On-View-Parameters](Sketcher_Preferences#General.md). (v1.0) \n\n1. There are several ways to invoke the tool:\n - Press the ** [Create point](Sketcher_CreatePoint.md)** button.\n - Select the **Sketcher → Sketcher geometries → Create point** option from the menu.\n - Right-click in the [3D view](3D_view.md) and select the ** Create point** option from the context menu.\n - Use the keyboard shortcut: **G** then **Y**.\n2. The cursor changes to a cross with the tool icon.\n3. Pick a point. Or with Pos-OVP: enter its X and/or Y coordinate.\n4. The point is created and applicable Pos-OVP based constraints are added.\n5. If the tool runs in [continue mode](Sketcher_Workbench#Continue_modes.md):\n 1. Optionally keep creating points.\n 2. To finish, right-click or press **Esc**, or start another geometry or constraint creation tool.\n\n## Notes\n\n- {{VersionMinus|0.21}}: Points are always created as construction geometry. Optionally change them to normal geometry with [Sketcher ToggleConstruction](Sketcher_ToggleConstruction.md) to make them visible outside of Sketch editing mode.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher CreatePoint/en\n"} {"id": "freecad-docs:wiki/translations/en/Sketcher_SwitchVirtualSpace.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Sketcher_SwitchVirtualSpace.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Sketcher_SwitchVirtualSpace.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "6de4e04772b1b9ccb94c70b9be53e6fbaabba4a66a101b7089981660477a7a2a", "bytes": 1848, "tokens": 585, "text": "---\n GuiCommand:\n Name: Sketcher SwitchVirtualSpace\n MenuLocation: Sketch , Sketcher visual , Switch virtual space\n Workbenches: Sketcher_Workbench\n Shortcut: **Z** **Z**\n Version: 0.17\n---\n\n# Sketcher SwitchVirtualSpace/en\n\n## Description\n\nThe \"\" [Sketcher SwitchVirtualSpace](Sketcher_SwitchVirtualSpace.md) tool either (un)hides constraints or switches the visible virtual space.\n\nA sketch has two virtual spaces that can contain constraints. All constraints are created in the main virtual space, but they can be hidden which moves them to the other virtual space.\n\n## Usage\n\n### (Un)hide constraints \n\n1. Select one or more constraints. Constraints that are not visible in the current virtual space can be selected in the [Constraints section of the Sketcher Dialog](Sketcher_Dialog#Constraints.md).\n2. There are several ways to invoke the tool:\n - Press the ** [Switch virtual space](Sketcher_SwitchVirtualSpace.md)** button.\n - Select the **Sketch → Sketcher visual → Switch virtual space** option from the menu.\n - Use the keyboard shortcut: **Z** then **Z**.\n\n### Switch virtual space \n\n1. Make sure no constraints have been selected.\n2. Invoke the tool as described above.\n3. Hidden constraints are made visible and unhidden constraints invisible, or vice versa.\n\n## Notes\n\n- Constraints can also be (un)hidden from the [Sketcher Dialog](Sketcher_Dialog#Constraints.md).\n- The virtual space setting of a sketch is only used in the current session, it is not stored in the FreeCAD file.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher SwitchVirtualSpace/en\n"} {"id": "freecad-docs:wiki/translations/en/Sketcher_ToggleDrivingConstraint.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Sketcher_ToggleDrivingConstraint.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Sketcher_ToggleDrivingConstraint.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "010d07d8a3d002227d003298e330eb6a4ba0e0eab99bdea3b192bd4e9a42fca9", "bytes": 3308, "tokens": 977, "text": "---\n GuiCommand:\n Name: Sketcher ToggleDrivingConstraint\n MenuLocation: Sketch , Sketcher constraints , Toggle driving/reference constraint\n Workbenches: Sketcher_Workbench\n Shortcut: **K** **X**\n Version: 0.16\n SeeAlso: Sketcher_ToggleActiveConstraint\n---\n\n# Sketcher ToggleDrivingConstraint/en\n\n## Description\n\nThe \"\" [Sketcher ToggleDrivingConstraint](Sketcher_ToggleDrivingConstraint.md) tool either toggles the [dimensional constraint creation tools](Sketcher_Workbench#Sketcher_CompDimensionTools.md) between driving and reference mode, or toggles selected dimensional constraints between those modes.\n\nContrary to driving constraints, reference constraints do not constrain the sketch, their value depends on other constraints, they are driven. They can be useful to verify measurements. They can be used in [expressions](Expressions.md), but not in the sketch itself.\n\n![](images/Sketcher_ToggleConstraint_example.png ) \n*A driving horizontal distance constraint (50 mm), a driving vertical distance constraint (30 mm) and a driving angle constraint (75°) were set to define the profile; a reference dimension was added on the slanted line segment to know its length (31.0583 mm).*\n\n## Usage\n\n### Toggle tools \n\n1. Make sure no dimensional constraints have been selected.\n2. There are several ways to invoke the tool:\n - Press the ** [Toggle driving/reference constraint](Sketcher_ToggleDrivingConstraint.md)** button.\n - Select the **Sketch → Sketcher constraints → Toggle driving/reference constraint** option from the menu.\n - Use the keyboard shortcut: **K** then **X**.\n3. The mode of the dimensional constraint creation tools is toggled:\n - In driving mode their menu and toolbar icons are red, and they create driving constraints (default [color](Sketcher_Preferences#Appearance.md) red). The icon of this tool is then: \"\".\n - In reference mode their menu and toolbar icons are blue, and they create reference constraints (default color blue). The icon of this tool is then: \"\".\n\n### Toggle constraints \n\n1. Select one or more dimensional constraints.\n2. Invoke the tool as described above, or with one of the following additional options:\n - \n (v1.0) \n \n : Right-click in the [3D view](3D_view.md) and select the ** Toggle driving/reference constraint** option from the context menu.\n\n - Right-click in the **Constraints** section of the [Sketcher Dialog](Sketcher_Dialog.md) and select the **Toggle to/from reference** option from the context menu.\n3. The selected constraints are changed from driving to reference mode or vice versa. Their appearance changes accordingly.\n4. The mode of the dimensional constraint creation tools is not changed.\n\n\n---\n⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher ToggleDrivingConstraint/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_Copy.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_Copy.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_Copy.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "5bb17865a3b963a1668002d092258bd9c998c9b4b3605ba3f6078816750eddd8", "bytes": 1248, "tokens": 416, "text": "---\n GuiCommand:\n Name: Std Copy\n MenuLocation: Edit , Copy\n Workbenches: All\n Shortcut: **Ctrl**+**C**\n SeeAlso: Std_Cut, Std_Paste, Std_DuplicateSelection\n---\n\n# Std Copy/en\n\n## Description\n\nThe **Std Copy** command copies objects to the Clipboard.\n\n## Usage\n\n1. Select one or more objects.\n2. There are several ways to invoke the command:\n - Press the ** [Copy](Std_Copy.md)** button.\n - Select the **Edit → Copy** option from the menu.\n - Select the ** Copy** option from the [Tree view](Tree_view.md) context menu.\n - Use the keyboard shortcut: **Ctrl**+**C**.\n3. If the objects have dependencies that have not been selected, a dialog box will prompt you to specify which should be included.\n\n## Notes\n\n- When you are working in a FreeCAD text window, an input box or a spreadsheet, the standard keyboard shortcut **Ctrl**+**C**, in almost all cases, does not call this command but uses the Copy function from the OS instead.\n- It is not possible to copy-paste native objects between FreeCAD and other applications.\n\n\n---\n⏵ [documentation index](../README.md) > Std Copy/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_DependencyGraph.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_DependencyGraph.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_DependencyGraph.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "89032a4f1268332458022d65e333473979d8b8ed489a61694665d70f063fee99", "bytes": 7487, "tokens": 2211, "text": "---\n GuiCommand:\n Name: Std DependencyGraph\n MenuLocation: Tools , Dependency graph...\n Workbenches: All\n SeeAlso: Std_ExportDependencyGraph\n---\n\n# Std DependencyGraph/en\n\n## Description\n\nThe **Std DependencyGraph** command displays the dependencies between objects in the active document in a graph. As opposed to the [Tree view](Tree_view.md), objects are listed in reverse chronological order, with the first created object at the bottom.\n\nIt can be useful in analyzing a FreeCAD document and locating forks in a tree. The dependency graph layout will depend on which workbench was used to create the objects in the document. For example a model made exclusively in the [PartDesign](PartDesign_Workbench.md) workbench can display a linear dependency graph with a single vertical branch. A model made with [Part](Part_Workbench.md) operations will have many branches, but for a single part they will join up at the top after [Boolean](Part_Boolean.md) operations. If they don\\'t, it means that they are separate objects.\n\nThe dependency graph is purely a visualization tool, therefore it cannot be edited. It automatically updates if changes are made to the model.\n\n\"\" \n*Example of a dependency graph with a PartDesign body on the left and an object created with Part operations on the right*\n\n## Installation\n\nTo use the command a third-party software named [Graphviz](https://graphviz.org/) needs to be installed. If you do not have it pre-installed or it is installed in an unconventional location, FreeCAD will display the following dialog:\n\n![](images/FreeCAD-0.17-missing-Graphviz-error-dialogue.png )\n\n### Windows\n\nDownload the **graphviz-2.xx** installer from the [Graphviz Download page](https://graphviz.org/download/#windows) and launch it to install it. Some older versions seem to have issues displaying the graph; version 2.38 and newer are known to be reliable. You can find all graphviz releases on [Gitlab](https://gitlab.com/graphviz/graphviz/-/releases).\n\n### macOS\n\nYou can install Graphviz using [Homebrew](https://brew.sh/) if you have macOS Big Sur (11) (or higher). While installing Homebrew, don\\'t get nervous, if macOS asks you to install updates, e.g. for the Xcode commandline tools. These updates are performed later by the installation process.\n\n\n{{Code|lang=text|code=\nbrew install graphviz\n}}\n\nThis installs the Graphviz binaries under **/usr/local/bin** for macOS on Intel, or **/opt/homebrew** for macOS on Apple Silicon/ARM. FreeCAD should automatically find these locations. If the Graphviz program is not found you will be asked to specify a path. Unfortunately we can\\'t navigate directly to the program in the file dialog that comes up from **Tools → Dependency graph...**. There are two options: You can use the key combination Cmd+Shift+. to show hidden items. Or you can use the key combination Cmd+Shift+G to get an input field for the path. Enter one of these paths in the [Terminal](https://en.wikipedia.org/wiki/Terminal_(macOS)):\n\n\n{{Code|lang=text|code=\n/usr/local/bin\n}}\n\nor:\n\n\n{{Code|lang=text|code=\n/opt/homebrew/bin\n}}\n\nand confirm the input field and the file selection dialog.\n\nIn case the Graphviz binaries are installed in a non-standard location try to find the program with the command:\n\n\n{{Code|lang=text|code=\ntype dot\n}}\n\nIt will output something like:\n\n\n{{Code|lang=text|code=\ndot is /usr/local/bin/dot\n}}\n\nAnd you can tell FreeCAD to look in that directory.\n\nIf you don\\'t have macOS Big Sur (11) (or higher) Homebrew might not work, but you can use [MacPorts](https://www.macports.org/index.php) instead. Just download the [appropriate version for your OS](https://www.macports.org/install.php). Once the installation is complete, enter this command in the [Terminal](https://en.wikipedia.org/wiki/Terminal_(macOS)):\n\n\n{{Code|lang=text|code=\nsudo port install graphviz\n}}\n\nEnter your password and wait while the dependencies are downloaded and installed (it can take some time).\n\nThe Graphviz binaries may be under **/usr/local/bin** or **/opt/local/bin/dot**. FreeCAD may automatically find the Graphviz program with the file dialog that comes up from **Tools → Dependency graph...**, if not enter this command:\n\n\n{{Code|lang=text|code=\ntype dot\n}}\n\nIt will output something like:\n\n\n{{Code|lang=text|code=\ndot is /opt/local/bin/dot\n}}\n\nAnd you can tell FreeCAD to look in that directory as explained before.\n\nIt is also possible to make the opt directory visible with this command:\n\n\n{{Code|lang=text|code=\ndefaults write com.apple.finder AppleShowAllFiles YES;\n}}\n\nthen:\n\n\n{{Code|lang=text|code=\nkillall Finder /System/Library/CoreServices/Finder.app;\n}}\n\nTherefore you can tell FreeCAD to follow this path. It has been successfully tested on macOS 10.13 (High Sierra).\n\n### Linux\n\nOn most Linux distributions (Debian/Ubuntu, Fedora, OpenSUSE), you just need to install the Graphviz package from the repositories. However, similar to the macOS, in cases where the Graphviz binaries are installed in a non-standard location, try to find the program with the command:\n\n\n{{Code|lang=text|code=\ntype dot\n}}\n\nIt may output something like\n\n\n{{Code|lang=text|code=\ndot is /usr/local/bin/dot\n}}\n\nAnd therefore you can point FreeCAD to look in that directory.\n\n## Usage\n\n1. Select the **Tools → Dependency graph...** option from the menu.\n2. A new tab titled **Dependency graph** opens in the [Main view area](Main_view_area.md).\n3. Use the mouse scroll wheel to zoom in or out.\n4. Use the sliders at the bottom and at the right of the screen to pan the view. Alternatively hold down the left mouse button and move the mouse.\n\n## Save\n\nYou can save a dependency graph:\n\n1. Make sure the Dependency graph tab is in the foreground.\n2. Select the **File → [Save](Std_Save.md)** or **File → [Save As](Std_SaveAs.md)** option from the menu.\n3. Enter a filename and select the file type (\\*.gv, \\*.png, \\*.bmp, \\*.gif, \\*.jpg, \\*.svg or \\*.pdf).\n4. Press the **Save** button.\n\n## General principles \n\n- The graph shows objects in reverse chronological order.\n- The direction of arrows showing dependencies should always point down. An arrow pointing up indicates a cyclic dependency, an issue that needs to be resolved.\n- A sketch that contains links to [external geometry](Sketcher_External.md) will have a number with an \\'x\\' suffix besides the arrow linking it to its parent, showing the number of external geometries linked in the sketch.\n- Objects can have dependencies to multiple parents. For example, for a model built in [PartDesign](PartDesign_Workbench.md), a Pocket may be linked to its Sketch and to the Pad feature that came before it.\n- Disallowed dependencies (for example, between a [Draft](Draft_Workbench.md)/[Part](Part_Workbench.md) operation and an element inside a PartDesign Body) will show with a red arrow. This type of link usually shows a \\'Links go out of allowed scope\\' error in the [Report view](Report_view.md).\n- A [Part container](Std_Part.md) and [PartDesign Body](PartDesign_Body.md) enclose their content inside a frame with a randomly colored background. Their Origin also encloses its content (standard planes and axes) in a frame.\n- A [Group](Std_Group.md) is displayed as a single element linked to its content.\n\n\n---\n⏵ [documentation index](../README.md) > [3rd_Party](Category_3rd_Party.md) > Std DependencyGraph/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_File_Menu.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_File_Menu.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_File_Menu.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "bceb32d136aab6228ecc6db152542b1e490103b7490d5d8da6630562beb3742a", "bytes": 3033, "tokens": 1256, "text": "# \"Std Std File Menu/en\n\n\n## Introduction\n\nThe **Std File Menu** is one of the 7 sub-menus in the [standard menu](Standard_Menu.md):\n\n\n{{StdMenu\n|\n[File](Std_File_Menu.md)\n   \n[Edit](Std_Edit_Menu.md)\n   \n[View](Std_View_Menu.md)\n   \n[Tools](Std_Tools_Menu.md)\n   \n[Macro](Std_Macro_Menu.md)\n   \n[Windows](Std_Windows_Menu.md)\n   \n[Help](Std_Help_Menu.md)\n}}\n\nThe File menu provides tools related to file input and output.\n\n## Tools\n\nThe following tools are available in this menu:\n\n- \"\" [New](Std_New.md): Creates a new empty document.\n\n- \"\" [Open\\...](Std_Open.md): Opens a document or imports files.\n\n- [Open Recent](Std_RecentFiles.md): Shows the recent file list.\n\n- \"\" [Close](Std_CloseActiveWindow.md): Closes the active window.\n\n- \"\" [Close All](Std_CloseAllWindows.md): Closes all windows.\n\n- \"\" [Save](Std_Save.md): Saves the document.\n\n- \"\" [Save As\\...](Std_SaveAs.md): Saves the document under a new file name.\n\n- \"\" [Save a Copy\\...](Std_SaveCopy.md): Saves a copy of the document under a new file name.\n\n- \"\" [Save All](Std_SaveAll.md): Saves all opened documents.\n\n- \"\" [Revert](Std_Revert.md): Reverts to the saved version of the document.\n\n- \"\" [Import\\...](Std_Import.md): Imports a file into the document.\n\n- \"\" [Export\\...](Std_Export.md): Exports object(s) from the document.\n\n- \"\" [Merge project\\...](Std_MergeProjects.md): Adds the objects from a FreeCAD file to the document.\n\n- \"\" [Document information\\...](Std_ProjectInfo.md): Shows details of the document.\n\n- \"\" [Print\\...](Std_Print.md): Prints the document.\n\n- \"\" [Print preview\\...](Std_PrintPreview.md): Shows a print preview.\n\n- \"\" [Export PDF\\...](Std_PrintPdf.md): Exports the document as PDF.\n\n- \"\" [Exit](Std_Quit.md): Quits the application.\n\n\n---\n⏵ [documentation index](../README.md) > [Workbenches](Category_Workbenches.md) > Std File Menu/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_SaveAs.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_SaveAs.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_SaveAs.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "819f9696c6ba990fc18cc306931b224e7f287685e508a7374dfc478d07d3622a", "bytes": 770, "tokens": 288, "text": "---\n GuiCommand:\n Name: Std SaveAs\n MenuLocation: File , Save As...\n Workbenches: All\n SeeAlso: Std_SaveCopy, Std_Save\n---\n\n# Std SaveAs/en\n\n## Description\n\nThe **Std SaveAs** command saves the active document under a new file name.\n\n## Usage\n\n1. Select the **File → Save As...** option from the menu.\n2. Enter a filename in the dialog box.\n3. Press the **Save** button.\n\n## Options\n\n- Press **Esc** or the **Cancel** button to abort the command.\n\n## Notes\n\n- This command can also be used to save dependency graphs. See [Std DependencyGraph](Std_DependencyGraph.md).\n\n## Scripting\n\nSee [Std New](Std_New#Scripting.md).\n\n\n{{Std Base navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > Std SaveAs/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_Transform.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_Transform.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_Transform.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8b67b54d654cc5527878d27e73d60e11354f489bad47b55ac34d2d552ac79971", "bytes": 148, "tokens": 63, "text": "# Std Transform/en\n1. REDIRECT [Std_TransformManip/en](Std_TransformManip/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > Std Transform/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_TransformManip.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_TransformManip.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_TransformManip.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0d1d01eab128c3e537c00cf8b0256b9710a55a9f570a3be3f1a42f66059b8ed4", "bytes": 2173, "tokens": 660, "text": "---\n GuiCommand:\n Name: Std TransformManip\n MenuLocation: Edit , Transform\n Workbenches: All\n SeeAlso: Std_UserEditMode\n---\n\n# Std TransformManip/en\n\n## Description\n\nThe **Std TransformManip** command allows you to apply rotation increments and translation increments to an object.\n\n\"\"\n\n## Usage\n\n1. Select an object with a **Placement** property. See [Notes](#Notes.md).\n2. There are several ways to invoke the command:\n - Select the **Edit → Transform** option from the menu.\n - Select the ** Transform** option from the [Tree view](Tree_view.md) context menu.\n - If [edit mode](Std_UserEditMode.md) is set to ** Transform** you can also double-click the object in the Tree view.\n3. The **Increments** task panel opens.\n4. Optionally adjust the increments parameters.\n5. Do one or more of the following:\n - Press and hold the left mouse button on an axis arrow and drag to translate the object along that axis.\n - Press and hold the left mouse button on a plane and drag to translate the object along that plane.\n - Press and hold the left mouse button on a sphere and drag to rotate the object around that axis.\n6. Do one of the following:\n - Press the **OK** button to confirm and finish the command.\n - Press the **Cancel** button to revert the applied transformations and finish the command. (v1.0) \n\n## Notes\n\n- As soon as you rotate/move the object in the [3D view](3D_view.md), changes are applied.\n- Some objects with a **Placement** property, such as sketches, cannot be manipulated, neither can objects that are attached to other objects.\n- There is no **Cancel** button in {{VersionMinus|0.21}}, in those versions you can press the **OK** button and use the \"\" [Undo](Std_Undo.md) command to revert changes afterwards.\n\n\n---\n⏵ [documentation index](../README.md) > Std TransformManip/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_ViewBottom.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_ViewBottom.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_ViewBottom.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "56a968d0537794e3925468e174459ad77b05111ac8810cf72507ba924cbdcd82", "bytes": 1046, "tokens": 368, "text": "---\n GuiCommand:\n Name: Std ViewBottom\n MenuLocation: View , Standard views , Bottom\n Workbenches: All\n Shortcut: **5**\n SeeAlso: Std_ViewRear, Std_ViewLeft\n---\n\n# Std ViewBottom/en\n\n## Description\n\nThe **Std ViewBottom** command points the camera in the active [3D view](3D_view.md) in the direction of the positive Z axis.\n\n![](images/FreeCAD_views_rear.svg ) \n*Arrow 5 points in the direction of the bottom view*\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Bottom](Std_ViewBottom.md)** button.\n - Select the **View → Standard views → Bottom** option from the menu.\n - Select the **Standard views → Bottom** option from the [3D view](3D_view.md) context menu.\n - Use the keyboard shortcut: **5**.\n\n## Scripting\n\nSee [Std ViewFront](Std_ViewFront#Scripting.md).\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewBottom/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_ViewFitSelection.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_ViewFitSelection.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_ViewFitSelection.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "f90f26c14deb9b86519a5e5b5f016b6ca278f69766c9876e9591fe38a490c07e", "bytes": 1682, "tokens": 555, "text": "---\n GuiCommand:\n Name: Std ViewFitSelection\n MenuLocation: View , Standard views , Fit selection\n Workbenches: All\n Shortcut: **V** **S**\n SeeAlso: Std_ViewFitAll\n---\n\n# Std ViewFitSelection/en\n\n## Description\n\nThe **Std ViewFitSelection** command zooms and pans the camera so that all selected objects fit inside the active [3D view](3D_view.md). This command is useful if for some reason objects are beyond the boundaries of the current 3D View or can\\'t easily be found using [3D navigation](Mouse_navigation.md).\n\n## Usage\n\n1. Select one or more objects.\n2. There are several ways to invoke the command:\n - Press the ** [Fit selection](Std_ViewFitSelection.md)** button.\n - Select the **View → Standard views → Fit selection** option from the menu.\n - Select the ** Fit selection** option from the [3D view](3D_view.md) context menu.\n - Select the ** Fit selection** option from the Mini-cube menu of the [Navigation Cube](Navigation_Cube.md).\n - Use the keyboard shortcut: **V** then **S**.\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe `SendMsgToActiveView` method of the FreeCADGui object can be used to zoom the active view to fit selection.\n\n\n```python\nimport FreeCADGui\n\nFreeCADGui.SendMsgToActiveView(\"ViewSelection\")\n```\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewFitSelection/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_ViewIvStereoOff.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_ViewIvStereoOff.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_ViewIvStereoOff.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "0368d5dc8ef49ccb22e12438e1e3fa9a31efe3d3bd9295a57407f11716fe06d0", "bytes": 682, "tokens": 278, "text": "---\n GuiCommand:\n Name: Std ViewIvStereoOff\n MenuLocation: View , Stereo , Stereo Off\n Workbenches: All\n SeeAlso: Std_ViewIvStereoRedGreen, Std_ViewIvStereoQuadBuff, Std_ViewIvStereoInterleavedRows, Std_ViewIvStereoInterleavedColumns\n---\n\n# Std ViewIvStereoOff/en\n\n## Description\n\nThe **Std ViewIvStereoOff** command switches off stereo mode in the active [3D view](3D_view.md).\n\n## Usage\n\n1. Select the **View → Stereo → Stereo Off** option from the menu.\n\n## Scripting\n\nSee [Std ViewIvStereoRedGreen](Std_ViewIvStereoRedGreen#Scripting.md).\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewIvStereoOff/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_ViewLeft.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_ViewLeft.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_ViewLeft.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "1950d5d6a8ef84819cd540a8b7826d1c1a770c8b7f3f4b6199c8f00ddbb7a96d", "bytes": 1022, "tokens": 368, "text": "---\n GuiCommand:\n Name: Std ViewLeft\n MenuLocation: View , Standard views , Left\n Workbenches: All\n Shortcut: **6**\n SeeAlso: Std_ViewRear, Std_ViewBottom\n---\n\n# Std ViewLeft/en\n\n## Description\n\nThe **Std ViewLeft** command points the camera in the active [3D view](3D_view.md) in the direction of the positive X axis.\n\n![](images/FreeCAD_views_rear.svg ) \n*Arrow 6 points in the direction of the left view*\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Press the ** [Left](Std_ViewLeft.md)** button.\n - Select the **View → Standard views → Left** option from the menu.\n - Select the **Standard views → Left** option from the [3D view](3D_view.md) context menu.\n - Use the keyboard shortcut: **6**.\n\n## Scripting\n\nSee [Std ViewFront](Std_ViewFront#Scripting.md).\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewLeft/en\n"} {"id": "freecad-docs:wiki/translations/en/Std_ViewRotateRight.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Std_ViewRotateRight.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Std_ViewRotateRight.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "098327776a5cb6a5a09e9a9ce3af9fc0890a8fe4be879287f0c48c3959376b43", "bytes": 967, "tokens": 328, "text": "---\n GuiCommand:\n Name: Std ViewRotateRight\n MenuLocation: View , Standard views , Rotate Right\n Workbenches: All\n Shortcut: **Shift**+**Right**\n SeeAlso: Std_ViewRotateLeft\n---\n\n# Std ViewRotateRight/en\n\n## Description\n\nThe **Std ViewRotateRight** command rotates the camera in the active [3D view](3D_view.md) around the view direction in 90-degree increments towards the right (clockwise).\n\n## Usage\n\n1. There are several ways to invoke the command:\n - Select the **View → Standard views → Rotate Right** option from the menu.\n - Select the **Standard views → Rotate Right** option from the [3D view](3D_view.md) context menu.\n - Use the keyboard shortcut: **Shift**+**Right**.\n\n## Scripting\n\nSee [Std ViewRotateLeft](Std_ViewRotateLeft#Scripting.md).\n\n\n---\n⏵ [documentation index](../README.md) > Std ViewRotateRight/en\n"} {"id": "freecad-docs:wiki/translations/en/Svg_Namespace.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Svg_Namespace.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Svg_Namespace.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "28da4f53bf9073a74a1c20ec6abeda46e6aa18419084664ec3829777ebd3eb6c", "bytes": 14533, "tokens": 4622, "text": "# Svg Namespace/en\n**Development of the [Drawing Workbench](Drawing_Workbench.md) stopped in FreeCAD 0.16, and the new [TechDraw Workbench](TechDraw_Workbench.md) aiming to replace it was introduced in v0.17. Both workbenches were provided from v0.17 to v0.20, but since v0.21 the Drawing Workbench is no longer included.**\n\n\n{{Message|Currently the TechDraw workbench still uses the '''freecad:EditableText'''attribute and the related name space declaration in its current templates.}}\n\n\n## Introduction\n\nFreeCAD can import and export [SVG](http://en.wikipedia.org/wiki/Scalable_Vector_Graphics) documents containing code that belongs to a certain **namespace** which is a sub-set of XML instructions.\n\nLike any XML document an SVG document consist of two sections:\n\n- [Head](#Head.md): just one line to declare which version of the XML language is used for the instructions in the body of this document.\n- [Body](#Body.md): a list of instructions. SVG documents enclose all instructions in {{Incode|}} tags.\n\n: The opening tag contains information about the size and the used SVG namespaces.\n\n## Default namespace \n\nThe default SVG namespace used by FreeCAD is declared with this line:\n\n\n{{Code|lang=xml|code=\nxmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"\n}}\n\nThe external link leads to a web site containing information about the namespace and its set of instructions. Attributes of this namespace are used without prefix.\n\n## Namespace extension \n\nAttributes missing from the SVG namespace can be added by namespace extensions. FreeCAD uses such an extension for drawing templates. The related namespace declaration, used to introduce the {{Value|freecad:}} prefix, links to the related web site, **this page**:\n\n\n{{Code|lang=xml|code=\nxmlns:freecad=\"http://www.freecad.org/wiki/index.php?title=Svg_Namespace\"\n}}\n\nThe link is not used to retrieve information or values at runtime, but it is the key to activate the custom attributes.\n\n### TechDraw templates and symbols \n\nThe TechDraw workbench uses SVG templates to create drawings. It cannot create and export templates but relies on externally created templates with manually inserted attributes:\n\n- [freecad:editable](#freecad_editable.md) enables editable entries in title blocks.\n- [freecad:autofill](#freecad_autofill.md) ((v1.0) ) added to the above, marks the text to be auto filled on template creation.\n\nSymbols are another type of SVG files that can be used in drawing views for e.g. stamp-like annotations. They also have to be created externally and can use the above mentioned attributes, too.\n\n### Migration to freecad.org \n\nPrior to the migration of the FreeCAD wiki, including **this page**, from **freecadweb.org** to **freecad.org** in version 0.21 the link to this page was:\n\n**xmlns:freecad=\\\"http://www.freecadweb.org/wiki/index.php?title=Svg_Namespace\\\"**\n\nUpdated TechDraw templates now contain a key that can not activate the custom attributes when used with FreeCAD {{VersionMinus|0.20}} and as a result editable texts of recent templates are not recognised and so handled as plain text.\n\n: In such cases the \\\"web\\\" has to be manually re-inserted into the namespace declaration of the template.\n\nIt seems like (v0.21) can deal with either link address.\n\n## Usage\n\n\n
\n\n### Recap of an SVG file \n\n\n
\n\nTechDraw templates are SVG files used to create the framework of Technical drawings in FreeCAD while symbols add graphical annotation elements.\n\nThe SVG format is a subset of the XML format. That is why an SVG file, like any XML file, consists of two parts:\n\n- A **head** holding a format declaration.\n- A **body** containing the information what to show and where to place it\n\n#### Head\n\nThe head is just one line to declare which version of the XML language an interpreter should use to handle the instructions in the body.\n\n\n{{Code|lang=xml|code=\n\n}}\n\n#### Body\n\nThe Body of an SVG file starts with an opening {{Incode|}} tag which contains information about name spaces and about the size of the template and where to place it. And it finishes with a closing {{Incode|}} tag. All instructions to create and modify geometry and text elements will be inserted between both tags.\n\n\n{{Code|lang=xml|code=\n\n\n}}\n\nTags can hold attributes controlling the elements between the pair of opening and closing tags:\n\n: **xmlns=**\\\"\\\": External link to the xml name space to look up standard xml commands.\n: **version=**\\\"1.1\\\": The instructions set of xml version 1.1 is used.\n: **width=**\\\"420mm\\\": Width of the drawing area\n: **height=**\\\"297mm\\\": Height of the drawing area\n: **viewBox=**\\\"0 0 420 297\\\": Position of the upper left corner (0;0) and the lower right corner (420;297) in the svg construction space (in svg units).\n\nThe combination of {{Incode|width}}, {{Incode|height}}, and {{Incode|viewBox}} sets **1 svg-unit = 1 mm** for the whole document in order to enable up to scale printing, i.e. all dimensions in svg-units are interpreted as millimeters and a dimensional unit can be omitted from now on. (The example values define the area of an A3 sheet in landscape orientation)\n\n\n
\n\n\n
\n\n### Enable the FreeCAD namespace extension \n\nTo enable the [namespace extension](#Namespace_extension.md) the namespace declaration has to be added to the attributes of the opening {{Incode|}} tag. This results in a basic framework for a template file, a blank A3 sheet in landscape orientation prepared for {{Incode|freecad:}} [attributes](#Attributes.md):\n\n\n{{Code|lang=xml|code=\n\n\n\n}}\n\n## Attributes\n\nHaving the [FreeCAD namespace enabled](#Enable_the_FreeCAD_namespace_extension.md) the following {{Incode|freecad:}} attributes can now be used within opening {{Incode|}} tags in the SVG document:\n\n### freecad:editable\n\nThe freecad:editable attribute is used to mark editable texts in SVG files. The value of this attribute can be changed:\n\n- with the \\\"Change Editable Field\\\" dialog in templates.\n- by editing the list contained the Editable Texts property of symbols.\n\nDefault text has to be surrounded by tspan tags otherwise the displayed text within the template/symbol will not synchronise with modified variable content.\n\nExample:\n\n xml\n\n This is a title\n\n\n\n### freecad:autofill\n\n\n(v1.0) \n\n: Marks an editable text in a template to be filled automatically when a template is inserted. (This is added to an existing freecad:editable attribute)\n\nExample:\n\n xml\n\n This is a title\n\n\n\nThe following \\\"AutofillElements\\\" are implemented yet:\n\n1. freecad:autofill=\\\"author\\\" inserts the value of BaseApp/Preferences/Document/prefAuthor.\n2. freecad:autofill=\\\"date\\\" inserts the currentDateTime().\n3. freecad:autofill=\\\"organization\\\" inserts the value of BaseApp/Preferences/Document/prefCompany.\n4. freecad:autofill=\\\"scale\\\" inserts the page scale property.\n5. freecad:autofill=\\\"sheet\\\" inserts page number / page count.\n6. freecad:autofill=\\\"title\\\" inserts the value of the current document\\'s Label property.\n\n\n
\n\n### Recap of text handling \n\n\n
\n\nThe above examples are incomplete as they focus on the {{Incode|freecad:}} attributes only, but text needs some more information to be displayed in the desired place, with a specific style, and optionally a rotation.\n\nOmit attributes to use default values. This improves readability and results in a quite short and easy to maintain file.\n\nEach string of text is embedded between {{Incode|}} and {{Incode|}} tags. An editable text also has to be embedded between {{Incode|}} and {{Incode|}} tags or it won\\'t be editedable.\n\nTexts are inserted at {{Value|0;0}} by default. Insert the anchor point coordinates {{Incode|x}} and {{Incode|y}} in the {{Incode|}} tag to position the text as desired. Keep in mind the y direction in SVG file is downwards.\n\nIt is recommended to group texts that have several properties in common (i.e. embed text between {{Incode|}} and {{Incode|}} tags). This way common attributes can be defined in the group tag {{Incode|}} while individual attributes can be defined in the {{Incode|}} tag. Embedded text attributes override surrounding group attributes.\n\nExample:\n\n\n{{Code|lang=xml|code=\n\n A simple text\n another simple text\n\n}}\n\nIn this example both grouped texts are displayed using 10 mm high osifont and with their anchor points at the first character. The first is colored black (default color) the second is blue.\n\n\n{{Code|lang=xml|code=\n\n Editable text in blue. \n \n Centered editable text in red\n \n \n Rotated editable text in blue\n \n\n}}\n\nIn this example all three grouped editable texts are displayed using 15 mm high osifont in blue and with their anchor points at the first character. Text2 has the deviant color red and is centered, Text3 is rotated by 90° CW with the rotation center being coincident with the anchor point.\n\nThe examples use two different ways to set the font parameters, separate attributes in the first one and combined in a single style attribute in the second one.\n\nIt is recommended to use the ID attribute in group tags to describe roughly what kind elements are grouped.\n\nTransform attributes work well with all texts but editable texts will loose connection with their edit marks (blue underscores by default) as they won\\'t follow the movement of the text. That is why simple texts can be grouped with title block geometry and moved with a single translation but editable texts must be positioned individually. Rotations with matching anchor point and rotation center, in contrast to other transformations, are safe to be used in {{Incode|}} tags as text and edit mark will not move apart.\n\n\n
\n\n\n
\n\n### Example of code freecad:editable \n\n#### 1 : Title without textedit \n\n\"\"\n\n xml\n \n AUTHOR NAME :
\n\n\n#### 2 : Title with textedit \n\n\"\"\n\n xml\n \n AUTHOR NAME\n \n \n \n\n\n#### Explanations\n\n xml\n \n\n\nData on the framework\n\n xml\n AUTHOR NAME\n\n\nCoordinates and identity of the text that is displayed by default and **** means the end of the block text\n\n xml\n \n \n\n\nOther blocks texts and end **** the framework grouping text blocks\n\nIt is possible after having worked the Inkscape SVG file as the file no longer works, it is possible that information has gone missing.\n\nThen check that the edit text is not modified\n\nExample :\n\n- **editable** = \\\"AuthorName\\\"\n- replace by **freecad:editable** = \\\"AuthorName\\\"\n\n\n{{TechDraw Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Poweruser_Documentation](Category_Poweruser_Documentation.md) > [Developer](Category_Developer.md) > [Python_Code](Category_Python_Code.md) > [Macros](Category_Macros.md) > [TechDraw](Category_TechDraw.md) > Svg Namespace/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_Dimension_Angle3Pt.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_Dimension_Angle3Pt.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_Dimension_Angle3Pt.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "7f4e55a18e02d7148db59aced4c60bc494db446d8eb3883bc30d6962a6aeacbf", "bytes": 228, "tokens": 103, "text": "# TechDraw Dimension Angle3Pt/en\n1. REDIRECT [TechDraw_3PtAngleDimension/en](TechDraw_3PtAngleDimension/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw Dimension Angle3Pt/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_Dimension_Length.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_Dimension_Length.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_Dimension_Length.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "d23a41ef83cd311d126f68ae0618034cda483bd68102a8f34573dc18de8624df", "bytes": 220, "tokens": 89, "text": "# TechDraw Dimension Length/en\n1. REDIRECT [TechDraw_LengthDimension/en](TechDraw_LengthDimension/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw Dimension Length/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_ExtensionCreateVertChamferDimension.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_ExtensionCreateVertChamferDimension.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_ExtensionCreateVertChamferDimension.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "dd5402c4a2e3d7acdfee2449818d9ecc2248191f93e7c87cedbd7af9732a22d8", "bytes": 1863, "tokens": 619, "text": "---\n GuiCommand:\n Name: TechDraw ExtensionCreateVertChamferDimension\n MenuLocation: TechDraw , Extensions: Dimensions , Create Vertical Chamfer Dimension\n Workbenches: TechDraw_Workbench\n Shortcut: \n Version: 0.20\n SeeAlso: TechDraw_ExtensionCreateHorizChamferDimension\n---\n\n# TechDraw ExtensionCreateVertChamferDimension/en\n\n## Description\n\nThe **TechDraw ExtensionCreateVertChamferDimension** tool creates a vertical size and angle dimension for a chamfer.\n\n\"\" \n*On the right the created dimension*\n\n## Usage\n\n1. Select two vertexes.\n2. There are several ways to invoke the tool:\n - \n (v1.0) \n \n : If the **Dimensioning tools** [preference](TechDraw_Preferences#Dimensions.md) is set to {{Value|Single tool}} (default): press the down arrow to the right of the **** button and select the ** Create Vertical Chamfer Dimension** option from the dropdown.\n\n - If this preference has a different value (and in {{VersionMinus|0.21}}): press the ** [Create Vertical Chamfer Dimension](TechDraw_ExtensionCreateVertChamferDimension.md)** button.\n\n - Select the **TechDraw → Extensions: Dimensions → Create Vertical Chamfer Dimension** option from the menu.\n3. A chamfer dimension is created.\n\n\n{{TechDraw_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw ExtensionCreateVertChamferDimension/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_ExtensionDrawCirclesGroup.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_ExtensionDrawCirclesGroup.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_ExtensionDrawCirclesGroup.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "8bfa78635d7587554f44954afc2b1fcf6c4f5a879be0a78a6a63f9348d1cdde8", "bytes": 296, "tokens": 121, "text": "# TechDraw ExtensionDrawCirclesGroup/en\n1. REDIRECT [TechDraw_Workbench/en#TechDraw_ExtensionDrawCirclesGroup](TechDraw_Workbench/en#TechDraw_ExtensionDrawCirclesGroup.md)\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw ExtensionDrawCirclesGroup/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_GeomHatch.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_GeomHatch.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_GeomHatch.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c0053d9e2c664d94f74b5c51785fc2f34289b60b625f2f4af9a54039d49dd0dc", "bytes": 204, "tokens": 89, "text": "# TechDraw GeomHatch/en\n1. REDIRECT [TechDraw_GeometricHatch/en](TechDraw_GeometricHatch/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw GeomHatch/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_Hatching.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_Hatching.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_Hatching.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e9945372269444aae0a208e84ac479946074e857a265a9b84298a9b5cd4debc4", "bytes": 3381, "tokens": 1348, "text": "# TechDraw Hatching/en\n## Description\n\nThe TechDraw workbench includes two hatching tools:\n\n- \"\" [TechDraw Hatch](TechDraw_Hatch.md) (based on tiled SVG or bitmap images)\n- \"\" [TechDraw GeometricHatch](TechDraw_GeometricHatch.md) (line based)\n\n## Image based hatch \n\n\"\" [TechDraw Hatch](TechDraw_Hatch.md) uses tiled [SVG](SVG.md) or bitmap ((v0.21) ) images to cover the selected Face. The origin of the tiling grid will match the geometric center of the face.\n\n[SVG](SVG.md) tiles are typically **64x64** pixel images. All pattern files that come with FreeCAD are available on [GitHub](https://github.com/FreeCAD/FreeCAD/tree/master/src/Mod/TechDraw/Patterns).\n\nBitmap based patterns are displayed with a fixed resolution of 10 px/mm relative to the page.\n\nThe default hatch pattern file can be specified in the [TechDraw Preferences](TechDraw_Preferences.md).\n\n### Available SVG patterns \n\nImage:Aluminium.svg\\|aluminium Image:Brick01.svg\\|brick01 Image:Concrete.svg\\|concrete Image:Cross.svg\\|cross Image:Cuprous.svg\\|cuprous Image:Diagonal1.svg\\|diagonal1 Image:Diagonal2.svg\\|diagonal2 Image:Earth.svg\\|earth Image:General_steel.svg\\|general_steel Image:Glass.svg\\|glass Image:Hatch45L.svg\\|hatch45L Image:Hatch45R.svg\\|hatch45R Image:Hbone.svg\\|hbone Image:Line.svg\\|line Image:Plastic.svg\\|plastic Image:Plus.svg\\|plus Image:Simple.svg\\|simple Image:Solid.svg\\|solid Image:Square.svg\\|square Image:Steel.svg\\|steel Image:Titanium.svg\\|titanium Image:Wood.svg\\|wood Image:Woodgrain.svg\\|woodgrain Image:Zinc.svg\\|zinc\n\n## Geometric hatch \n\n\"\" [TechDraw GeometricHatch](TechDraw_GeometricHatch.md) forms a pattern of lines based on a specification read from a file. This file is generally compatible with the widely used AutoDesk® PAT format. A small selection of patterns is included in the FCPAT.pat file:\n\n\n```python\n; standard PAT patterns\n\n*Diamond, 45 diagonals L & R, Solid, 1.0 mm separation\n45,0,0,0,1.0\n-45,0,0,0,1.0\n*Diamond2, 45 diagonals L & R, Solid, 2.0 mm separation\n45,0,0,0,2.0\n-45,0,0,0,2.0\n*Diamond4, 45 diagonals L & R, Solid, 4.0 mm separation\n45,0,0,0,4.0\n-45,0,0,0,4.0\n*Diagonal4, 45 diagonal R, Solid, 4.0 mm separation\n45,0,0,0,4.0\n*Diagonal5, 45 diagonal L, Solid, 4.0 mm separation\n-45,0,0,0,4.0\n*Square, square grid, Solid, 5.0 mm separation \n90,1,1,0,5.0\n0,0,0,1,5.0\n*Horizontal5, horizontal lines, Solid 5.0 separation\n0,0,0,0,5.0\n*Vertical5, vertical lines, Solid, 5.0 separation\n90,0,0,0,5.0\n```\n\nYou can add your own patterns if you have write permission to FCPAT.pat, or you can create your own \\*.pat file and point to it in [TechDraw Preferences](TechDraw_Preferences.md).\n\n### PAT File Path \n\nThe `FCPAT.pat` file can be found in the following location.\n\n- **Windows**: `C:\\Program Files\\FreeCAD\\data\\Mod\\TechDraw\\PAT\\`\n- **Mac**: `/Applications/FreeCAD.app/Contents/Mod/TechDraw/PAT/`\n- **Linux**: `/usr/share/freecad/Mod/TechDraw/PAT/`\n - *freecad-daily PPA*: `/usr/share/freecad-daily/Mod/TechDraw/PAT/`\n\n\n{{TechDraw_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw Hatching/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_SectionView.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_SectionView.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_SectionView.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "b25238816357fa569032cf37668a56a553ce27d57f0ffc640e3ca2d9183a7d68", "bytes": 7417, "tokens": 2336, "text": "---\n GuiCommand:\n Name: TechDraw SectionView\n MenuLocation: TechDraw , TechDraw Views , Insert Section View\n Workbenches: TechDraw_Workbench\n SeeAlso: TechDraw_ComplexSection, TechDraw_View\n---\n\n# TechDraw SectionView/en\n\n## Description\n\nThe **TechDraw SectionView** tool inserts a cross-section view based on an existing part view.\n\n\"\"\n\"\" \n*Sectioning an already placed view, which shows the internal holes and a hatched cut surface.
\nThe top image shows the ANSI arrow format.
\nThe bottom image shows the ISO arrow format.\n*\n\n## Usage\n\n1. Select a part view in the [3D view](3D_view.md) or [Tree view](Tree_view.md).\n2. There are several ways to invoke the tool:\n - Press the ** [Insert Section View](TechDraw_SectionView.md)** button.\n - Select the **TechDraw → TechDraw Views → Insert Section View** option from the menu.\n3. A task panel opens which will help calculate the various properties. Reasonable values for the view Direction are calculated, but these can be changed.\n\n![](images/TechDraw_Section_Taskview.png ) \n*Taskview to define the sectional cut of a view*\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nIn the properties of the **Base View** you can change the appearance of the section line.\n\nA Section View, formally a {{Incode|TechDraw::DrawViewSection}} object, is derived from a [Part View](TechDraw_View#Properties_Part_View.md), formally a {{Incode|TechDraw::DrawViewPart}} object, and inherits all its properties. It also has the following additional properties:\n\n### Data\n\n\n{{TitleProperty|Appearance}}\n\n- **Section Line Stretch|FloatConstraint**: Adjusts the length of the section line. {{Value|1.0}} is normal length, {{Value|1.1}} would be 10% longer, {{Value|0.9}} would be 10% shorter. (v1.0) \n\n\n{{TitleProperty|Cut Operation}}\n\n- **Fuse Before Cut|Bool**: Fuse the source shapes before performing the section cut.\n\n- **Trim After Cut|Bool**: Additionally trim the resulting shape after the section cut to remove any unwanted pieces. (v0.21) \n\n- **Use Previous Cut|Bool**Use the cut shape from the base view instead of the original object. (v1.0) \n\n\n{{TitleProperty|Cut Surface Format}}\n\n- **Cut Surface Display|Enumeration**: Appearance of the cut surface. Options:\n\n - \n {{Value|Hide}}\n \n : Hides the cut surface, only the outline will be displayed.\n\n - \n {{Value|Color}}\n \n : Colors the cut surface using the setting of **Cut Surface Color** in the [TechDraw preferences](TechDraw_Preferences.md).\n\n - \n {{Value|SvgHatch}}\n \n : Hatches the section cut using a [hatch](TechDraw_Hatch.md)\n\n - \n {{Value|PatHatch}}\n \n : Hatches the section cut using a [geometric hatch](TechDraw_GeometricHatch.md)\n\n- **File Hatch Pattern|File**: Full path to SVG hatch pattern file.\n\n- **File Geom Pattern|File**: Full path to PAT pattern file.\n\n- **Svg Included|FileIncluded**: Full path to the included SVG hatch pattern file.\n\n- **Pat Included|FileIncluded**: Full path to the included PAT pattern file.\n\n- **Name Geom Pattern|String**: Name of the PAT pattern to use.\n\n- **Hatch Scale|Float**: Hatch pattern size adjustment.\n\n- **Hatch Rotation|Float**: Rotation of hatch pattern in degrees counter-clockwise. (v0.21) \n\n- **Hatch Offset|Vector|Hidden**: Hatch pattern offset. (v0.21) \n\n\n{{TitleProperty|Section}}\n\n- **Section Symbol|String**: The identifier for this section.\n\n- **Base View|Link**: The view on which this section is based.\n\n- **Section Normal|Vector**: A vector describing the direction normal to the cutting plane.\n\n- **Section Origin|Vector**: A vector describing a point on the cutting plane. Typically the centroid of the original part.\n\n- **Section Direction|Enumeration**: The direction in the Base View for this section. Options: {{Value|Aligned}}, {{Value|Right}}, {{Value|Left}}, {{Value|Up}} or {{Value|Down}}.\n\n### View\n\n\n{{TitleProperty|Cut Surface}}\n\n- **Cut Surface Color|Color**: Solid color for surface highlight. Used if **Cut Surface Display** is set to {{Value|Color}}.\n\n- **Show Cut Surface|Bool|Hidden**: Show/hide the cut surface.\n\n\n{{TitleProperty|Surface Hatch}}\n\n- **Geom Hatch Color|Color**: The color of the Geometric hath pattern.\n\n- **Hatch Color|Color**: The color of the Svg hatch pattern.\n\n- **Hatch Cut Surface|Bool|Hidden**: Hatch the cut surface.\n\n- **Weight Pattern|Float**: Line weight of the Geometric hatch pattern.\n\n## Notes\n\n- **Section Line Format**: two section line formats are supported (as depicted above) and controlled by the Preference setting \\\"Section Line Standard\\\" on the Annotation tab. The {{Value|ANSI}} option uses \\\"pulling arrows\\\" (known as the \\\"traditional format\\\" in some areas) and the {{Value|ISO}} option uses \\\"pushing arrows\\\" (also known as the \\\"reference arrow format\\\").\n- **Fuse Before Cut**: the section operation sometimes fails to cut the source shapes. If **Fuse Before Cut** is true, the source shapes are merged into a single shape before the section operation is attempted. If you encounter problems with the section operation, try flipping this value.\n- **Trim After Cut**: the section cut operation sometimes leaves behind a portion of the source shape. If **Trim After Cut** is true, an additional cut operation is performed on the result of the first cut which should remove any unwanted pieces.\n- **Cut Surface Display**: the cut surface can be hidden, painted in a solid color, hatched using an Svg pattern (default) or hatched using a PAT pattern. See [Hatching](TechDraw_Hatching.md).\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nA SectionView can be created with [macros](Macros.md) and from the [Python](Python.md) console by using the following functions:\n\n\n```python\ndoc = FreeCAD.ActiveDocument\nbox = doc.Box\npage = doc.Page\n\nview = doc.addObject(\"TechDraw::DrawViewPart\", \"View\")\npage.addView(view)\nview.Source = box\nview.Direction = (0, 0, 1)\n\nsection = doc.addObject(\"TechDraw::DrawViewSection\", \"Section\")\npage.addView(section)\nsection.Source = box\nsection.BaseView = view\nsection.Direction = (0, 1, 0)\nsection.SectionNormal = (-1, 0, 0)\n\ndoc.recompute()\n```\n\n## Examples\n\nFor some more information about section views and some use cases, have a look at: [TechDraw section examples](TechDraw_Section_Examples.md).\n\n\"\" \"\" \"\" \"\" \"\" \"\"\n\n\n{{TechDraw_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw SectionView/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_SpreadsheetView.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_SpreadsheetView.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_SpreadsheetView.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "ed0e201cf3f80a6cce02da5ff27e4a87a92f472861abf3f394ab50cf73dbc873", "bytes": 2717, "tokens": 869, "text": "---\n GuiCommand:\n Name: TechDraw SpreadsheetView\n MenuLocation: TechDraw , Views From Other Workbenches , Insert Spreadsheet View\n Workbenches: TechDraw_Workbench, Spreadsheet_Workbench\n---\n\n# TechDraw SpreadsheetView/en\n\n## Description\n\nThe **TechDraw SpreadsheetView** tool allows you to place a view of a selected [spreadsheet](Spreadsheet_Workbench.md) on a [Page](TechDraw_Workbench.md).\n\n\n(v1.0) \n\n: The [TechDraw View](TechDraw_View.md) tool can also create a Spreadsheet View.\n\n![](images/TechDraw_Spreadsheetview.png ) \n*Spreadsheet element inserted in the TechDraw drawing page*\n\n## Usage\n\n1. Select a spreadsheet in the [Tree view](Tree_view.md).\n2. If there are multiple drawing pages in the document: optionally add the desired page to the selection by selecting it in the [Tree view](Tree_view.md).\n3. Select the **TechDraw → Views From Other Workbenches → Insert Spreadsheet View** option from the menu.\n4. If there are multiple drawing pages in the document, and if no page is displayed in the [Main view area](Main_view_area.md) and you have not yet selected a page, the **Page Chooser** dialog box opens:\n 1. Select the desired page.\n 2. Press the **OK** button.\n5. A Spreadsheet View is inserted.\n6. Adjust the cell range of the view by changing its **Cell Start** and **Cell End** properties.\n\n## Properties\n\nSee also: [Property editor](Property_editor.md).\n\nA Spreadsheet View, formally a {{Incode|TechDraw::DrawViewSpreadsheet}} object, has the [properties](TechDraw_View#Properties_Part_View.md) that are common to all View types. It also has the following additional properties:\n\n### Data\n\n\n{{TitleProperty|Drawing view}}\n\n- **Symbol|String|Hidden**: The SVG code defining this symbol.\n\n- **Editable Texts|StringList|Hidden**: Substitution values for the editable strings in this symbol. Not used.\n\n- **Owner|Link**: Feature to which this symbol is attached. (v1.0) \n\n\n{{TitleProperty|Spreadsheet}}\n\n- **Source|Link**: The spreadsheet to be added to the page.\n\n- **Cell Start|String**: The top left cell of the cell range to be included in this view.\n\n- **Cell End|String**: The bottom right cell of the cell range to be included in this view.\n\n- **Font|Font**: The name of the font used for texts.\n\n- **Text Color|Color**: The color of texts and lines that have no color specified in the spreadsheet.\n\n- **Text Size|Float**: The font size of texts.\n\n- **Line Width|Float**: The width of the cell borders.\n\n\n{{TechDraw_Tools_navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw SpreadsheetView/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_TextLeader.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_TextLeader.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_TextLeader.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "c8dd26a28b1a64279aa8661ced5165433ed43553170f10de3f2ec283f39ac189", "bytes": 214, "tokens": 93, "text": "# TechDraw TextLeader/en\n1. REDIRECT [TechDraw_RichTextAnnotation/en](TechDraw_RichTextAnnotation/en.md)\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw TextLeader/en\n"} {"id": "freecad-docs:wiki/translations/en/TechDraw_WeldSymbol.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/TechDraw_WeldSymbol.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/TechDraw_WeldSymbol.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "36f6132d958694a57a0b5a30f80e2756ac328b10e442a08ec9aa54fabeda2752", "bytes": 5121, "tokens": 1671, "text": "---\n GuiCommand:\n Name: TechDraw WeldSymbol\n MenuLocation: TechDraw , Symbols , Add Welding Information to Leaderline\n Workbenches: TechDraw_Workbench\n Version: 0.19\n SeeAlso: TechDraw_LeaderLine\n---\n\n# TechDraw WeldSymbol/en\n\n## Description\n\nThe **TechDraw WeldingSymbol** tool adds welding specifications to an existing leader line.\n\n\"\" \n*Welding specification added to a leader line*\n\n## Usage\n\n1. Select an existing [leaderline](TechDraw_LeaderLine.md).\n2. There are several ways to invoke the tool:\n - Press the ** [Add Welding Information to Leaderline](TechDraw_WeldSymbol.md)** button.\n - Select the **TechDraw → Symbols → Add Welding Information to Leaderline** option from the menu.\n3. A task panel opens.\n4. Specify the welding symbols and accompanying text to be added to the leader line.\n5. Press the **OK** button.\n\n## Notes\n\n- After creation a welding symbol can be edited by double clicking it in the [Tree view](Tree_view.md).\n- There is a [preference parameter](TechDraw_Preferences.md) for the default welding symbol directory. You can add your own symbols in a personal directory.\n\n## Properties\n\n### Weld Symbol \n\n- **All Around**: Shows the *All Around* symbol (circle) at the kink in the leader line.\n\n- **Field Weld**: Show the *Field Weld* symbol (flag) at the kink in the leader line.\n\n- **Alternate Weld**: Offsets the lower symbol to indicate alternating welds.\n\n- **Tail Text**: Text to be shown at the end of the leader line.\n\n### Tile\n\nEach individual symbol (\\\"arrow side\\\" and \\\"other side\\\") is represented by a \\\"tile\\\" object. A Welding Symbol has 1 or 2 tiles associated with it. Each of it has the following properties:\n\n- **Tile Parent**: The parent Weld Symbol\n\n- **Tile Row**: Row of the tile. 0 means above the line, -1 below the line. **Note:** If you change the row of one tile, you must also change the tile for the second side! This way you can flip the sides.\n\n- **Tile Column**: Column of the tile. At the moment it is always 0, therefore the property is not editable.\n\n- **Symbol File**: Directory and file name of the symbol\\'s SVG file.\n\n- **Symbol Included**: Directory and file name of the actual included symbol SVG file. (It is a temporary directory.)\n\n- **Left Text**: Text to be displayed to the left of the SVG symbol.\n\n- **Center Text**: Text to be displayed above/below the SVG symbol.\n\n- **Right Text**: Text to be displayed to the right of the SVG symbol.\n\n## Scripting\n\nSee also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).\n\nThe WeldingSymbol tool can be used in [macros](Macros.md) and from the [Python](Python.md) console by using the following functions:\n\n\n```python\nsymbolName = \"DrawWeldSymbol001\")\nsymbolType = \"TechDraw::DrawWeldSymbol\"\nApp.activeDocument().addObject(symbolType, symbolName)\nApp.activeDocument().Page.addView(App.activeDocument().DrawWeldSymbol001)\nApp.activeDocument().DrawWeldSymbol001.Leader = myLeader\nApp.activeDocument().DrawWeldSymbol001.AllAround = True\nApp.activeDocument().DrawWeldSymbol001.FieldWeld = True\nApp.activeDocument().DrawWeldSymbol001.AlternatingWeld = True\nApp.activeDocument().DrawWeldSymbol001.TailText = \"process text\"\n\ntileName = \"DrawTileWeld001\"\ntileType = \"TechDraw::DrawTileWeld\"\nApp.activeDocument().addObject(tileType, tileName)\nApp.activeDocument().DrawTileWeld001.TileParent = App.activeDocument().DrawWeldSymbol001\nApp.activeDocument().DrawTileWeld001.TileRow = 0\nApp.activeDocument().DrawTileWeld001.TileColumn = 0\nApp.activeDocument().DrawTileWeld001.SymbolFile = fullPathToMySvgFile\nApp.activeDocument().DrawTileWeld001.LeftText = \"left text\"\nApp.activeDocument().DrawTileWeld001.RightText = \"right text\"\nApp.activeDocument().DrawTileWeld001.CenterText = \"center text\"\n```\n\n## Svg Symbol Tiles \n\nIndividual symbols are formed by 64x64 pixel SVG files. Additional symbols can be created in an SVG program like [Inkscape](https://en.wikipedia.org/wiki/Inkscape) using one of the symbols supplied by FreeCAD as a template.\n\n\"\" \"\"\n\n- Individual symbols are formed by 64x64 (nominal) pixel SVG files. The tiles actually have a \\\"border\\\" of 4px. The border ensures that the leader line and symbol meet nicely.\n- The symbol is drawn in black on a transparent background. The stroke width is 0.5mm.\n- The leader passes below symbols for the arrow side (see image on the left) and above symbols for the \\\"other\\\" side (see image on the right).\n- There is no particular naming standard other than to append \\\"Up/Down\\\" to the arrow/other side symbols.\n\n\n{{TechDraw Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [TechDraw](TechDraw_Workbench.md) > TechDraw WeldSymbol/en\n"} {"id": "freecad-docs:wiki/translations/en/Tracker.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Tracker.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Tracker.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "72a85e978df9447fdefddd3319655f00cb0f04833c510f5776abdd3fcb152ca7", "bytes": 10989, "tokens": 3450, "text": "# Tracker/en\n**In February 2022 FreeCAD bug tracking was migrated to [https://github.com/FreeCAD/FreeCAD/issues GitHub Issues]. The Mantis bug tracker described below is now in read-only mode.**\n\n![](images/Mantis_logo_262x90.png )\n\nThe [FreeCAD BugTracker](https://www.freecadweb.org/tracker) is the place toː report bugs, submit feature requests, patches, or request to merge your branch if you developed something using Git. The tracker is divided into \\'Workbenches\\', so please be specific and file your request in the appropriate subsection. In case of doubt, leave it in the \\\"FreeCAD\\\" section.\n\n## Recommended Workflow \n\n![](images/Bugreport-workflow.png )\n\nAs shown in the above flowchart, before creating tickets, please always first search the forums and bugtracker to discover if your issue is a known issue. This saves a lot of time/work for developers and volunteers that could be spending said time making FreeCAD even more awesome.\n\n## Reporting bugs \n\nIf you think you might have found a bug, you are welcome to report it as long as you have followed our step-by-step guidelinesː\n\n- Make sure you\\'re using the most up to date version of FreeCAD. **NOTEː** your bug may be fixed in the Development (unstable) version. The average user runs the stable version of FC.\n- Make sure your bug is really a bug, that is, something that should be working but isn\\'t. **Make sure the same bug hasn\\'t been reported before by first searching the bugtracker and forum**.\n - Rememberː if you aren\\'t sure, please don\\'t hesitate to explain your problem/bug in the [Help forum](http://forum.freecadweb.org/viewforum.php?f=3) and ask what to do.\n - **Note**ː before posting to the forum please read the [Forum Guidelines](https://forum.freecadweb.org/viewtopic.php?f=3&t=2264).\n- Describe as clearly as possible the problem, and how it can be reproduced. If we can not verify the bug, we might not be able to fix it.\n - This means **reporting in a clear, well-formatted, step-by-step fashion** so even an amateur user could reproduce.\n - Recommendedː **Screenshots** of the bug are also very helpful to include. Windows users: please do not attach screen captures in Word or PDF format. Use the Windows Snipping tool to save your capture as a PNG image.\n - Recommendedː Even better, an **Animated gif or Screencast** would also increase the likelihood of reproducing the issue.\n- **Add an example FreeCAD file** (.FCStd file) so devs/testers can quickly reproduce the bug.\n - Please don\\'t zip your \\*.FCStd file, it is already zipped.\n - File attachments are limited in size. If your \\*.FCStd file is too big to attach, you can use an online storage service (many are free like Google Drive, Microsoft OneDrive, Dropbox).\n- Include all the information from the \\\"Copy to Clipboard\\\" button in the **Help (menu) -\\> About FreeCAD** dialogue. Make sure your data includes your OCC or OCE version.\n- Please file one separate report for each bug.\n- If your bug causes a crash in FreeCAD and you\\'re on a system that supports it you can try running a **debug backtrace** and attach said trace to the ticket. This can save devs a lot of time pinpointing the source of the crash. See [Debugging](Debugging.md) for more details.\n\n## Requesting features \n\nIf you want something to appear in FreeCAD that is not implemented yet, it is not a bug but a feature request.\n\n1. **IMPORTANTː** Before requesting a potential Feature Request **please be certain that you are the first one doing so by searching the forums and the bugtracker**. If you have concluded that there are no pre-existing tickets/discussions the next step is toː\n2. Start a forum thread to discuss your feature request with the community via the [Open Discussion forum](http://forum.freecadweb.org/viewforum.php?f=8).\n3. Once the community agrees that this is a valid Feature, you then can open a ticket on the tracker (file it under *feature request* instead of *bug*).\n\n- **NOTE #1** To keep things organized please remember to link the forum thread URL into the ticket and the ticket number (as a link) in to the forum thread.\n- **NOTE #2** Keep in mind there are no guarantees that your wish will be fulfilled.\n\n![FreeCAD Bugtracker report page - use the dropdown to correctly designate what the ticket is](images/MantisBT-setting-Feature-Request.jpg )\n\n## Submitting patches \n\nIn case you have programmed a bug fix, an extension or something else that can be of public use in FreeCAD, submit your patch as a \\\"Pull Request\\\" at [GitHub](https://github.com/FreeCAD/FreeCAD).\n\n1. For a large, complex, or behavior-changing submission, open a forum thread in the [Developer subforum](https://forum.freecadweb.org/viewforum.php?f=10) to announce and discuss your patch. For small bugfixes this is not necessary.\n2. Submit your Pull Request (PR) to the [FreeCAD GitHub repo](http://github.com/FreeCAD/FreeCAD). The PR submission message will be pre-filled with a checklist for you to follow to ensure that your submission has the best chance at speedy acceptance. If you haven\\'t worked with `git` before or are unfamiliar with submitting a PR to github, please read our introduction to [github](Source_code_management.md) wiki page.\n3. Be present for the discussion, both in the forum and in the GitHub pull request, so that your code can potentially be merged more effectively.\n\n## Requesting merge \n\n(Same guidelines as [Submiting patches](https://www.freecadweb.org/wiki/Tracker#Submitting_patches))\n\nIf you have created a git branch containing changes that you would like to see merged into the FreeCAD code, you can ask there to have your branch reviewed and merged if the FreeCAD developers are OK with it. You must first publish your branch to a public git repository (github, gitlab, bitbucket, sourceforge etc\\...) and then give the URL of your branch in your merge request.\n\n## MantisBT Tips and Tricks \n\n### MantisBT Markup \n\nMantisBT (Mantis Bug Tracker) has it\\'s own unique markup.\n\n- **@**mention - works just like on GitHub where if you prepend \\'@\\' to someone\\'s username they will receive an email that they have been \\'mentioned\\' in a ticket thread\n\n\"\"\n\n- **\\#**1234 - By adding a hash tag in front of a number a shortcut to link to another ticket within MantisBT will present.\n\n : **Note**: if you hover over a ticket it will show you the summary + if the ticket is closed, it will be struck-through like #1234.\n\n\"\"\n\n- **\\~**5678 - a shortcut that links to a bug note within a ticket. This can be used to reference someone\\'s response within the thread. Each person that posts will show a unique \\~#### number next to their username. If you look at the image in the example, you see that the shortcut is referencing the *ticket number:comment number* of said ticket\n\n\"\"\n\n- **\\\\** - Using these tags will strikeout text.\n\n\"\"\n\n- **\\\\** - To present a line or block of code, use this tag and it will colorize and differentiate it elegantly.\n\n\"\"\n\n### MantisBT BBCode \n\nIn addition to the above [MantisBT Markup](Tracker#MantisBT_Markup.md) one also has the possibility to use BBCode format. For a comprehensive list see the [BBCode plus plugin page](https://github.com/mantisbt-plugins/BBCodePlus#supported-bbcode-tags). Here is a list of supported BBCode tagsː \n[img][/img] - Images\n[url][/url] - Links\n[email][/email] - Email addresses\n[color=red][/color] - Colored text\n[highlight=yellow][/highlight] - Highlighted text\n[size][/size] - Font size\n[list][/list] - Lists\n[list=1][/list] - Numbered lists (number is starting number)\n[*] - List items\n[b][/b] - Bold\n[u][/u] - underline\n[i][/i] - Italic\n[s][/s] - Strikethrough\n[left][/left] - Left align\n[center][/center] - Center\n[right][/right] - Right align\n[justify][/justify] - Justify\n[hr] - Horizontal rule\n[sub][/sub] - Subscript\n[sup][/sup] - Superscript\n[table][/table] - Table\n[table=1][/table] - Table with border of specified width\n[tr][/tr] - Table row\n[td][/td] - Table column\n[code][/code] - Code block\n[code=sql][/code] - Code block with language definition\n[code start=3][/code] - Code block with line numbers starting at number\n[quote][/quote] - Quote by *someone* (no name)\n[quote=name][/quote] - Quote by *name*\n\n\n=== MantisBT \\<=\\> GitHub Markup === Below are special MantisBT Source-Integration plugin keywords which will link to the FreeCAD GitHub repo. See [GitHub and MantisBT](Tracker#GitHub_and_MantisBT.md).\n\n- **c:FreeCAD:git commit hash:** - **c** stands for \\'commit\\'. FreeCAD stands for the FreeCAD GitHub repo. \\'git commit hash\\' is the specific git commit hash to reference. Note: the trailing colon is necessary. Exampleː cːFreeCADː709d2f325db0490016807b8fa6f49d1c867b6bd8ː\n- **d:FreeCAD:git commit hash:** - similar to the above, **d** stands for \\'diff\\' which will provide a Diff view of the commit. Exampleː dːFreeCADː709d2f325db0490016807b8fa6f49d1c867b6bd8ː\n- **p:FreeCAD:pullrequest:** - similar to the above, **p** stands for Pull Request. Exampleː pːFreeCADː498ː\n\n\"\" \n\n## GitHub and MantisBT \n\nThe FreeCAD bugtracker has a plug-in called [Source Integration](https://github.com/mantisbt-plugins/source-integration) which essentially ties both the FreeCAD GitHub repo to our MantisBT tracker. It makes it easier to track and associate git commits with their respective MantisBT tickets. **The Source Integration plugin scans the git commit messages for specific keywords in order to execute the following actions:**\n\n**Note** The below keywords need to be added in the git commit message and not the PR subject\n\n### Remotely referencing a ticket \n\nUsing this pattern will automagically associate a git commit to a ticket (**Note:** this will not close the ticket.) The format MantisBT will recognize:\n\n- bug #1234\n- bugs #1234, #5678\n- issue #1234\n- issues #1234, #5678\n- report #1234\n- reports #1234, #5678\n\nFor the inquisitive here is the regex MantisBT uses for this operation:\n\n\n### Remotely resolving a ticket \n\nThe format MantisBT will recognize:\n\n- fix #1234\n- fixed #1234\n- fixes #1234\n- fixed #1234, #5678\n- fixes #1234, #5678\n- resolve #1234\n- resolved #1234\n- resolves #1234\n- resolved #1234, #5678\n- resolves #1234, #5678\n\nFor the inquisitive here is the regex MantisBT uses for this operation:\n\n\n---\n⏵ [documentation index](../README.md) > [Developer Documentation](Category_Developer%20Documentation.md) > [Administration](Category_Administration.md) > Tracker/en\n"} {"id": "freecad-docs:wiki/translations/en/Translating_an_external_workbench.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Translating_an_external_workbench.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Translating_an_external_workbench.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "e5687d831d274dfda568f24b985926128e3dab8c931e085a95f3624a77cdf2c4", "bytes": 15042, "tokens": 4410, "text": "# Translating an external workbench/en\nIn the following notes, `\"context\"` should be your addon\\'s or workbench\\'s name, for example, `\"MySuperAddon\"` or `\"DraftPlus\"`, or whatever. Capitalization matters here: `\"Context\"` is not the same as `\"context\"` for example. The context makes it so that all translation of your code will be gathered under the same name, to be more easily identified by translators. That is, they will know exactly to which addon or workbench a particular string belongs.\n\n**Note**: Here is an all-in-one script that automates the complete procedure mentioned below (you are still advised to read the procedure to know what the script should do, though): \n\n## Preparing the sources \n\n### General\n\n- Add a `translations/` folder. You can name it to something else, but this will be easier as it is the same throughout FreeCAD. In this folder, you will place the `.ts` files (the \\\"source\\\" translation files) and `.qm` files (compiled translation files).\n- Only the text that is shown to the user in the FreeCAD UI should be translated. Text that is only shown in the Python console should not be translated.\n- Text that prints to the `FreeCAD.Console` is shown in the \\\"Report view\\\", and therefore should be translated. The \\\"Report view\\\" is different from the Python console.\n\n### In every Python .py file \n\n- In every file where you need to translate text, you need a `translate()` function defined. It must be named exactly `translate`: the string extractor relies on that exact name. You can use the fully-qualified name from Qt, but it\\'s a little cleaner to use:\n\n: \n \n```python\n import FreeCAD\n translate = FreeCAD.Qt.translate\n \n```\n \n\n- All text that must be translated must be passed through the `translate()` function:\n\n: \n \n```python\n print(\"My text\")\n \n```\n \n\n\n: becomes:\n\n\n: \n \n```python\n print(translate(\"context\", \"My text\"))\n \n```\n \n\n\n: Be aware that `translate()` is not just a normal function: it also serves as a \\\"tag\\\" for the `lupdate` text-processing utility, so must be named exactly \\\"translate\\\". The `lupdate` program is a simple text processor, it does not execute your code. You must pass string literals directly to the `translate()` function: you cannot pass variables, constants, etc. For example:\n\n\n: \n \n```python\n # This works:\n FreeCAD.Console.PrintMessage(translate(\"context\", \"My text\") + \"\\n\")\n\n # This does not, lupdate only sees the word \"a_variable\", and doesn't know what that is:\n a_variable = \"My text\"\n FreeCAD.Console.PrintMessage(translate(\"context\", a_variable ) + \"\\n\")\n\n # But this works -- a_variable will contain the translated string:\n a_variable = translate(\"context\", \"My text\")\n FreeCAD.Console.PrintMessage(a_variable + \"\\n\")\n \n```\n \n\n\n: This can be used anywhere: in `print()`, in `FreeCAD.Console.PrintMessage()`, in Qt dialogs, etc. The `FreeCAD.Console` functions do not automatically add the newline character (`\\n`), so this must be added at the end if desired. This character doesn\\'t need translation either, so it can be outside the translating function:\n\n\n: \n \n```python\n FreeCAD.Console.PrintMessage(translate(\"context\", \"My text\") + \"\\n\")\n \n```\n \n\n- If you are using `.ui` files made with QtDesigner, nothing special needs to be done with them.\n- When creating new objects, do not translate the object\\'s \\\"Name\\\". Rather, translate the object\\'s \\\"Label\\\". The difference is that a \\\"Name\\\" is unique; it stays the same throughout the life of the object; on the other hand, a \\\"Label\\\" can be changed by the user as desired.\n- When creating properties for your objects, don\\'t translate the property name. But place the description inside `QT_TRANSLATE_NOOP`:\n\n: \n \n```python\n obj.addProperty(\"App::PropertyBool\", \"MyProperty\", \"PropertyGroup\", QT_TRANSLATE_NOOP(\"App::Property\", \"This is what My Property does\"))\n \n```\n \n\n\n: Don\\'t use your own `\"context\"` in this specific case. Keep `\"App::Property\"`.\n\n### In InitGui.py \n\n- Add the following line near the top of the file:\n\n: \n \n```python\n def QT_TRANSLATE_NOOP(context, text):\n return text\n \n```\n \n\n\n: The `QT_TRANSLATE_NOOP` macro doesn\\'t do anything, but it marks texts to be picked up by the `lupdate` utility later on. We only use it in special cases where FreeCAD itself takes care of everything.\n\n- To translate menu and toolbar names use the word `\"Workbench\"` as the context:\n\n: \n \n```python\n self.appendMenu(QT_TRANSLATE_NOOP(\"Workbench\", \"My menu\"), [list of commands, ...])\n self.appendToolbar(QT_TRANSLATE_NOOP(\"Workbench\", \"My toolbar\"), [list of commands, ...])\n \n```\n \n\n- Add the path to your `translations/` folder and update the locale in the Initialized function:\n\n: \n \n```python\n FreeCADGui.addLanguagePath(\"/path/to/translations\")\n FreeCADGui.updateLocale()\n \n```\n \n\n\n: The `InitGui.py` file has no **file** attribute, so it is not easy to find the translations folder\\'s relative location. An easy way to work around this is to make it import another file from the same folder, and in that file do:\n\n\n: \n \n```python\n FreeCADGui.addLanguagePath(os.path.join(os.path.dirname(__file__), \"translations\"))\n FreeCADGui.updateLocale()\n \n```\n \n\n### Inside each FreeCAD command class \n\n- Add the following line near the top of the file:\n\n: \n \n```python\n def QT_TRANSLATE_NOOP(context, text):\n return text\n \n```\n \n\n- Translate the `'MenuText'` and `'Tooltip'` of the command like this:\n\n: \n \n```python\n def GetResources(self):\n return {'Pixmap' : \"path/to/icon.svg\"),\n 'MenuText': QT_TRANSLATE_NOOP(\"CommandName\", \"My Command\"),\n 'ToolTip' : QT_TRANSLATE_NOOP(\"CommandName\", \"Describes what the command does\"),\n 'Accel' : \"Shift+A\"\n }\n \n```\n \n\n\n: where `\"CommandName\"` is the name of the command, defined by:\n\n\n: \n \n```python\n FreeCADGui.addCommand('CommandName', My_Command_Class())\n \n```\n \n\n## Gather all the strings from your module \n\n- You will need the `lupdate`, `lconvert`, `lrelease` and `pylupdate` tools installed on your system. In Linux distributions they usually come in packages named `pyside-tools` or `pyside2-tools`. On some systems `lupdate` is named `lupdate4` or `lupdate5` or `lupdate-qt4` or similar. Same for the other tools. You may use the Qt4 or Qt5 version at your choice. In Qt6 there is no separate translation system for Python files, `lupdate` is used to extract strings from all types of source files.\n- If you have `.ui` files, you need to run `lupdate` first:\n\n: \n \n```python\n lupdate *.ui -ts translations/uifiles.ts\n \n```\n \n\n\n: This is recursive and will find `.ui` files inside your whole directory structure.\n\n- If you have `.py` files, you need to run `pylupdate` too:\n\n: \n \n```python\n pylupdate *.py -ts translations/pyfiles.ts\n \n```\n \n\n- If you ran both operations, you now need to unify these two files into one:\n\n: \n \n```python\n lconvert -i translations/uifiles.ts translations/pyfiles.ts -o translations/MyModule.ts\n \n```\n \n\n- Check the contents of the three `.ts` files to make sure that they contain the strings, then you can delete both `pyfiles.ts` and `uifiles.ts`.\n- You can do it all in one bash script like this:\n\n: \n \n```python\n #!/bin/sh\n lupdate *.ui -ts translations/uifiles.ts\n pylupdate *.py -ts translations/pyfiles.ts\n lconvert -i translations/uifiles.ts translations/pyfiles.ts -o translations/MyModule.ts\n rm translations/pyfiles.ts\n rm translations/uifiles.ts\n \n```\n \n\n## Send the .ts file to a translation platform \n\nIt is time to have your `.ts` file translated. You can choose to set up an account on a public translation platform such as [Crowdin](https://crowdin.com/) or [Transifex](https://www.transifex.com/), or you can benefit from our existing [FreeCAD-addons account at Crowdin](https://crowdin.com/project/freecad-addons), which has many users already, and therefore more chance to have your file translated quickly and by people who know FreeCAD.\n\nIf you wish to host your file on the FreeCAD Crowdin account, get in touch with [Yorik](https://forum.freecadweb.org/memberlist.php?mode=viewprofile&u=68) on the [FreeCAD forum](https://forum.freecadweb.org/).\n\n\n**Note:**\n\nsome platforms like Crowdin can integrate with GitHub and do all the process from points 2, 3 and 4 automatically. For that, you can\\'t use the FreeCAD Crowdin account; you will need to set up your own account.\n\n## Merge the translations \n\nOnce your `.ts` file has been translated, even if partially, you can download the translations from the site:\n\n- You will usually download a `.zip` file containing one `.ts` per language\n- Place all the translated `.ts` files, together with your base `.ts` file, in the `translations/` folder\n\n## Compile the translations \n\nNow run the `lrelease` program on each file that you have:\n\n\n```python\nlrelease \"translations/Draft_de.ts\"\nlrelease \"translations/Draft_fr.ts\"\nlrelease \"translations/Draft_pt-BR.ts\"\n```\n\nYou can automate the process:\n\n\n```python\nfor f in translations/*_*.ts\ndo\n lrelease \"translations/$f\"\ndone\n```\n\nYou should find one `.qm` file for each translated `.ts` file. The `.qm` files is what will be used by Qt and FreeCAD at runtime.\n\nThat\\'s all you need. Note that certain parts of your workbench cannot be translated on-the-fly if you decide to switch languages. If this is the case, you will need to restart FreeCAD for the new language to take effect.\n\n## Testing translations \n\n1. Switch FreeCAD to a language you have translated (for example German)\n2. Load translation into FreeCAD, ex. `FreeCADGui.addTranslationPath(\"/path/to/the/folder/containing/qmfile\")`\n3. Test something, for example `FreeCAD.Qt.translate(\"your context\",\"some string\")`\n\nResult: This should give you the German translation. If this works, then the basic setup is OK. Then we can look at something else. For example, command names should always use a special context that is the name of the command as registered to FreeCAD.\n\n### Important notes \n\n- Make sure you are using a \\*context\\* and \\*string\\* that actually are in the ts/qm file of course.\n\n## Convenience script \n\nYorik maintains a convenience script for the BIM workbench, that can gather, upload and download ts files. You can just copy and adapt that script for your workbench:\n\n\n\n## Technical details and advanced usage \n\nIn the above examples there are two separate functions being used: `translate()` and `QT_TRANSLATE_NOOP`. You may also run across `tr()` and `QT_TR_NOOP`, which automatically provide the \\\"context\\\" argument based on their calling location. These two pairs of functions are fundamentally different.\n\n\n`translate()`\n\nand `tr()` accomplish two separate tasks: at runtime they perform the actual translation from the string passed into them to the final translated string. This is true whether they are provided a literal string, or a variable, or a constant: the lookup is dynamic and real-time during the run of the code. However, they provide an additional non-runtime function: they are recognized by the `pylupdate` utility. If (and only if) they contain a string literal, that literal is extracted by the utility. ONLY string literals are extracted by `pylupdate` \\-- if a variable is passed it is ignored by the `pylupdate` utility. Qt will attempt to provide a translation at runtime, but this will only work if some other piece of code called one of the translation functions with the literal string that needs to be translated, so that `pylupdate` can extract it. Note that the code with the string literal need not actually ever execute, it must simply exist as a line of code in a file somewhere: `pylupdate` performs no analysis or code execution, it is simply performing a string search and extraction.\n\nIn contrast, `QT_TRANSLATE_NOOP` and `QT_TR_NOOP` do nothing at all at runtime: they are literal \\\"no-ops\\\", and are completely ignored by running code. Their only use is to mark a literal string for extraction by `pylupdate`: it never makes sense to place a variable within a call to one of these functions, it will have no effect. They are used in circumstances where `translate()` or `tr()` will be called with a variable containing the text to translate. For example, any code that is used to create a Command or a Property will use a NOOP-type function around the command menu text or tooltip, or the property docstring: at runtime when FreeCAD displays these items to the user it calls `translate()`: the literal strings must have been extracted by `pylupdate` at the point of creation, for example:\n\n\n```python\ndef GetResources(self):\n return {'Pixmap' : \"path/to/icon.svg\",\n 'MenuText': QT_TRANSLATE_NOOP(\"CommandName\", \"My Command\"),\n 'ToolTip' : QT_TRANSLATE_NOOP(\"CommandName\", \"Describes what the command does\"),\n 'Accel' : \"Shift+A\"\n }\n```\n\nIn this usage, at runtime the dictionary returned by this function is literally:\n\n\n```python\n{ \n 'Pixmap' : \"path/to/icon.svg\",\n 'MenuText': \"My Command\",\n 'ToolTip' : \"Describes what the command does\",\n 'Accel' : \"Shift+A\"\n}\n```\n\nThere is no reference to any type of translation information. When FreeCAD actually displays this information to the user, the pseudo-code is:\n\n\n```python\nfor command in commands:\n resources = command.GetResources()\n menu_text = translate(resources['MenuText'])\n```\n\nIn this case, `lupdate` cannot extract any string from the call to `translate()` because it refers to a variable. So `lupdate` ignores that call, but at runtime Qt searches for the string that\\'s passed to it. As long as someplace in the code there is a call to one of the translation functions with a matching literal string (in this case, in the `GetResources()` function), this translation call will succeed.\n\nTo verify that the expected strings are being extracted, you can manually run the `pylupdate` command:\n\n\n```python\npylupdate myfile.py -ts outfile.ts\n```\n\nThe file `outfile.ts` will contain the set of strings that are uploaded to CrowdIn for translation.\n\n## Important references \n\n- Why and how to translate `openCommand()` functions ([forum thread](https://forum.freecadweb.org/viewtopic.php?f=10&t=55869))\n\n## Related Pages \n\n- [External Workbenches](External_Workbenches.md)\n- [Localisation](Localisation.md)\n- For more information make your requests here: [Translating external workbenches](https://forum.freecadweb.org/viewtopic.php?f=10&t=36413).\n\n\n---\n⏵ [documentation index](../README.md) > [Developer Documentation](Category_Developer%20Documentation.md) > Translating an external workbench/en\n"} {"id": "freecad-docs:wiki/translations/en/Tutorial_KinematicAssembly.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Tutorial_KinematicAssembly.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Tutorial_KinematicAssembly.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "63e113ac605073dc58907a0b260273c28c227d144829daee382cb20bc7b02cfc", "bytes": 8450, "tokens": 2621, "text": "---\n TutorialInfo:\n Topic: Assembly3, a simple mechanism\n Level: Basic knowledge of Assembly3 tools is helpful\n FCVersion: 0.20 and later\n Time: 30 minutes\n Author: User:FBXL5\n---\n\n# Tutorial KinematicAssembly/en\n\n\n## Introduction\n\nThis tutorial is about how to set up a simple mechanism, mainly with the tools from the external \"\" [Assembly3 Workbench](Assembly3_Workbench.md).\n\nThe kinematic assembly we will create consists of four parts: a Base, a Slider, a Crank, and a connecting Rod. They are connected with four joints.\n\n\"\" \n*Assembled parts: Base (amber), Slider (light blue), Crank (red), connecting Rod (green)*\n\n## Assembly\n\n### Parts\n\nThe **Base** is an object with two main geometries, a hole and a pin. Both are cylindrical. The rest of the shape is not relevant for this tutorial unless it causes clashes. The same goes for the other parts.\n\n\"\"\n\nThe **Slider** consists of a shaft with a pin on one end. Both are cylindrical.\n\n\"\"\n\nThe **Crank** has a hole and a pin. Again both are cylindrical.\n\n\"\"\n\nThe **Rod** has two cylindrical holes.\n\n\"\"\n\n### Joints\n\n#### Locked Base \n\nTo keep the assembly at the desired position, the base part should be locked.\n\n: (If the \"\" [Lock mover](Assembly3_LockMover.md) command is activated, motion tools are deactivated as long as a locked part is selected.)\n\n1. Select one face of the Base.\n2. Press the button ** [Create \"Locked\" constraint](Assembly3_ConstraintLock.md)** to keep the Base in place permanently.\n\n\"\" \"\" \"\" \n*Selected face → Resulting Element*\n\nThen all four parts are connected with four joints. The kinematic chain starts at the base.\n\n#### Base-to-Slider joint \n\nThe Base-to-Slider joint is a **cylindrical joint**. It enables the Slider to slide along and spin around the Base hole\\'s Z axis while keeping both elements\\' Z axes aligned (colinear).\n\nThe matching constraint is the \\\"AxialAlignment\\\" constraint. It works with elements that represent cylindrical geometry such as cylindrical faces, circular faces and circular edges.\n\n1. Select the cylindrical faces of the Base hole and the Slider shaft.\n2. Press the button ** [Create \"AxialAlignment\" constraint](Assembly3_ConstraintAxial.md)**.\n3. Optionally relabel the created elements (edit their **Label** property).\n\n\"\" \"\" \"\" \n*Selected faces → Aligned objects*\n\n#### Base-to-Crank joint \n\nThe Base-to-Crank joint is a **hinge joint**. It enables the Crank to spin around the Base pin\\'s Z axis while keeping both elements\\' Z axes aligned (colinear) and the offset between their XY planes constant.\n\nThe matching constraint is the \\\"PlaneCoincident\\\" constraint. It works with elements that represent planar geometry such as circular faces and circular edges (in this case).\n\n1. Select the circular face or the outer circular edge of the Base pin, and the outer circular edge of the Crank hole.\n2. Press the button ** [Create \"PlaneCoincident\" constraint](Assembly3_ConstraintCoincidence.md)**.\n3. Optionally relabel the created elements.\n\n\"\" \"\" \"\" \n*Selected face and edge → Aligned objects*\n\n#### Slider-to-Rod joint \n\nThe Slider-to-Rod joint is a **hinge joint**. It enables the Rod to spin around the Slider pin\\'s Z axis while keeping both elements\\' Z axes aligned (colinear) and the offset between their XY planes constant.\n\nThe matching constraint is the \\\"PlaneCoincident\\\" constraint (see above).\n\n1. Select the circular face or the outer circular edge of the Slider pin, and the outer circular edge of the Rod hole.\n2. Press the button ** [Create \"PlaneCoincident\" constraint](Assembly3_ConstraintCoincidence.md)**.\n3. Optionally relabel the created elements.\n\n\"\" \"\" \"\" \n*Selected face and edge → Aligned objects*\n\n#### Crank-to-Rod joint \n\nThe Crank-to-Rod joint is a **cylindrical joint**. It enables the Rod to spin around and slide along the Crank pin\\'s Z axis while keeping both elements\\' Z axes aligned (colinear). But only spinning will be possible as the sliding movement is restricted through the combination of the Base-to-Crank joint and the Slider-to-Rod joint.\n\nThe matching constraint is the \\\"AxialAlignment\\\" constraint (see above).\n\n1. Select the cylindrical faces of the Crank pin and the Rod hole.\n2. Press the button ** [Create \"AxialAlignment\" constraint](Assembly3_ConstraintAxial.md)**.\n3. Optionally relabel the created elements.\n\n\"\" \"\" \"\" \n*Selected faces → Aligned objects*\n\n#### Redundant Constraints \n\nWhen the Base is fixed and all four joints are constrained two messages appear in the [Report view](Report_view.md):\n\n- A warning (orange): \\\"\\...redundant constraints\\\".\n- A simple message (black): \\\"\\...dof remaining: 0\\\".\n\nThis combination of messages occurs when parts of an assembly are over-constrained but the solver is still able to find a valid solution. But what causes the redundacy?\n\nIt is the Z direction of the pins. If we take a look at the Slider pin for example we will notice that the Z axis of its element object is constrained parallel to the Base pin\\'s Z axis through the assembly chain Base-Crank-Rod-Slider. This means that the Slider pin is prevented from rotating around its X and Y axes.\n\n\"\"\n\nOn the other hand the rotation around the X axis (red) is already prevented by the Base-to-Crank joint; and so the corresponding degree of freedom (dof) is constrained twice (= redundant) and causes the warning.\n\n: To avoid this redundancy an auxilliary object and corresponding constraints could be inserted, but that is for some other tutorial.\n: To avoid double constraining the offset between base and Rod, different constraints were used, with only one of them fixing the motion along the Z axis.\n\n### Actuator\n\nNow it is still a static assembly. To turn it into a kinematic assembly one constraint has to be used as an actuator. To use the \\\"PlaneCoincident\\\" constraint of the Base-to-Crank joint as an actuator, we need to control the angle between Base pin and Crank. This can be done by setting the property **Lock Angle** to `True`. And for later use the label is marked with the suffix **.Driver**.\n\nThe **Angle** property can now be used to spin the Crank.\n\n\"\"\n\n## Controller\n\nTo have a dialog window to change property values without typing and with automatic recomputation would be nice.\n\nHave a look at the [Kinematic Controller](Tutorial_KinematicController.md) tutorial.\n\n\n---\n⏵ [documentation index](../README.md) > Tutorial KinematicAssembly/en\n"} {"id": "freecad-docs:wiki/translations/en/Web_BrowserRefresh.md", "source": "freecad-docs", "repository": "https://github.com/FreeCAD/FreeCAD-documentation", "revision": "0499378a238ce4c77c643b9cc4a03d0947381e45", "path": "wiki/translations/en/Web_BrowserRefresh.md", "url": "https://github.com/FreeCAD/FreeCAD-documentation/blob/0499378a238ce4c77c643b9cc4a03d0947381e45/wiki/translations/en/Web_BrowserRefresh.md", "license": "CC0-1.0", "encoding": "utf-8", "sha256": "33a0d8858a3a49f879e09a417efcbfcb51297bdb1b902ca0dbe72ff3c3b9e3f6", "bytes": 557, "tokens": 207, "text": "---\n GuiCommand:\n Name: Web BrowserRefresh\n MenuLocation: \n Workbenches: Web_Workbench, Start_Workbench\n SeeAlso: \n---\n\n# Web BrowserRefresh/en\n\n## Description\n\nThe \"\" **Web BrowserRefresh** command updates the current web page.\n\n## Usage\n\n1. Press the ** [Refresh web page](Web_BrowserRefresh.md)** button.\n\n\n{{Web Tools navi\n\n}}\n\n\n---\n⏵ [documentation index](../README.md) > [Web](Web_Workbench.md) > Web BrowserRefresh/en\n"} {"id": "grbl-docs:doc/markdown/interface.md", "source": "grbl-docs", "repository": "https://github.com/gnea/grbl", "revision": "bfb67f0c7963fe3ce4aaf8a97f9009ea5a8db36e", "path": "doc/markdown/interface.md", "url": "https://github.com/gnea/grbl/blob/bfb67f0c7963fe3ce4aaf8a97f9009ea5a8db36e/doc/markdown/interface.md", "license": "GPL-3.0-or-later; bundled Atmel files retain their BSD terms", "encoding": "utf-8", "sha256": "7c525a8bd4e09f7b6de9cc9efd0eba9844813279f26499a0e18478a3542333cb", "bytes": 55260, "tokens": 14771, "text": "# Grbl Interface Basics\n\nThe interface for Grbl is fairly simple and straightforward. With Grbl v1.1, steps have been taken to try to make it even easier for new users to get started, and for GUI developers to write their own custom interfaces to Grbl.\n\nGrbl communicates through the serial interface on the Arduino. You just need to connect your Arduino to your computer with a USB cable. Use any standard serial terminal program to connect to Grbl, such as: the Arduino IDE serial monitor, Coolterm, puTTY, etc. Or use one of the many great Grbl GUIs out there in the Internet wild.\n\nThe primary way to talk to Grbl is performed by sending it a string of characters, followed by a carriage return. Grbl will then process the string, set it up for execution, and then reply back with a **response message**, also terminated by a return, to tell you how it went. These command strings include sending Grbl: a G-code block to execute, commands to configure Grbl's system settings, to view how Grbl is doing, etc. \n\nTo stream a g-code program to Grbl, the basic interface is to send Grbl a line of g-code, then wait for the proper **response message** starting with an `ok` or `error`. This signals Grbl has completed the parsing and executing the command. At times, Grbl may not respond immediately. This happens when Grbl is busy doing something else or waiting to place a commanded motion into the look-ahead planner buffer. Other times, usually at the start of a program, Grbl may quickly respond to several lines, but nothing happens. This occurs when Grbl places a series of commanded motions directly in the planner queue and will try to fill it up completely before starting.\n\nAlong with **response messages**, Grbl has **push messages** to provide more feedback on what Grbl is doing and are also strings terminated by a return. These messages may be \"pushed\" from Grbl to the user in response to a query or to let the user know something important just happened. These can come at any time, but usually from something like a settings print out when asked to. **Push messages** are easily identified because they don't start with an `ok` or `error` like **response messages** do. They are typically placed in `[]` brackets, `<>` chevrons, start with a `$`, or a specific string of text. These are all defined and described later in this document.\n\nFinally, Grbl has **real-time commands** that are invoked by a set of special characters that may be sent at any time and are not part of the basic streaming send-response interface. These cause Grbl to immediately execute the command and typically don't generate a response. These include pausing the current motion, speed up/down everything, toggle the spindle during a job, reset Grbl, or query Grbl for a real-time status report. See the `Commands` document to see what they are and how they work.\n\n-------\n\n# Writing an Interface for Grbl\n\nThe general interface for Grbl has been described above, but what's missing is how to run an entire G-code program on Grbl, when it doesn't seem to have an upload feature. This is where this section fits in. Early on, users fiercely requested for flash drive, external RAM, LCD support, joysticks, or network support so they can upload a g-code program and run it directly on Grbl. The general answer to that is, good ideas, but Grbl doesn't need them. Grbl already has nearly all of the tools and features to reliably communicate with a graphical user interface (GUI) or a seperate host interface that provides all those extra bells and whistles. Grbl's base philosophy is to minimize what Grbl should be doing, because, in the end, Grbl needs to be concentrating on producing clean, reliable motion. That's it.\n\n\n## Streaming a G-Code Program to Grbl\n\nHere we will describe two different streaming methods for Grbl GUIs. One of the main problems with streaming to Grbl is the USB port itself. Arduinos and most all micro controllers use a USB-to-serial converter chip that, at times, behaves strangely and not typically how you'd expect, like USB packet buffering and delays that can wreak havoc to a streaming protocol. Another problem is how to deal with some of the latency and oddities of the PCs themselves, because none of them are truly real-time and always create micro-delays when executing other tasks. Regardless, we've come up with ways to ensure the G-code stream is reliable and simple. \n\nThe following streaming protocols require tracking the **response messages** to determine when to send the next g-code line. All **push messages** are not counted toward the streaming protocol and should be handled separately. All real-time command characters can be sent at any time and are never placed in Grbl's RX serial buffer. They are intercepted as they come in and simply sets flags for Grbl to execute them.\n\n#### Streaming Protocol: Simple Send-Response _[Recommended]_\nThe send-response streaming protocol is the most fool-proof and simplest method to stream a G-code program to Grbl. The host PC interface simply sends a line of G-code to Grbl and waits for an `ok` or `error:` **response message** before sending the next line of G-code. So, no matter if Grbl needs to wait for room in the look-ahead planner buffer to finish parsing and executing the last line of G-code or if the the host computer is busy doing something, this guarantees both to the host PC and Grbl, the programmed G-code has been sent and received properly. An example of this protocol is published in our `simple_stream.py` script in our repository.\n\nHowever, it's also the slowest of three outlined streaming protocols. Grbl essentially has two buffers between the execution of steps and the host PC interface. One of them is the serial receive buffer. This briefly stores up to 127 characters of data received from the host PC until Grbl has time to fetch and parse the line of G-code. The other buffer is the look-ahead planner buffer. This buffer stores up to 16 line motions that are acceleration-planned and optimized for step execution. Since the send-response protocol receives a line of G-code while the host PC waits for a response, Grbl's serial receive buffer is usually empty and under-utilized. If Grbl is actively running and executing steps, Grbl will immediately begin to execute and empty the look-ahead planner buffer, while it sends the response to the host PC, waits for the next line from the host PC, upon receiving it, parse and plan it, and add it to the end of the look-ahead buffer.\n\nAlthough this communication lag may take only a fraction of a second, there is a cumulative effect, because there is a lag with every G-code block sent to Grbl. In certain scenarios, like a G-code program containing lots of sequential, very short, line segments with high feed rates, the cumulative lag can be large enough to empty and starve the look-ahead planner buffer within this time. This could lead to start-stop motion when the streaming can't keep up with G-code program execution. Also, since Grbl can only plan and optimize what's in the look-ahead planner buffer, the performance through these types of motions will never be full-speed, because look-ahead buffer will always be partially full when using this streaming method. If your expected application doesn't contain a lot of these short line segments with high feed rates, this streaming protocol should be more than adequate for a vast majority of applications, is very robust, and is a quick way to get started.\n\n#### Streaming Protocol: Character-Counting _[**Recommended with Reservation**]_\n\nTo get the best of both worlds, the simplicity and reliability of the send-response method and assurance of maximum performance with software flow control, we came up with a simple character-counting protocol for streaming a G-code program to Grbl. It works like the send-response method, where the host PC sends a line of G-code for Grbl to execute and waits for a `response message`, but, rather than needing special XON/XOFF characters for flow control, this protocol simply uses Grbl's responses as a way to reliably track how much room there is in Grbl's serial receive buffer. An example of this protocol is outlined in the `stream.py` streaming script in our repo. This protocol is particular useful for very fast machines like laser cutters. \n\nThe main difference between this protocol and the others is the host PC needs to maintain a standing count of how many characters it has sent to Grbl and then subtract the number of characters corresponding to the line executed with each Grbl response. Suppose there is a short G-code program that has 5 lines with 25, 40, 31, 58, and 20 characters (counting the line feed and carriage return characters too). We know Grbl has a 128 character serial receive buffer, and the host PC can send up to 128 characters without overflowing the buffer. If we let the host PC send as many complete lines as we can without over flowing Grbl's serial receive buffer, the first three lines of 25, 40, and 31 characters can be sent for a total of 96 characters. When Grbl sends a **response message**, we know the first line has been processed and is no longer in the serial read buffer. As it stands, the serial read buffer now has the 40 and 31 character lines in it for a total of 71 characters. The host PC needs to then determine if it's safe to send the next line without overflowing the buffer. With the next line at 58 characters and the serial buffer at 71 for a total of 129 characters, the host PC will need to wait until more room has cleared from the serial buffer. When the next Grbl **response message** comes in, the second line has been processed and only the third 31 character line remains in the serial buffer. At this point, it's safe to send the remaining last two 58 and 20 character lines of the g-code program for a total of 110.\n\nWhile seemingly complicated, this character-counting streaming protocol is extremely effective in practice. It always ensures Grbl's serial read buffer is filled, while never overflowing it. It maximizes Grbl's performance by keeping the look-ahead planner buffer full by better utilizing the bi-directional data flow of the serial port, and it's fairly simple to implement as our `stream.py` script illustrates. We have stress-tested this character-counting protocol to extremes and it has not yet failed. Seemingly, only the speed of the serial connection is the limit.\n\n_RESERVATION:_\n\n- _If a g-code line is parsed and generates an error **response message**, a GUI should stop the stream immediately. However, since the character-counting method stuffs Grbl's RX buffer, Grbl will continue reading from the RX buffer and parse and execute the commands inside it. A GUI won't be able to control this. The interim solution is to check all of the g-code via the $C check mode, so all errors are vetted prior to streaming. This will get resolved in later versions of Grbl._\n\n\n## Interacting with Grbl's Systems\n\nAlong with streaming a G-code program, there a few more things to consider when writing a GUI for Grbl, such as how to use status reporting, real-time control commands, dealing with EEPROM, and general message handling.\n\n#### Status Reporting\nWhen a `?` character is sent to Grbl (no additional line feed or carriage return character required), it will immediately respond with something like `` to report its state and current position. The `?` is always picked-off and removed from the serial receive buffer whenever Grbl detects one. So, these can be sent at any time. Also, to make it a little easier for GUIs to pick up on status reports, they are always encased by `<>` chevrons.\n\nDevelopers can use this data to provide an on-screen position digital-read-out (DRO) for the user and/or to show the user a 3D position in a virtual workspace. We recommend querying Grbl for a `?` real-time status report at no more than 5Hz. 10Hz may be possible, but at some point, there are diminishing returns and you are taxing Grbl's CPU more by asking it to generate and send a lot of position data.\n\nGrbl's status report is fairly simply in organization. It always starts with a word describing the machine state like `IDLE` (descriptions of these are available elsewhere in the Wiki). The following data values are usually in the order listed below and separated by `|` pipe characters, but may not be in the exact order or printed at all. For a complete description of status report formatting, read the _Real-time Status Reports_ section below.\n\n#### Real-Time Control Commands\nThe real-time control commands, `~` cycle start/resume, `!` feed hold, `^X` soft-reset, and all of the override commands, all immediately signal Grbl to change its running state. Just like `?` status reports, these control characters are picked-off and removed from the serial buffer when they are detected and do not require an additional line-feed or carriage-return character to operate.\n\nOne important note are the override command characters. These are defined in the extended-ASCII character space and are generally not type-able on a keyboard. A GUI must be able to send these 8-bit values to support overrides. \n\n#### EEPROM Issues\nEEPROM access on the Arduino AVR CPUs turns off all of the interrupts while the CPU _writes_ to EEPROM. This poses a problem for certain features in Grbl, particularly if a user is streaming and running a g-code program, since it can pause the main step generator interrupt from executing on time. Most of the EEPROM access is restricted by Grbl when it's in certain states, but there are some things that developers need to know.\n\n* Settings should not be streamed with the character-counting streaming protocols. Only the simple send-response protocol works. This is because during the EEPROM write, the AVR CPU also shuts-down the serial RX interrupt, which means data can get corrupted or lost. This is safe with the send-response protocol, because it's not sending data after commanding Grbl to save data.\n\nFor reference:\n* Grbl's EEPROM write commands: `G10 L2`, `G10 L20`, `G28.1`, `G30.1`, `$x=`, `$I=`, `$Nx=`, `$RST=`\n* Grbl's EEPROM read commands: `G54-G59`, `G28`, `G30`, `$$`, `$I`, `$N`, `$#`\n\n#### G-code Error Handling\n\nGrbl's g-code parser is fully standards-compilant with complete error-checking. When a G-code parser detects an error in a G-code block/line, the parser will dump everything in the block from memory and report an `error:` back to the user or GUI. This dump is absolutely the right thing to do, because a g-code line with an error can be interpreted in multiple ways. However, this dump can be problematic, because the bad G-code block may have contained some valuable positioning commands or feed rate settings that the following g-code depends on.\n\nIt's highly recommended to do what all professional CNC controllers do when they detect an error in the G-code program, _**halt**_. Don't do anything further until the user has modified the G-code and fixed the error in their program. Otherwise, bad things could happen.\n\nAs a service to GUIs, Grbl has a \"check G-code\" mode, enabled by the `$C` system command. GUIs can stream a G-code program to Grbl, where it will parse it, error-check it, and report `ok`'s and `errors:`'s without powering on anything or moving. So GUIs can pre-check the programs before streaming them for real. To disable the \"check G-code\" mode, send another `$C` system command and Grbl will automatically soft-reset to flush and re-initialize the G-code parser and the rest of the system. This perhaps should be run in the background when a user first loads a program, before a user sets up his machine. This flushing and re-initialization clears `G92`'s by G-code standard, which some users still incorrectly use to set their part zero.\n\n#### Jogging\n\nAs of Grbl v1.1, a new jogging feature is available that accepts incremental, absolute, or absolute override motions, along with a jog cancel real-time command that will automatically feed hold and purge the planner buffer. The most important aspect of the new jogging motion is that it is completely independent from the g-code parser, so GUIs no longer have to ensure the g-code modal states are set back correctly after jogging is complete. See the jogging document for more details on how it works and how you can use it with an analog joystick or rotary dial.\n\n#### Synchronization\n\nFor situations when a GUI needs to run a special set of commands for tool changes, auto-leveling, etc, there often needs to be a way to know when Grbl has completed a task and the planner buffer is empty. The absolute simplest way to do this is to insert a `G4 P0.01` dwell command, where P is in seconds and must be greater than 0.0. This acts as a quick force-synchronization and ensures the planner buffer is completely empty before the GUI sends the next task to execute.\n\n-----\n# Message Summary\n\nIn v1.1, Grbl's interface protocol has been tweaked in the attempt to make GUI development cleaner, clearer, and hopefully easier. All messages are designed to be deterministic without needing to know the context of the message. Each can be inferred to a much greater degree than before just by the message type, which are all listed below.\n\n- **Response Messages:** Normal send command and execution response acknowledgement. Used for streaming.\n\n\t- `ok` : Indicates the command line received was parsed and executed (or set to be executed).\n\t- `error:x` : Indicated the command line received contained an error, with an error code `x`, and was purged. See error code section below for definitions.\n\n- **Push Messages:**\n\t\n\t- `< >` : Enclosed chevrons contains status report data.\n\t- `Grbl X.Xx ['$' for help]` : Welcome message indicates initialization.\n\t- `ALARM:x` : Indicates an alarm has been thrown. Grbl is now in an alarm state.\t\n\t- `$x=val` and `$Nx=line` indicate a settings printout from a `$` and `$N` user query, respectively.\n\t- `[MSG:]` : Indicates a non-queried feedback message.\n\t- `[GC:]` : Indicates a queried `$G` g-code state message.\n\t- `[HLP:]` : Indicates the help message.\n\t- `[G54:]`, `[G55:]`, `[G56:]`, `[G57:]`, `[G58:]`, `[G59:]`, `[G28:]`, `[G30:]`, `[G92:]`, `[TLO:]`, and `[PRB:]` messages indicate the parameter data printout from a `$#` user query.\n\t- `[VER:]` : Indicates build info and string from a `$I` user query.\n\t- `[echo:]` : Indicates an automated line echo from a pre-parsed string prior to g-code parsing. Enabled by config.h option.\n\t- `>G54G20:ok` : The open chevron indicates startup line execution. The `:ok` suffix shows it executed correctly without adding an unmatched `ok` response on a new line.\n\nIn addition, all `$x=val` settings, `error:`, and `ALARM:` messages no longer contain human-readable strings, but rather codes that are defined in other documents. The `$` help message is also reduced to just showing the available commands. Doing this saves incredible amounts of flash space. Otherwise, the new overrides features would not have fit.\n\nOther minor changes and bug fixes that may effect GUI parsing include:\n\n- Floating point values printed with zero precision do not show a decimal, or look like an integer. This includes spindle speed RPM and feed rate in mm mode.\n- `$G` reports fixed a long time bug with program modal state. It always showed `M0` program pause when running. Now during a normal program run, no program modal state is given until an `M0`, `M2`, or `M30` is active and then the appropriate state will be shown.\n\nOn a final note, this interface tweak came about out of necessity, as more data is being sent back from Grbl and it is capable of doing many more things. It's not intended to be altered again in the near future, if at all. This is likely the only and last major change to this. If you have any comments or suggestions before Grbl v1.1 goes to master, please do immediately so we can all vet the new alteration before its installed.\n\n\n---------\n\n# Grbl Response Messages\n\nEvery G-code block sent to Grbl and Grbl `$` system command that is terminated with a return will be parsed and processed by Grbl. Grbl will then respond either if it recognized the command with an `ok` line or if there was a problem with an `error` line.\n\n* **`ok`**: All is good! Everything in the last line was understood by Grbl and was successfully processed and executed.\n\n - If an empty line with only a return is sent to Grbl, it considers it a valid line and will return an `ok` too, except it didn't do anything.\n\n\n* **`error:X`**: Something went wrong! Grbl did not recognize the command and did not execute anything inside that message. The `X` is given as a numeric error code to tell you exactly what happened. The table below decribes every one of them.\n\n\t| ID | Error Code Description |\n|:-------------:|----|\n| **`1`** | G-code words consist of a letter and a value. Letter was not found. |\n| **`2`** | Numeric value format is not valid or missing an expected value. |\n| **`3`** | Grbl '$' system command was not recognized or supported. |\n| **`4`** | Negative value received for an expected positive value. |\n| **`5`** | Homing cycle is not enabled via settings. |\n| **`6`** | Minimum step pulse time must be greater than 3usec |\n| **`7`** | EEPROM read failed. Reset and restored to default values. |\n| **`8`** | Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job. |\n| **`9`** | G-code locked out during alarm or jog state |\n| **`10`** | Soft limits cannot be enabled without homing also enabled. |\n| **`11`** | Max characters per line exceeded. Line was not processed and executed. |\n| **`12`** | (Compile Option) Grbl '$' setting value exceeds the maximum step rate supported. |\n| **`13`** | Safety door detected as opened and door state initiated. |\n| **`14`** | (Grbl-Mega Only) Build info or startup line exceeded EEPROM line length limit. |\n| **`15`** | Jog target exceeds machine travel. Command ignored. |\n| **`16`** | Jog command with no '=' or contains prohibited g-code. |\n| **`17`** | Laser mode disabled. Requires PWM output. |\n| **`20`** | Unsupported or invalid g-code command found in block. |\n| **`21`** | More than one g-code command from same modal group found in block.|\n| **`22`** | Feed rate has not yet been set or is undefined. |\n| **`23`** | G-code command in block requires an integer value. |\n| **`24`** | Two G-code commands that both require the use of the `XYZ` axis words were detected in the block.|\n| **`25`** | A G-code word was repeated in the block.|\n| **`26`** | A G-code command implicitly or explicitly requires `XYZ` axis words in the block, but none were detected.|\n| **`27`**| `N` line number value is not within the valid range of `1` - `9,999,999`. |\n| **`28`** | A G-code command was sent, but is missing some required `P` or `L` value words in the line. |\n| **`29`** | Grbl supports six work coordinate systems `G54-G59`. `G59.1`, `G59.2`, and `G59.3` are not supported.|\n| **`30`**| The `G53` G-code command requires either a `G0` seek or `G1` feed motion mode to be active. A different motion was active.|\n| **`31`** | There are unused axis words in the block and `G80` motion mode cancel is active.|\n| **`32`** | A `G2` or `G3` arc was commanded but there are no `XYZ` axis words in the selected plane to trace the arc.|\n| **`33`** | The motion command has an invalid target. `G2`, `G3`, and `G38.2` generates this error, if the arc is impossible to generate or if the probe target is the current position.|\n| **`34`** | A `G2` or `G3` arc, traced with the radius definition, had a mathematical error when computing the arc geometry. Try either breaking up the arc into semi-circles or quadrants, or redefine them with the arc offset definition.|\n| **`35`** | A `G2` or `G3` arc, traced with the offset definition, is missing the `IJK` offset word in the selected plane to trace the arc.|\n| **`36`** | There are unused, leftover G-code words that aren't used by any command in the block.|\n| **`37`** | The `G43.1` dynamic tool length offset command cannot apply an offset to an axis other than its configured axis. The Grbl default axis is the Z-axis.|\n| **`38`** | Tool number greater than max supported value.|\n\n\n----------------------\n\n# Grbl Push Messages\n\nAlong with the response message to indicate successfully executing a line command sent to Grbl, Grbl provides additional push messages for important feedback of its current state or if something went horribly wrong. These messages are \"pushed\" from Grbl and may appear at anytime. They are usually in response to a user query or some system event that Grbl needs to tell you about immediately. These push messages are organized into six general classes:\n\n- **_Welcome message_** - A unique message to indicate Grbl has initialized.\n\n- **_ALARM messages_** - Means an emergency mode has been enacted and shut down normal use.\n\n- **_'$' settings messages_** - Contains the type and data value for a Grbl setting.\n\n- **_Feedback messages_** - Contains general feedback and can provide useful data.\n\n- **_Startup line execution_** - Indicates a startup line as executed with the line itself and how it went.\n\n- **_Real-time status reports_** - Contains current run data like state, position, and speed.\n\n\n------\n\n#### Welcome Message\n\n**`Grbl X.Xx ['$' for help]`**\n\nThe start up message always prints upon startup and after a reset. Whenever you see this message, this also means that Grbl has completed re-initializing all its systems, so everything starts out the same every time you use Grbl.\n\n* `X.Xx` indicates the major version number, followed by a minor version letter. The major version number indicates the general release, while the letter simply indicates a feature update or addition from the preceding minor version letter.\n* Bug fix revisions are tracked by the build info version number, printed when an `$I` command is sent. These revisions don't update the version number and are given by date revised in year, month, and day, like so `20161014`.\n\n-----\n\n#### Alarm Message\n\nAlarm is an emergency state. Something has gone terribly wrong when these occur. Typically, they are caused by limit error when the machine has moved or wants to move outside the machine travel and crash into the ends. They also report problems if Grbl is lost and can't guarantee positioning or a probe command has failed. Once in alarm-mode, Grbl will lock out all g-code functionality and accept only a small set of commands. It may even stop everything and force you to acknowledge the problem until you issue Grbl a reset. While in alarm-mode, the user can override the alarm manually with a specific command, which then re-enables g-code so you can move the machine again. This ensures the user knows about the problem and has taken steps to fix or account for it.\n\nSimilar to error messages, all alarm messages are sent as **`ALARM:X`**, where `X` is an alarm code to tell you exacly what caused the alarm. The table below describes the meaning of each alarm code.\n\n| ID | Alarm Code Description |\n|:-------------:|----|\n| **`1`** | Hard limit triggered. Machine position is likely lost due to sudden and immediate halt. Re-homing is highly recommended. |\n| **`2`** | G-code motion target exceeds machine travel. Machine position safely retained. Alarm may be unlocked. |\n| **`3`** | Reset while in motion. Grbl cannot guarantee position. Lost steps are likely. Re-homing is highly recommended. |\n| **`4`** | Probe fail. The probe is not in the expected initial state before starting probe cycle, where G38.2 and G38.3 is not triggered and G38.4 and G38.5 is triggered. |\n| **`5`** | Probe fail. Probe did not contact the workpiece within the programmed travel for G38.2 and G38.4. |\n| **`6`** | Homing fail. Reset during active homing cycle. |\n| **`7`** | Homing fail. Safety door was opened during active homing cycle. |\n| **`8`** | Homing fail. Cycle failed to clear limit switch when pulling off. Try increasing pull-off setting or check wiring. |\n| **`9`** | Homing fail. Could not find limit switch within search distance. Defined as `1.5 * max_travel` on search and `5 * pulloff` on locate phases. |\n\n-------\n\n#### Grbl `$` Settings Message\n\nWhen a push message starts with a `$`, this indicates Grbl is sending a setting and its configured value. There are only two types of settings messages: a single setting and value `$x=val` and a startup string setting `$Nx=line`. See [Configuring Grbl v1.x] document if you'd like to learn how to write these values for your machine.\n\n- `$x=val` will only appear when the user queries to print all of Grbl's settings via the `$$` print settings command. It does so sequentially and completes with an `ok`.\n\n - In prior versions of Grbl, the `$` settings included a short description of the setting immediately after the value. However, due to flash restrictions, most human-readable strings were removed to free up flash for the new override features in Grbl v1.1. In short, it was these strings or overrides, and overrides won. Keep in mind that once these values are set, they usually don't change, and GUIs will likely provide the assistance of translating these codes for users.\n\n - _**NOTE for GUI developers:**_ _As with the error and alarm codes, settings codes are available in an easy to parse CSV file in the `/doc/csv` folder. These are continually updated._\n\n - The `$$` settings print out is shown below and the following describes each setting.\n\n ```\n$0=10\n$1=25\n$2=0\n$3=0\n$4=0\n$5=0\n$6=0\n$10=255\n$11=0.010\n$12=0.002\n$13=0\n$20=0\n$21=0\n$22=0\n$23=0\n$24=25.000\n$25=500.000\n$26=250\n$27=1.000\n$30=1000\n$31=0\n$32=0\n$100=250.000\n$101=250.000\n$102=250.000\n$110=500.000\n$111=500.000\n$112=500.000\n$120=10.000\n$121=10.000\n$122=10.000\n$130=200.000\n$131=200.000\n$132=200.000\nok\n```\n\n\t| `$x` Code | Setting Description, Units |\n|:-------------:|----|\n| **`0`** | Step pulse time, microseconds |\n| **`1`** | Step idle delay, milliseconds |\n| **`2`** | Step pulse invert, mask |\n| **`3`** | Step direction invert, mask |\n| **`4`** | Invert step enable pin, boolean |\n| **`5`** | Invert limit pins, boolean |\n| **`6`** | Invert probe pin, boolean |\n| **`10`** | Status report options, mask |\n| **`11`** | Junction deviation, millimeters |\n| **`12`** | Arc tolerance, millimeters |\n| **`13`** | Report in inches, boolean |\n| **`20`** | Soft limits enable, boolean |\n| **`21`** | Hard limits enable, boolean |\n| **`22`** | Homing cycle enable, boolean |\n| **`23`** | Homing direction invert, mask |\n| **`24`** | Homing locate feed rate, mm/min |\n| **`25`** | Homing search seek rate, mm/min |\n| **`26`** | Homing switch debounce delay, milliseconds |\n| **`27`** | Homing switch pull-off distance, millimeters |\n| **`30`** | Maximum spindle speed, RPM |\n| **`31`** | Minimum spindle speed, RPM |\n| **`32`** | Laser-mode enable, boolean |\n| **`100`** | X-axis steps per millimeter |\n| **`101`** | Y-axis steps per millimeter |\n| **`102`** | Z-axis steps per millimeter |\n| **`110`** | X-axis maximum rate, mm/min |\n| **`111`** | Y-axis maximum rate, mm/min |\n| **`112`** | Z-axis maximum rate, mm/min |\n| **`120`** | X-axis acceleration, mm/sec^2 |\n| **`121`** | Y-axis acceleration, mm/sec^2 |\n| **`122`** | Z-axis acceleration, mm/sec^2 |\n| **`130`** | X-axis maximum travel, millimeters |\n| **`131`** | Y-axis maximum travel, millimeters |\n| **`132`** | Z-axis maximum travel, millimeters |\n\n\n- The other `$Nx=line` message is the print-out of a user-defined startup line, where `x` denotes the startup line order and ranges from `0` to `1` by default. The `line` denotes the startup line to be executed by Grbl upon reset or power-up, except during an ALARM.\n\n - When a user queries for the startup lines via a `$N` command, the following is sent by Grbl and completed by an `ok` response. The first line sets the initial startup work coordinate system to `G54`, while the second line is empty and does not execute.\n ```\n $N0=G54\n $N1=\n ok\n ```\n\n\n------\n\n#### Feedback Messages\n\nFeedback messages provide non-critical information on what Grbl is doing, what it needs, and/or provide some non-real-time data for the user when queried. Not too complicated. Feedback message are always enclosed in `[]` brackets, except for the startup line execution message which begins with an open chevron character `>`.\n\n- **Non-Queried Feedback Messages:** These feedback messages that may appear at any time and is not part of a query are listed and described below. They are usually sent as an additional helpful acknowledgement of some event or command executed. These always start with a `[MSG:` to denote their type.\n\n - `[MSG:Reset to continue]` - Critical event message. Reset is required before Grbl accepts any other commands. This prevents ongoing command streaming and risking a motion before the alarm is acknowledged. Only hard or soft limit errors send this message immediately after the ALARM:x code.\n\n - `[MSG:‘$H’|’$X’ to unlock]`- Alarm state is active at initialization. This message serves as a reminder note on how to cancel the alarm state. All g-code commands and some ‘$’ are blocked until the alarm state is cancelled via homing `$H` or unlocking `$X`. Only appears immediately after the `Grbl` welcome message when initialized with an alarm. Startup lines are not executed at initialization if this message is present and the alarm is active.\n\n - `[MSG:Caution: Unlocked]` - Appears as an alarm unlock `$X` acknowledgement. An 'ok' still appears immediately after to denote the `$X` was parsed and executed. This message reminds the user that Grbl is operating under an unlock state, where startup lines have still not be executed and should be cautious and mindful of what they do. Grbl may not have retained machine position due to an alarm suddenly halting the machine. A reset or re-homing Grbl is highly recommended as soon as possible, where any startup lines will be properly executed.\n\n - `[MSG:Enabled]` - Appears as a check-mode `$C` enabled acknowledgement. An 'ok' still appears immediately after to denote the `$C` was parsed and executed.\n\n - `[MSG:Disabled]` - Appears as a check-mode `$C` disabled acknowledgement. An 'ok' still appears immediately after to denote the `$C` was parsed and executed. Grbl is automatically reset afterwards to restore all default g-code parser states changed by the check-mode.\n\n - `[MSG:Check Door]` - This message appears whenever the safety door detected as open. This includes immediately upon a safety door switch detects a pin change or appearing after the welcome message, if the safety door is ajar when Grbl initializes after a power-up/reset.\n\n - If in motion and the safety door switch is triggered, Grbl will immediately send this message, start a feed hold, and place Grbl into a suspend with the DOOR state.\n - If not in motion and not at startup, the same process occurs without the feed hold.\n - If Grbl is in a DOOR state and already suspended, any detected door switch pin detected will generate this message, including a door close.\n - If this message appears at startup, Grbl will suspended into immediately into the DOOR state. The startup lines are executed immediately after the DOOR state is exited by closing the door and sending Grbl a resume command.\n\n - `[MSG:Check Limits]` - If Grbl detects a limit switch as triggered after a power-up/reset and hard limits are enabled, this will appear as a courtesy message immediately after the Grbl welcome message.\n\n - `[MSG:Pgm End]` - M2/30 program end message to denote g-code modes have been restored to defaults according to the M2/30 g-code description.\n\n - `[MSG:Restoring defaults]` - Appears as an acknowledgement message when restoring EEPROM defaults via a `$RST=` command. An 'ok' still appears immediately after to denote the `$RST=` was parsed and executed.\n \n - `[MSG:Sleeping]` - Appears as an acknowledgement message when Grbl's sleep mode is invoked by issuing a `$SLP` command when in IDLE or ALARM states. Note that Grbl-Mega may invoke this at any time when the sleep timer option has been enabled and the timeout has been exceeded. Grbl may only be exited by a reset in the sleep state and will automatically enter an alarm state since the steppers were disabled.\n\t - NOTE: Sleep will also invoke the parking motion, if it's enabled. However, if sleep is commanded during an ALARM, Grbl will not park and will simply de-energize everything and go to sleep.\n\n- **Queried Feedback Messages:**\n\n\t- `[GC:]` G-code Parser State Message \n\n\t\t```\n\t\t[GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0.0 S0]\n\t\tok\n\t\t```\n\t\t\n \t\t- Initiated by the user via a `$G` command. Grbl replies as follows, where the `[GC:` denotes the message type and is followed by a separate `ok` to confirm the `$G` was executed.\n \t\n \t- The shown g-code are the current modal states of Grbl's g-code parser. This may not correlate to what is executing since there are usually several motions queued in the planner buffer.\n \t\n \t- NOTE: Program modal state has been fixed and will show `M0`, `M2`, or `M30` when they are active. During a run state, nothing will appear for program modal state.\n \t \n\n\n - `[HLP:]` : Initiated by the user via a `$` print help command. The help message is shown below with a separate `ok` to confirm the `$` was executed.\n ```\n [HLP:$$ $# $G $I $N $x=val $Nx=line $J=line $C $X $H ~ ! ? ctrl-x]\n ok\n ```\n\t\t- _**NOTE:** Grbl v1.1's new override real-time commands are not included in the help message. They use the extended-ASCII character set, which are not easily type-able, and require a GUI that supports them. This is for two reasons: Establish enough characters for all of the overrides with extra for later growth, and prevent accidental keystrokes or characters in a g-code file from enacting an override inadvertently._\n\n\n - The `$#` print parameter data query produces a large set of data which shown below and completed by an `ok` response message.\n\n \t- Each line of the printout is starts with the data type, a `:`, and followed by the data values. If there is more than one, the order is XYZ axes, separated by commas.\n\n \t\t```\n [G54:0.000,0.000,0.000]\n [G55:0.000,0.000,0.000]\n [G56:0.000,0.000,0.000]\n [G57:0.000,0.000,0.000]\n [G58:0.000,0.000,0.000]\n [G59:0.000,0.000,0.000]\n [G28:0.000,0.000,0.000]\n [G30:0.000,0.000,0.000]\n [G92:0.000,0.000,0.000]\n [TLO:0.000]\n [PRB:0.000,0.000,0.000:0]\n ok\n ```\n\n \t- The `PRB:` probe parameter message includes an additional `:` and suffix value is a boolean. It denotes whether the last probe cycle was successful or not.\n\n - `[VER:]` and `[OPT:]`: Indicates build info data from a `$I` user query. These build info messages are followed by an `ok` to confirm the `$I` was executed, like so:\n \n ```\n [VER:v1.1f.20170131:Some string]\n [OPT:VL,16,128]\n ok\n ```\n \n \t\t- The first line `[VER:]` contains the build version and date.\n - A string may appear after the second `:` colon. It is a stored EEPROM string a user via a `$I=line` command or OEM can place there for personal use or tracking purposes.\n \t\t- The `[OPT:]` line follows immediately after and contains character codes for compile-time options that were either enabled or disabled and two values separated by commas, which indicates the total usable planner blocks and serial RX buffer bytes, respectively. The codes are defined below and a CSV file is also provided for quick parsing. This is generally only used for quickly diagnosing firmware bugs or compatibility issues. \n\n\t\t\t| `OPT` Code | Setting Description, Units |\n|:-------------:|----|\n| **`V`** | Variable spindle enabled |\n| **`N`** | Line numbers enabled |\n| **`M`** | Mist coolant enabled |\n| **`C`** | CoreXY enabled |\n| **`P`** | Parking motion enabled |\n| **`Z`** | Homing force origin enabled |\n| **`H`** | Homing single axis enabled |\n| **`T`** | Two limit switches on axis enabled |\n| **`D`** | Spindle direction pin used as enable pin |\n| **`0`** | Spindle enable off when speed is zero enabled |\n| **`S`** | Software limit pin debouncing enabled |\n| **`R`** | Parking override control enabled |\n| **`A`** | Allow feed rate overrides in probe cycles |\n| **`+`** | Safety door input pin enabled |\n| **`*`** | Restore all EEPROM disabled |\n| **`$`** | Restore EEPROM `$` settings disabled |\n| **`#`** | Restore EEPROM parameter data disabled |\n| **`I`** | Build info write user string disabled |\n| **`E`** | Force sync upon EEPROM write disabled |\n| **`W`** | Force sync upon work coordinate offset change disabled |\n| **`L`** | Homing initialization auto-lock disabled |\n \n - `[echo:]` : Indicates an automated line echo from a command just prior to being parsed and executed. May be enabled only by a config.h option. Often used for debugging communication issues. A typical line echo message is shown below. A separate `ok` will eventually appear to confirm the line has been parsed and executed, but may not be immediate as with any line command containing motions.\n ```\n [echo:G1X0.540Y10.4F100]\n ```\n - NOTE: The echoed line will have been pre-parsed a bit by Grbl. No spaces or comments will appear and all letters will be capitalized.\n\n------\n\n#### Startup Line Execution\n\n - `>G54G20:ok` : The open chevron indicates a startup line has just executed. The startup line `G54G20` immediately follows the `>` character and is followed by an `:ok` response to indicate it executed successfully.\n\n - A startup line will execute upon initialization only if a line is present and if Grbl is not in an alarm state.\n\n - The `:ok` on the same line is intentional. It prevents this `ok` response from being counted as part of a stream, because it is not tied to a sent command, but an internally-generated one.\n\n - There should always be an appended `:ok` because the startup line is checked for validity before it is stored in EEPROM. In the event that it's not, Grbl will print `>G54G20:error:X`, where `X` is the error code explaining why the startup line failed to execute.\n\n - In the rare chance that there is an EEPROM read error, the startup line execution will print `>:error:7` with no startup line and a error code `7` for a read fail. Grbl will also automatically wipe and try to restore the problematic EEPROM.\n\n\n------\n\n#### Real-time Status Reports\n\n- Contains real-time data of Grbl’s state, position, and other data required independently of the stream.\n\n- Categorized as a real-time message, where it is a separate message that should not be counted as part of the streaming protocol. It may appear at any given time.\n\n- A status report is initiated by sending Grbl a '?' character.\n\n - Like all real-time commands, the '?' character is intercepted and never enters the serial buffer. It's never a part of the stream and can be sent at any time.\n\n - Grbl will generate and transmit a report within ~5-20 milliseconds.\n\n - Every ’?’ command sent by a GUI is not guaranteed with a response. The following are the current scenarios when Grbl may not immediately or ignore a status report request. _NOTE: These may change in the future and will be documented here._\n\n - If two or more '?' queries are sent before the first report is generated, the additional queries are ignored.\n\n - A soft-reset commanded clears the last status report query.\n\n - When Grbl throws a critical alarm from a limit violation. A soft-reset is required to resume operation.\n\n - During a homing cycle.\n\n- **Message Construction:**\n\n - A message is a single line of ascii text, completed by a carriage return and line feed.\n\n - `< >` Chevrons uniquely enclose reports to indicate message type.\n\n - `|` Pipe delimiters separate data fields inside the report.\n\n - The first data field is an exception to the following data field rules. See 'Machine State' description for details.\n\n - All remaining data fields consist of a data type followed by a `:` colon delimiter and data values. `type:value(s)`\n\n - Data values are given either as as one or more pre-defined character codes to indicate certain states/conditions or as numeric values, which are separated by a `,` comma delimiter when more than one is present. Numeric values are also in a pre-defined order and units of measure.\n\n - The first (Machine State) and second (Current Position) data fields are always included in every report.\n\n - Assume any following data field may or may not exist and can be in any order. The `$10` status report mask setting can alter what data is present and certain data fields can be reported intermittently (see descriptions for details.)\n\n - The `$13` report inches settings alters the units of some data values. `$13=0` false indicates mm-mode, while `$13=1` true indicates inch-mode reporting. Keep note of this setting and which report values can be altered.\n\n- **Data Field Descriptions:**\n\n - **Machine State:**\n\n - Valid states types: `Idle, Run, Hold, Jog, Alarm, Door, Check, Home, Sleep`\n\n - Sub-states may be included via `:` a colon delimiter and numeric code.\n\n - Current sub-states are:\n\n \t- `Hold:0` Hold complete. Ready to resume.\n\t \t- `Hold:1` Hold in-progress. Reset will throw an alarm.\n \t- `Door:0` Door closed. Ready to resume.\n \t- `Door:1` Machine stopped. Door still ajar. Can't resume until closed.\n \t- `Door:2` Door opened. Hold (or parking retract) in-progress. Reset will throw an alarm.\n\t\t\t- `Door:3` Door closed and resuming. Restoring from park, if applicable. Reset will throw an alarm.\n\n - This data field is always present as the first field.\n\n - **Current Position:**\n\n - Depending on `$10` status report mask settings, position may be sent as either:\n\n - `MPos:0.000,-10.000,5.000` machine position or\n - `WPos:-2.500,0.000,11.000` work position\n\n - **NOTE: Grbl v1.1 sends only one position vector because a GUI can easily compute the other position vector with the work coordinate offset `WCO:` data. See WCO description for details.**\n\n - Three position values are given in the order of X, Y, and Z. A fourth position value may exist in later versions for the A-axis.\n\n - `$13` report inches user setting effects these values and is given as either mm or inches.\n\n - This data field is always present as the second field.\n\n - **Work Coordinate Offset:**\n\n - `WCO:0.000,1.551,5.664` is the current work coordinate offset of the g-code parser, which is the sum of the current work coordinate system, G92 offsets, and G43.1 tool length offset.\n\n - Machine position and work position are related by this simple equation per axis: `WPos = MPos - WCO`\n \n \t- **GUI Developers:** Simply track and retain the last `WCO:` vector and use the above equation to compute the other position vector for your position readouts. If Grbl's status reports show either `WPos` or `MPos`, just follow the equations below. It's as easy as that!\n \t\t- If `WPos:` is given, use `MPos = WPos + WCO`.\n \t\t- If `MPos:` is given, use `WPos = MPos - WCO`.\n\n - Values are given in the order of the X,Y, and Z axes offsets. A fourth offset value may exist in later versions for the A-axis.\n - `$13` report inches user setting effects these values and is given as either mm or inches.\n\n - `WCO:` values don't change often during a job once set and only requires intermittent refreshing.\n\n - This data field appears:\n\n - In every 10 or 30 (configurable 1-255) status reports, depending on if Grbl is in a motion state or not.\n - Immediately in the next report, if an offset value has changed.\n - In the first report after a reset/power-cycle.\n\n - This data field will not appear if:\n\n - It is disabled in the config.h file. No `$` mask setting available.\n - The refresh counter is in-between intermittent reports. \n\n - **Buffer State:**\n\n - `Bf:15,128`. The first value is the number of available blocks in the planner buffer and the second is number of available bytes in the serial RX buffer.\n \n - The usage of this data is generally for debugging an interface, but is known to be used to control some GUI-specific tasks. While this is disabled by default, GUIs should expect this data field to appear, but they may ignore it, if desired.\n \n \t- IMPORTANT: Do not use this buffer data to control streaming. During a stream, the reported buffer will often be out-dated and may be incorrect by the time it has been received by the GUI. Instead, please use the streaming protocols outlined. They use Grbl's responses as a direct way to accurately determine the buffer state.\n \t \n - NOTE: The buffer state values changed from showing \"in-use\" blocks or bytes to \"available\". This change does not require the GUI knowing how many block/bytes Grbl has been compiled with.\n\n - This data field appears:\n \n - In every status report when enabled. It is disabled in the settings mask by default.\n \n - This data field will not appear if:\n\n - It is disabled by the `$` status report mask setting or disabled in the config.h file.\n\n - **Line Number:**\n\n - `Ln:99999` indicates line 99999 is currently being executed. This differs from the `$G` line `N` value since the parser is usually queued few blocks behind execution.\n\n - Compile-time option only because of memory requirements. However, if a GUI passes indicator line numbers onto Grbl, it's very useful to determine when Grbl is executing them.\n\n - This data field will not appear if:\n\n - It is disabled in the config.h file. No `$` mask setting available.\n - The line number reporting not enabled in config.h. Different option to reporting data field.\n - No line number or `N0` is passed with the g-code block.\n - Grbl is homing, jogging, parking, or performing a system task/motion.\n - There is no motion in the g-code block like a `G4P1` dwell. (May be fixed in later versions.)\n\n - **Current Feed and Speed:**\n\n - There are two versions of this data field that Grbl may respond with. \n \n \t- `F:500` contains real-time feed rate data as the value. This appears only when VARIABLE_SPINDLE is disabled in config.h, because spindle speed is not tracked in this mode.\n \t- `FS:500,8000` contains real-time feed rate, followed by spindle speed, data as the values. Note the `FS:`, rather than `F:`, data type name indicates spindle speed data is included.\n \n - The current feed rate value is in mm/min or inches/min, depending on the `$` report inches user setting. \n - The second value is the current spindle speed in RPM\n \n - These values will often not be the programmed feed rate or spindle speed, because several situations can alter or limit them. For example, overrides directly scale the programmed values to a different running value, while machine settings, acceleration profiles, and even the direction traveled can also limit rates to maximum values allowable.\n\n - As a operational note, reported rate is typically 30-50 msec behind actual position reported.\n\n - This data field will always appear, unless it was explicitly disabled in the config.h file.\n\n - **Input Pin State:**\n\n - `Pn:XYZPDHRS` indicates which input pins Grbl has detected as 'triggered'.\n\n - Pin state is evaluated every time a status report is generated. All input pin inversions are appropriately applied to determine 'triggered' states.\n\n - Each letter of `XYZPDHRS` denotes a particular 'triggered' input pin.\n\n - `X Y Z` XYZ limit pins, respectively\n - `P` the probe pin.\n - `D H R S` the door, hold, soft-reset, and cycle-start pins, respectively.\n - Example: `Pn:PZ` indicates the probe and z-limit pins are 'triggered'.\n - Note: `A` may be added in later versions for an A-axis limit pin.\n\n - Assume input pin letters are presented in no particular order.\n\n - One or more 'triggered' pin letter(s) will always be present with a `Pn:` data field.\n\n - This data field will not appear if:\n\n - It is disabled in the config.h file. No `$` mask setting available.\n - No input pins are detected as triggered.\n\n - **Override Values:**\n\n - `Ov:100,100,100` indicates current override values in percent of programmed values for feed, rapids, and spindle speed, respectively.\n\n - Override maximum, minimum, and increment sizes are all configurable within config.h. Assume that a user or OEM will alter these based on customized use-cases. Recommend not hard-coding these values into a GUI, but rather just show the actual override values and generic increment buttons.\n\n - Override values don't change often during a job once set and only requires intermittent refreshing. This data field appears:\n\n - After 10 or 20 (configurable 1-255) status reports, depending on is in a motion state or not.\n - If an override value has changed, this data field will appear immediately in the next report. However, if `WCO:` is present, this data field will be delayed one report.\n - In the second report after a reset/power-cycle.\n\n - This data field will not appear if:\n\n - It is disabled in the config.h file. No `$` mask setting available.\n - The override refresh counter is in-between intermittent reports.\n - `WCO:` exists in current report during refresh. Automatically set to try again on next report.\n\n\t- **Accessory State:**\n\n\t\t- `A:SFM` indicates the current state of accessory machine components, such as the spindle and coolant.\n\n\t\t- Due to the new toggle overrides, these machine components may not be running according to the g-code program. This data is provided to ensure the user knows exactly what Grbl is doing at any given time.\n\t\t\n\t\t- Each letter after `A:` denotes a particular state. When it appears, the state is enabled. When it does not appear, the state is disabled.\n\n\t\t\t- `S` indicates spindle is enabled in the CW direction. This does not appear with `C`.\n\t\t\t- `C` indicates spindle is enabled in the CCW direction. This does not appear with `S`.\n \t- `F` indicates flood coolant is enabled.\n \t- `M` indicates mist coolant is enabled.\n\t\t\n\t - Assume accessory state letters are presented in no particular order.\n \n - This data field appears:\n\n\t\t\t- When any accessory state is enabled.\n \t- Only with the override values field in the same message. Any accessory state change will trigger the accessory state and override values fields to be shown on the next report.\n\n - This data field will not appear if:\n\n \t- No accessory state is active.\n \t- It is disabled in the config.h file. No `$` mask setting available.\n \t- If override refresh counter is in-between intermittent reports.\n \t- `WCO:` exists in current report during refresh. Automatically set to try again on next report.\n"} {"id": "linuxcnc-docs:docs/src/code/writing-tests.adoc", "source": "linuxcnc-docs", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "docs/src/code/writing-tests.adoc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/docs/src/code/writing-tests.adoc", "license": "GFDL-1.1-or-later", "encoding": "utf-8", "sha256": "9859f06e14036cf5a7f4635ef65ef1b907d7bc9befa0f62ddddebaf18b86f0cd", "bytes": 4497, "tokens": 1213, "text": "[[cha:writing-tests]]\n= Writing automated LinuxCNC tests\n\n== The test framework\n\nThe code base has unit and integration tests that can be executed\nautomatically to ensure the program works as intended. Such tests are\noften written to trigger a bug and to ensure the bug is detected if it\nresurfaces in the future, but also to validate behavior of components\nand interfaces.\n\nThe tests are collected in the `tests/` directory. The individual tests\nare in subdirectories of this directory. The tests are grouped in\ndirectories.\n\n== Running tests\n\nThe tests are executed by the `scripts/runtests` script generated from\n`scripts/runtests.in` during build. The runtests script will by default\nlocate tests to run under `tests/`, but can be limited to only run a\nlimited set of tests by specifying the directory of the test or tests\nas argument(s).\n\n.An example running only the tests in `tests/lathe/`.\n----\n$ scripts/runtests tests/lathe/\nRunning test: tests/lathe\nRuntest: 1 tests run, 1 successful, 0 failed + 0 expected, 0 skipped\n----\n\nThe runtests script looks for all files named _test_, _test.sh_ and\n_test.hal_ below the directories specified on the command line, or under\n`tests/` if no command line argument is specified. These files\nrepresent three different ways to run the tests.\n\n.Arguments accepted by the _runtests_ script, see the output from `scripts/runtests -h` for the authoritative list.\n----\n-n do not remove temporary files for successful tests.\n-s stop after any failed test.\n-p print stderr and result files.\n-c Remove temporary files from an earlier test run.\n-u Only run tests that require normal user access.\n-v Show stdout and stderr (normally it's hidden).\n----\n\n== Writing tests\n\nMake sure the test can run successfully without a working X11 display,\ni.e., with the DISPLAY environment variable unset.\n\n1. Create a folder in `tests/`.\n2. Provide one test script.\n3. Evaluate the output with one of the options below.\n\nThese are the files considered in the directory with the individual\ntests:\n\n.Test script (only one of these three)\n\ntest::\n A program that is executed and its exit code and output checked using\n either checkresult or expected.\n\ntest.sh::\n A bash script that is executed and its exit code and output checked using\n either checkresult or expected.\n\ntest.hal::\n A HAL script that is executed using `halrun -f test.hal` and its exit code\n and output checked using either checkresult or expected.\n\n.Test evaluation\n\n expected::\n A file whose content is compared to the output from running the test\n scripts. If the test output is identical to the content of the\n expected file, the test succeeds.\n\ncheckresult::\n An executable file to perform more complex validation than just comparing\n the output of a test script. It gets the filename of the test program as\n its command line argument. The exit code of this program controls the result\n of the test. If both `expected` and `checkresult` exist, only `checkresult`\n is consulted to validate the test output.\n\n xfail::\n If this file exist, a test failure is expected and does not cause\n runtests to return an exit code signaling an error.\n\n skip::\n If this file exist, the test is skipped and not executed at all.\n\n control::\n This file can be used to flag specific needs in the test. At the\n moment, the use of _sudo_ can be flagged, and tests requiring sudo\n can be skipped when using `runtests -u`. To flag such requirements,\n add a line with `Restrictions: sudo` to this file.\n\n== Some testing approaches\n\nThere are various ways to structure a test, depending on what one wants\nto test. Here are a few ideas on how to do it.\n\n=== Non-interactive \"GUI\"\n\nIf you want to test some operations in the user interface, a useful\napproach is is to write a custom \"GUI\" simulating the operations.\nThis can be done by creating a normal LinuxCNC setup and pointing the\n[DISPLAY] DISPLAY value to a script that does the operations needed to\ntest the behaviour.\n\nExamples of this approach can be found in `tests/halui/jogging/` and\n`tests/interp/subroutine-return/`.\n\n=== Recording HAL pin transitions\n\nUsing the _sampler_ and _halsampler_ HAL components, one can set up a\nHAL configuration and collect pin value settings and changes and dump\nthe result to stdout (or a file). The end result can then be compared\nwith the expected output to verify if HAL behaves as expected.\n\nExamples of this approach can be found in `tests/multiclick/` and\n`tests/stepgen.2/`.\n"} {"id": "linuxcnc-docs:docs/src/config/ini-config.adoc", "source": "linuxcnc-docs", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "docs/src/config/ini-config.adoc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/docs/src/config/ini-config.adoc", "license": "GFDL-1.1-or-later", "encoding": "utf-8", "sha256": "cb352867653d70d67466f6afa9b3349d5ef75a84803cef7859fe5d39d335d7ed", "bytes": 76925, "tokens": 24026, "text": ":lang: en\n:toc:\n\n[[cha:ini-configuration]]\n= INI Configuration(((INI Configuration)))\n\n// Custom lang highlight\n// must come after the doc title, to work around a bug in asciidoc 8.6.6\n:ini: {basebackend@docbook:'':ini}\n:hal: {basebackend@docbook:'':hal}\n:ngc: {basebackend@docbook:'':ngc}\n\n== The INI File Components(((INI File,Components)))\n\nA typical INI file follows a rather simple layout that includes;\n\n* comments\n* sections\n* variables\n\nEach of these elements is separated on single lines.\nEach end of line or newline character creates a new element.\n\n=== Comments(((INI File,Components,Comments)))\n\nA comment line is started with a ; or a # mark.\nWhen the INI reader sees either of these marks at the start a line, the rest of the line is ignored by the software.\nComments can be used to describe what an INI element will do.\n\n[source,{ini}]\n----\n; This is my mill configuration file.\n# I set it up on January 12, 2012\n----\n\nComments can also be used to 'turn off' a variable.\nThis makes it easier to pick between different variables.\n\n[source,{ini}]\n----\nDISPLAY = axis\n# DISPLAY = touchy\n----\n\nIn this list, the DISPLAY variable will be set to axis because the other one is commented out.\nIf someone carelessly edits a list like this and leaves two of the lines uncommented, the first one encountered will be used.\n\nNote that inside a variable, the \"#\" and \";\" characters do not denote comments:\n\n[source,{ini}]\n----\nINCORRECT = value # and a comment\n\n# Correct Comment\nCORRECT = value\n----\n\n[[sub:ini:sections]]\n=== Sections(((INI File,Components,Sections)))\n\nRelated parts of an INI file are separated into sections.\nA section name is enclosed in brackets like this: `[THIS_SECTION]`.\nThe order of sections is unimportant.\nSections begin at the section name and end at the next section name.\n\nThe following sections are used by LinuxCNC:\n\n* <> general information\n* <> settings related to the graphical user interface\n* <> settings input filter programs\n* <> settings used by the G-code interpreter\n* <> settings used by the real time motion controller\n* <> settings used by the task controller\n* <> specifies .hal files\n* <> MDI commands used by HALUI\n* <> Other applications to be started by LinuxCNC\n* <> additional settings used by the real time motion controller\n* <> individual joint variables\n* <> individual axis variables\n* <> kinematics variables\n* <> settings used by the I/O Controller\n\n[[sub:ini:variables]]\n=== Variables(((INI File,Components,Variables)))\n\nA variable line is made up of a variable name, an equals sign (`=`), and a value.\nEverything from the first non-white space character after the `=` up to the end of the line is passed as the value,\nso you can embed spaces in string symbols if you want to or need to.\nA variable name is often called a keyword.\n\n.Variable Example\n[source,{ini}]\n----\nMACHINE = My Machine\n----\n\nA variable line may be extended to multiple lines with a terminal backslash (\\) character.\nA maximum of `MAX_EXTEND_LINES` (==20) are allowed.\nThere must be no whitespace following the trailing backslash character.\n\nSection identifiers may not be extended to multiple lines.\n\n.Variable with Line extends Example\n[source,{ini}]\n----\nAPP = sim_pin \\\nini.0.max_acceleration \\\nini.1.max_acceleration \\\nini.2.max_acceleration \\\nini.0.max_velocity \\\nini.1.max_velocity \\\nini.2.max_velocity\n----\n\n.Boolean Variables\n\nBoolean values can be on one of `TRUE`, `YES` or `1` for true/enabled and one of `FALSE`, `NO` or `0` for false/disabled. The case is ignored.\n\nThe following sections detail each section of the configuration file, using sample values for the configuration lines.\n\nVariables that are used by LinuxCNC must always use the section names and variable names as shown.\n\n[[sub:ini:custom]]\n=== Custom Sections and Variables(((INI File,Components,Custom sections and variables)))\n\nMost sample configurations use custom sections and variables to put all of the settings into one location for convenience.\n\nTo add a custom variable to an existing LinuxCNC section, simply include the variable in that section.\n\n.Custom Variable Example, assigning the value 'LINEAR' to the variable 'TYPE', and the value '16000' to the variable 'SCALE'.\n[source,{ini}]\n----\n[JOINT_0]\nTYPE = LINEAR\n...\nSCALE = 16000\n----\n\nTo introduce a custom section with its own variables, add the section and variables to the INI file.\n\n.Custom Section Example\n[source,{ini}]\n----\n[PROBE]\nZ_FEEDRATE = 50\nZ_OFFSET = 12\nZ_SAFE_DISTANCE = -10\n----\n\nTo use the custom variables in your HAL file, put the section and variable name in place of the value.\n\n.HAL Example\n[source,{hal}]\n----\nsetp offset.1.offset [PROBE]Z_OFFSET\nsetp stepgen.0.position-scale [JOINT_0]SCALE\n----\n\n[NOTE]\nThe value stored in the variable must match the type specified by the component pin.\n\nTo use the custom variables in G-code, use the global variable syntax `#<_ini[section]variable>`.\nThe following example shows a simple Z-axis touch-off routine for a router or mill using a probe plate.\n\n.G-code Example\n[source,{ngc}]\n----\nG91\nG38.2 Z#<_ini[probe]z_safe_distance> F#<_ini[probe]z_feedrate>\nG90\nG1 Z#5063\nG10 L20 P0 Z#<_ini[probe]z_offset>\n----\n\n[[sub:ini:include]]\n=== Include Files(((INI File,Components,Include)))\n\nAn INI file may include the contents of another file by using a #INCLUDE directive.\n\n.#INCLUDE Format\n[source,{ini}]\n----\n#INCLUDE filename\n----\n\nThe filename can be specified as:\n\n* a file in the same directory as the INI file\n* a file located relative to the working directory\n* an absolute file name (starts with a /)\n* a user-home-relative file name (starts with a ~)\n\nMultiple #INCLUDE directives are supported.\n\n.#INCLUDE Examples\n[source,{ini}]\n----\n#INCLUDE joint_0.inc\n#INCLUDE ../parallel/joint_1.inc\n#INCLUDE below/joint_2.inc\n#INCLUDE /home/myusername/myincludes/display.inc\n#INCLUDE ~/linuxcnc/myincludes/rs274ngc.inc\n----\n\nThe #INCLUDE directives are supported for one level of expansion only -- an included file may not include additional files.\nThe recommended file extension is '.inc'.\nDo _not_ use a file extension of '.ini' for included files.\n\n[[sec:ini:sections]]\n== INI File Sections(((INI File,Sections)))\n\n[[sub:ini:sec:emc]]\n=== [EMC] Section(((INI File,Sections,[EMC] Section)))\n\n* `VERSION = 1.1` - The version number for the configuration.\n Any value other than 1.1 will cause the configuration checker to run and try to update the configuration to the new style joint axes type of configuration.\n* `MACHINE = My Controller` - This is the name of the controller, which is printed out at the top of most graphical interfaces.\n You can put whatever you want here as long as you make it a single line long.\n* `DEBUG = 0` - Debug level 0 means no messages will be printed when LinuxCNC is run from a <>.\n Debug flags are usually only useful to developers. See src/emc/nml_intf/debugflags.h for other settings.\n\n[[sub:ini:sec:display]]\n=== [DISPLAY] Section(((INI File,Sections,[DISPLAY] Section)))\n\nDifferent user interface programs use different options, and not every option is supported by every user interface.\nThere are several interfaces, like AXIS, GMOCCAPY, Touchy, QtVCP's QtDragon and Gscreen.\nAXIS is an interface for use with normal computer and monitor, Touchy is for use with touch screens.\nGMOCCAPY can be used both ways and offers also many connections for hardware controls.\nDescriptions of the interfaces are in the Interfaces section of the User Manual.\n\n* `DISPLAY = axis` - The file name of the executable providing the user interface to use.\n Prominent valid options are (all in lower case): `axis`, `touchy`, `gmoccapy`, `gscreen`, `tklinuxcnc`, `qtvcp`, `qtvcp-qtdragon` or `qtvcp-qtplasmac`.\n* `POSITION_OFFSET = RELATIVE` - The coordinate system (`RELATIVE` or `MACHINE`) to show on the DRO when the user interface starts.\n The RELATIVE coordinate system reflects the G92 and G5__x__ coordinate offsets currently in effect.\n* `POSITION_FEEDBACK = COMMANDED` - The coordinate value (`COMMANDED` or `ACTUAL`) to show on the DRO when the user interface starts.\n In AXIS this can be changed from the View menu.\n The COMMANDED position is the position requested by LinuxCNC.\n The ACTUAL position is the feedback position of the motors if they have feedback like most servo systems.\n Typically the COMMANDED value is used.\n* `DRO_FORMAT_MM = %+08.6f` - Override the default DRO formatting in metric mode (normally 3 decimal places, padded with spaces to 6 digits to the left).\n The example above will pad with zeros, display 6 decimal digits and force display of a + sign for positive numbers.\n Formatting follows Python practice: https://docs.python.org/2/library/string.html#format-specification-mini-language .\n An error will be raised if the format can not accept a floating-point value.\n* `DRO_FORMAT_IN = % 4.1f` - Override the default DRO formatting in imperial mode (normally 4 decimal places, padded with spaces to 6 digits to the left).\n The example above will display only one decimal digit.\n Formatting follows Python practice: https://docs.python.org/2/library/string.html#format-specification-mini-language .\n An error will be raised if the format can not accept a floating-point value.\n* `CONE_BASESIZE = .25` - Override the default cone/tool base size of .5 in the graphics display.\n* `MAX_FEED_OVERRIDE = 1.2` - The maximum feed override the user may select.\n 1.2 means 120% of the programmed feed rate.\n* `MIN_SPINDLE_OVERRIDE = 0.5` - The minimum spindle override the user may select.\n 0.5 means 50% of the programmed spindle speed. (This is used to set the minimum spindle speed.)\n* `MIN_SPINDLE_0_OVERRIDE = 0.5` - The minimum spindle override the user may select.\n 0.5 means 50% of the programmed spindle speed. (This is used to set the minimum spindle speed.)\n On multi spindle machine there will be entries for each spindle number. Only used by the QtVCP based user interfaces.\n* `MAX_SPINDLE_OVERRIDE = 1.0` - The maximum spindle override the user may select. 1.0 means 100% of the programmed spindle speed.\n* `MAX_SPINDLE_0_OVERRIDE = 1.0` - The maximum feed override the user may select.\n 1.2 means 120% of the programmed feed rate.\n On multi spindle machine there will be entries for each spindle number. Only used by the QtVCP based user interfaces.\n* `DEFAULT_SPINDLE_SPEED = 100` - The default spindle RPM when the spindle is started in manual mode.\n If this setting is not present, this defaults to 1 RPM for AXIS and 300 RPM for GMOCCAPY.\n - _deprecated_ - use the [SPINDLE_n] section instead\n* `DEFAULT_SPINDLE_0_SPEED = 100` - The default spindle RPM when the spindle is started in manual mode.\n On multi spindle machine there will be entries for each spindle number. Only used by the QtVCP-based user interfaces.\n - _deprecated_ - use the [SPINDLE_n] section instead.\n* `SPINDLE_INCREMENT = 200` - The increment used when clicking increase/decrease buttons. Only used by the QtVCP based user interfaces.\n - _deprecated_ - use the [SPINDLE_n] section instead.\n* `MIN_SPINDLE_0_SPEED = 1000` - The minimum RPM that can be manually selected.\n On multi spindle machine there will be entries for each spindle number. Only used by the QtVCP-based user interfaces.\n - _deprecated_ - use the [SPINDLE_n] section instead.\n* `MAX_SPINDLE_0_SPEED = 20000` - The maximum RPM that can be manually selected.\n On multi spindle machine there will be entries for each spindle number. Only used by the QtVCP-based user interfaces.\n - _deprecated_ - use the [SPINDLE_n] section instead.\n* `PROGRAM_PREFIX = ~/linuxcnc/nc_files` - The default directory for G-code files, named subroutines, and user-defined M-codes.\n The `PROGRAM_PREFIX` directory is searched before the directories listed in `[RS274]SUBROUTINE_PATH` and `[RS274]USER_M_PATH`.\n* `INTRO_GRAPHIC = emc2.gif` - The image shown on the splash screen.\n* `INTRO_TIME = 5` - The maximum time to show the splash screen, in seconds.\n* `CYCLE_TIME = 100` - Cycle time of the display GUI.\n Depending on the screen, this can be in seconds or ms (ms preferred).\n This is often the update rate rather then sleep time between updates.\n If the update time is not set right the screen can become unresponsive or very jerky.\n A value of 100 ms (0.1 s) is a common setting though a range of 50 - 200 ms (.05 - .2 s) may be useable.\n An under powered CPU may see improvement with a longer setting.\n Usually the default is fine.\n* `PREVIEW_TIMEOUT = 5` - Timeout (in seconds) for loading graphical preview of G-code. Currently AXIS only.\n\n[NOTE]\nThe following [DISPLAY] items are used by GladeVCP and PyVCP,\nsee the <> section of the GladeVCP Chapter or the <> for more information.\n\n* `EMBED_TAB_NAME = GladeVCP demo`\n* `EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -x \\{XID\\} -u ./gladevcp/hitcounter.py ./gladevcp/manual-example.ui`\n+\n[NOTE]\n====\nDifferent user interface programs use different options, and not every option is supported by every user interface.\nSee <> document for AXIS details.\nSee <> document for GMOCCAPY details.\n====\n\n* `DEFAULT_LINEAR_VELOCITY = .25` - The default velocity for linear jogs, in <> per second.\n* `MIN_VELOCITY = .01` - The approximate lowest value the jog slider.\n* `MAX_LINEAR_VELOCITY = 1.0` - The maximum velocity for linear jogs, in machine units per second.\n* `MIN_LINEAR_VELOCITY = .01` - The approximate lowest value the jog slider.\n* `DEFAULT_ANGULAR_VELOCITY = .25` - The default velocity for angular jogs, in machine units per second.\n* `MIN_ANGULAR_VELOCITY = .01` - The approximate lowest value the angular jog slider.\n* `MAX_ANGULAR_VELOCITY = 1.0` - The maximum velocity for angular jogs, in machine units per second.\n* `INCREMENTS = 1 mm, .5 in, ...` - Defines the increments available for incremental jogs.\n The INCREMENTS can be used to override the default.\n The values can be decimal numbers (e.g., 0.1000) or fractional numbers (e.g., 1/16), optionally followed by a unit (cm, mm, um, inch, in or mil).\n If a unit is not specified the machine unit is assumed.\n Metric and imperial distances may be mixed: INCREMENTS = 1 inch, 1 mil, 1 cm, 1 mm, 1 um is a valid entry.\n* `GRIDS = 10 mm, 1 in, ...` - Defines the preset values for grid lines.\n The value is interpreted the same way as `INCREMENTS`.\n* `OPEN_FILE = /full/path/to/file.ngc` - The file to show in the preview plot when AXIS starts.\n Use a blank string \"\" and no file will be loaded at start up.\n GMOCCAPY will not use this setting, as it offers a corresponding entry on its settings page.\n* `EDITOR = gedit` - The editor to use when selecting File > Edit to edit the G-code from the AXIS menu.\n This must be configured for this menu item to work.\n Another valid entry is `gnome-terminal -e vim`.\n This entry does not apply to GMOCCAPY, as GMOCCAPY has an integrated editor.\n* `TOOL_EDITOR = tooledit` - The editor to use when editing the tool table\n (for example by selecting \"File > Edit tool table...\" in AXIS).\n Other valid entries are `gedit`, `gnome-terminal -e vim`, and `gvim`.\n This entry does not apply to GMOCCAPY, as GMOCCAPY has an integrated editor.\n* `PYVCP = /filename.xml` - The PyVCP panel description file.\n See the <>for more information.\n* `PYVCP_POSITION = BOTTOM` - The placement of the PyVCP panel in the AXIS user interface.\n If this variable is omitted the panel will default to the right side.\n The only valid alternative is `BOTTOM`. See the <> for more information.\n* `LATHE = 1` - Any non-empty value (including \"0\") causes axis to use \"lathe mode\" with a top view and with Radius and Diameter on the DRO.\n* `BACK_TOOL_LATHE = 1` - Any non-empty value (including \"0\") causes axis to use \"back tool lathe mode\" with inverted X axis.\n* `FOAM = 1` - Any non-empty value (including \"0\") causes axis to change the display for foam-cutter mode.\n* `GEOMETRY = XYZABCUVW` - Controls the *preview* and *backplot* of motion.\n This item consists of a sequence of axis letters and control characters, optionally preceded with a \"-\" sign:\n\n. The letters X, Y, Z specify translation along the named coordinate.\n. The letters A, B, C specify rotation about the corresponding axes X, Y, Z.\n. The letters U, V, W specify translation along the related axes X, Y, Z.\n. Each letter specified must occur in `[TRAJ]COORDINATES` to have an effect.\n. A \"*-*\" character preceding any letter inverts the direction of the operation.\n. The translation and rotation operations are evaluated *right-to-left*.\n So using `GEOMETRY=XYZBC` specifies a C rotation followed by a B rotation followed by Z, Y, X translations.\n The ordering of consecutive translation letters is immaterial.\n. The proper GEOMETRY string depends on the machine configuration and the kinematics used to control it.\n The order of the letters is important.\n For example, rotating around C then B is different than rotating around B then C.\n. Rotations are by default applied with respect to the machine origin.\n Example: `GEOMETRY=CXYZ` first translates the control point to X, Y, Z and then performs a C rotation about the Z axis centered at the machine origin.\n. UVW translation example: `GEOMETRY=XYZUVW` causes UVW to move in the coordinate system of the tool and XYZ to move in the coordinate system of the material.\n. Foam-cutting machines (`FOAM = 1`) should specify \"XY;UV\" or leave the value blank even though this value is presently ignored in foam-cutter mode.\n A future version may define what \";\" means, but if it does \"XY;UV\" will mean the same as the current foam default.\n. Experimental: If the exclamation mark (`!`) character is included in the GEOMETRY string, display points for A, B, C rotations respect the X, Y, Z offsets set by G5x, G92 codes.\n Example: Using `GEOMETRY = !CXZ` for a machine with `[TRAJ]COORDINATES=XZC`.\n This provision applies for liveplots only -- G-code previews should be done with zero G5x, G92 offsets.\n This can be facilitated by setting offsets in programs only when task is running as indicated by #<_task> == 1.\n If nonzero offsets exist at startup due to persistence, offsets should be zeroed and preview reloaded.\n\n+\n[NOTE]\nIf no `[DISPLAY]GEOMETRY` is included in the INI file, a default is provided by the `[DISPLAY]DISPLAY` GUI program (typically \"XYZABCUVW\").\n\n* `ARCDIVISION = 64` - Set the quality of preview of arcs.\n Arcs are previewed by dividing them into a number of straight lines; a semicircle is divided into *ARCDIVISION* parts.\n Larger values give a more accurate preview, but take longer to load and result in a more sluggish display.\n Smaller values give a less accurate preview, but take less time to load and may result in a faster display.\n The default value of 64 means a circle of up to 3 inches will be displayed to within 1 mil (.03%).\n* `MDI_HISTORY_FILE =` - The name of a local MDI history file.\n If this is not specified, AXIS will save the MDI history in *.axis_mdi_history* in the user`s home directory.\n This is useful if you have multiple configurations on one computer.\n* `JOG_AXES =` - The order in which jog keys are assigned to axis letters.\n The left and right arrows are assigned to the first axis letter, up and down to the second, page up/page down to the third, and left and right bracket to the fourth.\n If unspecified, the default is determined from the `[TRAJ]COORDINATES`, `[DISPLAY]LATHE` and `[DISPLAY]FOAM` values.\n* `JOG_INVERT =` - For each axis letter, the jog direction is inverted.\n The default is \"X\" for lathes and blank otherwise.\n+\n[NOTE]\nThe settings for `JOG_AXES` and `JOG_INVERT` apply to world mode jogging by axis coordinate letter and are in effect while in world mode after successful homing.\nWhen operating in joint mode prior to homing, keyboard jog keys are assigned in a fixed sequence: left/right: joint0, up/down: joint1, page up/page down: joint2, left/right bracket: joint3\n\n* `USER_COMMAND_FILE = mycommands.py` - The name of an optional, configuration-specific Python file sourced by the AXIS GUI instead of the user-specific file `~/.axisrc`.\n\n[NOTE]\nThe following `[DISPLAY]` item is used by the TKLinuxCNC interface only.\n\n* `HELP_FILE = tklinucnc.txt` - Path to help file.\n\n[[sub:ini:sec:filter]]\n=== [FILTER] Section(((INI File,Sections,[FILTER] Section)))\n\nAXIS and GMOCCAPY have the ability to send loaded files through a filter program.\nThis filter can do any desired task: Something as simple as making sure the file ends with M2,\nor something as complicated as detecting whether the input is a depth image, and generating G-code to mill the shape it defines.\nThe `[FILTER]` section of the INI file controls how filters work.\nFirst, for each type of file, write a `PROGRAM_EXTENSION`-line.\nThen, specify the program to execute for each type of file.\nThis program is given the name of the input file as its first argument, and must write RS274NGC code to standard output.\nThis output is what will be displayed in the text area, previewed in the display area, and executed by LinuxCNC when Run.\n\n* `PROGRAM_EXTENSION = .extension Description`\n\nIf your post processor outputs files in all caps you might want to add the following line:\n\n[source,{ini}]\n----\nPROGRAM_EXTENSION = .NGC XYZ Post Processor\n----\n\nThe following lines add support for the image-to-G-code converter included with LinuxCNC.\n\n[source,{ini}]\n----\nPROGRAM_EXTENSION = .png,.gif,.jpg # Greyscale Depth Image\n png = image-to-gcode\n gif = image-to-gcode\n jpg = image-to-gcode\n----\n\nAn example of a custom G-code converter located in the linuxcnc directory.\n\n[source,{ini}]\n----\nPROGRAM_EXTENSION = .gcode 3D Printer\n gcode = /home/mill/linuxcnc/convert.py\n----\n\nNOTE: The program file associated with an extension must have either the full path to the program or be located in a directory that is on the system path.\n\nIt is also possible to specify an interpreter:\n\n[source,{ini}]\n----\nPROGRAM_EXTENSION = .py Python Script\n py = python\n----\n\nIn this way, any Python script can be opened, and its output is treated as G-code.\nOne such example script is available at nc_files/holecircle.py.\nThis script creates G-code for drilling a series of holes along the circumference of a circle.\nMany more G-code generators are on the LinuxCNC Wiki site https://wiki.linuxcnc.org/[https://wiki.linuxcnc.org/].\n\nPython filters should use the print function to output the result to AXIS.\n\nThis example program filters a file and adds a W axis to match the Z axis.\nIt depends on there being a space between each axis word to work.\n\n[source,python]\n----\n#!/usr/bin/env python3\n\nimport sys\n\ndef main(argv):\n\n openfile = open(argv[0], 'r')\n file_in = openfile.readlines()\n openfile.close()\n\n file_out = []\n for line in file_in:\n # print(line)\n if line.find('Z') != -1:\n words = line.rstrip('\\n')\n words = words.split(' ')\n newword = ''\n for i in words:\n if i[0] == 'Z':\n newword = 'W'+ i[1:]\n if len(newword) > 0:\n words.append(newword)\n newline = ' '.join(words)\n file_out.append(newline)\n else:\n file_out.append(line)\n for item in file_out:\n print(\"%s\" % item)\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n----\n\n* `FILTER_PROGRESS=%d` +\n If the environment variable AXIS_PROGRESS_BAR is set, then lines written to stderr of the form above sets the AXIS progress bar to the given percentage.\n This feature should be used by any filter that runs for a long time.\n\n[[sub:ini:sec:rs274ngc]]\n=== [RS274NGC] Section(((INI File,Sections,[RS274NGC] Section)))\n\n* `PARAMETER_FILE = myfile.var` - (((PARAMETER FILE)))\n The file located in the same directory as the INI file which contains the parameters used by the interpreter (saved between runs).\n* `ORIENT_OFFSET = 0` - (((ORIENT OFFSET)))\n A float value added to the R word parameter of an <> operation.\n Used to define an arbitrary zero position regardless of encoder mount orientation.\n* `RS274NGC_STARTUP_CODE = G17 G20 G40 G49 G64 P0.001 G80 G90 G92.1 G94 G97 G98` - (((RS274NGC STARTUP CODE)))\n A string of NC codes that the interpreter is initialized with.\n This is not a substitute for specifying modal G-codes at the top of each NGC file,\n because the modal codes of machines differ, and may be changed by G-code interpreted earlier in the session.\n* `SUBROUTINE_PATH = ncsubroutines:/tmp/testsubs:lathesubs:millsubs` - (((SUBROUTINE PATH)))\n Specifies a colon (:) separated list of up to 10 directories to be searched when single-file subroutines are specified in G-code.\n These directories are searched after searching `[DISPLAY]PROGRAM_PREFIX` (if it is specified) and before searching `[WIZARD]WIZARD_ROOT` (if specified).\n The paths are searched in the order that they are listed.\n The first matching subroutine file found in the search is used.\n Directories are specified relative to the current directory for the INI file or as absolute paths.\n The list must contain no intervening whitespace.\n* `CENTER_ARC_RADIUS_TOLERANCE_INCH =` _n_ (Default: 0.00005)\n* `CENTER_ARC_RADIUS_TOLERANCE_MM =` _n_ (Default: 0.00127)\n* `USER_M_PATH = myfuncs:/tmp/mcodes:experimentalmcodes` - (((USER M PATH)))\n Specifies a list of colon (:) separated directories for user defined functions.\n Directories are specified relative to the current directory for the INI file or as absolute paths.\n The list must contain no intervening whitespace.\n+\nA search is made for each possible user defined function, typically (M100-M199). The search order is:\n+\n. `[DISPLAY]PROGRAM_PREFIX` (if specified)\n. If `[DISPLAY]PROGRAM_PREFIX` is not specified, search the default location: nc_files\n. Then search each directory in the list `[RS274NGC]USER_M_PATH`.\n+\nThe first executable M1__xx__ found in the search is used for each M1__xx__.\n\n+\n[NOTE]\nThe maximum number of `USER_M_PATH` directories is defined at compile time (typ: `USER_DEFINED_FUNCTION_MAX_DIRS == 5`).\n\n* `INI_VARS = 1` (Default: 1) +\n Allows G-code programs to read values from the INI file using the format #<_ini[section]name>.\n See <>.\n* `HAL_PIN_VARS = 1` (Default: 1) +\n Allows G-code programs to read the values of HAL pins using the format #<_hal[HAL item]>.\n Variable access is read-only.\n See <> for more details and an important caveat.\n* `RETAIN_G43 = 0` (Default: 0) +\n When set, you can turn on G43 after loading the first tool, and then not worry about it through the program.\n When you finally unload the last tool, G43 mode is canceled.\n* `OWORD_NARGS = 0` (Default: 0) +\n If this feature is enabled then a called subroutine can determine the number of actual positional parameters passed by inspecting the +#+ parameter.\n* `NO_DOWNCASE_OWORD = 0` (Default: 0) +\n Preserve case in O-word names within comments if set, enables reading of mixed-case HAL items in structured comments like `(debug, #<_hal[MixedCaseItem])`.\n* `OWORD_WARNONLY = 0` (Default: 0) +\n Warn rather than error in case of errors in O-word subroutines.\n* `DISABLE_G92_PERSISTENCE = 0` (Default: 0)\n Allow to clear the G92 offset automatically when config start-up.\n* `DISABLE_FANUC_STYLE_SUB = 0` (Default: 0)\n If there is reason to disable Fanuc subroutines set it to 1.\n\n[NOTE]\n====\nThe above six options were controlled by the `FEATURES` bitmask in versions of LinuxCNC prior to 2.8.\nThis INI tag will no longer work. +\nFor reference:\n----\nFEATURES & 0x1 -> RETAIN_G43\nFEATURES & 0x2 -> OWORD_NARGS\nFEATURES & 0x4 -> INI_VARS\nFEATURES & 0x8 -> HAL_PIN_VARS\nFEATURES & 0x10 -> NO_DOWNCASE_OWORD\nFEATURES & 0x20 -> OWORD_WARNONLY\n----\n====\n\n[NOTE]\n`[WIZARD]WIZARD_ROOT` is a valid search path but the Wizard has not been fully implemented and the results of using it are unpredictable.\n\n* `LOG_LEVEL = 0` \n Specify the log_level (default: 0)\n//FIXME: Inconsistent\n* `LOG_FILE = file-name.log` +\n For specify the file used for log the data.\n* `REMAP=M400 modalgroup=10 argspec=Pq ngc=myprocedure`\n See <> chapter for details.\n* `ON_ABORT_COMMAND=O call`\n See <> chapter for details.\n\n[[sub:ini:sec:emcmot]]\n=== [EMCMOT] Section(((INI File,Sections,[EMCMOT] Section)))\n\nThis section is a custom section and is not used by LinuxCNC directly.\nMost configurations use values from this section to load the motion controller.\nFor more information on the motion controller see the <> section.\n\n* `EMCMOT = motmod` - the motion controller name is typically used here.\n* `BASE_PERIOD = 50000` - the 'Base' task period in nanoseconds.\n* `SERVO_PERIOD = 1000000` - This is the \"Servo\" task period in nanoseconds.\n* `TRAJ_PERIOD = 100000` - This is the 'Trajectory Planner' task period in nanoseconds.\n* `COMM_TIMEOUT = 1.0` - Number of seconds to wait for Motion (the realtime part of the motion controller) to acknowledge receipt of messages from Task (the non-realtime part of the motion controller).\n* `HOMEMOD =` _alternate_homing_module_ [home_parms=value]\n The HOMEMOD variable is optional. If specified, use a specified (user-built) module instead of the default (homemod).\n Module parameters (home_parms) may be included if supported by the named module.\n The setting may be overridden from the command line using the -m option ($ linuxcnc -h).\n\n[[sub:ini:sec:task]]\n=== [TASK] Section(((INI File,Sections,[TASK] Section)))\n\n* `TASK = milltask` -\n Specifies the name of the 'task' executable.\n The 'task' executable does various things, such as\n - communicate with the UIs over NML,\n - communicate with the realtime motion planner over non-HAL shared memory, and\n - interpret G-code.\n Currently there is only one task executable that makes sense for 99.9% of users, milltask.\n* `CYCLE_TIME = 0.010` -\n The period, in seconds, at which TASK will run.\n This parameter affects the polling interval when waiting for motion to complete, when executing a pause instruction, and when accepting a command from a user interface.\n There is usually no need to change this number.\n\n[[sub:ini:sec:hal]]\n=== [HAL] section(((INI File,Sections,[HAL] Section)))\n\n* `HALFILE = example.hal` - Execute the file 'example.hal' at start up.\n+\n--\nIf `HALFILE` is specified multiple times, the files are interpreted in the order they appear in the INI file.\nHAL files are descriptive, the execution of what is described in HAL files is triggered by the threads in which functions are embedded, not by the reading of the HAL file.\nAlmost all configurations will have at least one `HALFILE`, and stepper systems typically have two such files,\ni.e., one which specifies the generic stepper configuration ('core_stepper.hal') and one which specifies the machine pin out ('xxx_pinout.hal').\n\nHAL files specified in the `HALFILES` variable are found using a search.\nIf the named file is found in the directory containing the INI file, it is used.\nIf the named file is not found in this INI file directory, a search is made using a system library of HAL files.\n\nIf LinuxCNC is started with the `linuxcnc` script using the \"`-H` _dirname_\" option, the specified dirname is prepended to the search described above so that _dirname_ is searched first.\nThe \"`-H` _dirname_\" option may be specified more than once, directories are prepended in order.\n\nA HALFILE may also be specified as an absolute path (when the name starts with a '/' character).\nAbsolute paths are not recommended as their use may limit relocation of configurations.\n--\n* `HALFILE = texample.tcl` [_arg1_ [_arg2_] ...] - Execute the tcl file 'texample.tcl' at start up with arg1, arg2, etc. as argv list.\n Files with a .tcl suffix are processed as above but use haltcl for processing.\n See the <> for more information.\n* `HALFILE = LIB:sys_example.hal` - Execute the system library file _sys_example.hal_ at start up.\n Explicit use of the LIB: prefix causes use of the system library HALFILE without searching the INI file directory.\n* `HALFILE = LIB:sys_texample.tcl` [_arg1_ [_arg2_ ...]] - Execute the system library file _sys_texample.tcl_ at start up.\n Explicit use of the LIB: prefix causes use of the system library HALFILE without searching the INI file directory.\n\nHALFILE items specify files that loadrt HAL components and make signal connections between component pins.\nCommon mistakes are \n\n . omission of the addf statement needed to add a component's function(s) to a thread, \n . incomplete signal (net) specifiers.\n\nOmission of required addf statements is almost always an error.\nSignals usually include one or more input connections and a single output (but both are not strictly required).\nA system library file is provided to make checks for these conditions and report to stdout and in a pop-up GUI:\n\n[source,{ini}]\n----\nHALFILE = LIB:halcheck.tcl [nopopup]\n----\n\n[NOTE]\nThe LIB:halcheck.tcl line should be the last [HAL]HALFILE.\nSpecify the 'nopopup' option to suppress the popup message and allow immediate starting.\nConnections made using a POSTGUI_HALFILE are not checked.\n\n* `TWOPASS = ON` - Use twopass processing for loading HAL components.\n With TWOPASS processing, lines of files specified in `[HAL]HALFILE` are processed in two passes.\n In the first pass (pass0), all HALFILES are read and multiple appearances of loadrt and loadusr commands are accumulated.\n These accumulated load commands are executed at the end of pass0.\n This accumulation allows load lines to be specified more than once for a given component (provided the names= names used are unique on each use).\n In the second pass (pass1), the HALFILES are reread and all commands except the previously executed load commands are executed.\n* `TWOPASS = nodelete verbose` - The `TWOPASS` feature can be activated with any non-null string including the keywords verbose and nodelete.\n The verbose keyword causes printing of details to stdout.\n The nodelete keyword preserves temporary files in /tmp.\n\nFor more information see the <> chapter.\n\n* `HALCMD =` _command_ - Execute _command_ as a single HAL command.\n If `HALCMD` is specified multiple times, the commands are executed in the order they appear in the INI file.\n `HALCMD`-lines are executed after all `HALFILE`-lines.\n* `SHUTDOWN = shutdown.hal` - Execute the file 'shutdown.hal' when LinuxCNC is exiting.\n Depending on the hardware drivers used, this may make it possible to set outputs to defined values when LinuxCNC is exited normally.\n However, because there is no guarantee this file will be executed (for instance, in the case of a computer crash),\n it is not a replacement for a proper physical e-stop chain or other protections against software failure.\n* `POSTGUI_HALFILE = example2.hal` - Execute 'example2.hal' after the GUI has created its HAL pins.\n Some GUIs create HAL pins and support the use of a postgui halfile to use them.\n GUIs that support postgui HAL files include Touchy, AXIS, Gscreen, and GMOCCAPY. +\n See section <> for more information.\n* `HALUI = halui` - adds the HAL user interface pins. +\n For more information see the <> chapter.\n\n[[sub:ini:sec:halui]]\n=== [HALUI] section(((INI File,Sections,[HALUI] Section)))\n\n* `MDI_COMMAND = G53 G0 X0 Y0 Z0` -\n An MDI command can be executed by using `halui.mdi-command-00`. Increment the number for each command listed in the [HALUI] section.\n\n[[sub:ini:sec:applications]]\n=== [APPLICATIONS] Section(((INI File,Sections,[APPLICATIONS] Section)))\n\nLinuxCNC can start other applications before the specified GUI is started.\nThe applications can be started after a specified delay to allow for GUI-dependent actions (like creating GUI-specific HAL pins).\n\n* `DELAY =` _value_ - seconds to wait before starting other applications.\n A delay may be needed if an application has dependencies on `[HAL]POSTGUI_HALFILE` actions or GUI-created HAL pins (default `DELAY=0`).\n* `APP =` _appname_ [arg1 [arg2 ...]]' - Application to be started.\n This specification can be included multiple times.\n The appname can be explicitly named as an absolute or tilde specified filename (first character is / or ~),\n a relative filename (first characters of filename are ./), or as a file in the INI file directory.\n If no executable file is found using these names, then the user search PATH is used to find the application. +\n Examples:\n** Simulate inputs to HAL pins for testing (using sim_pin -- a simple GUI to set inputs to parameters, unconnected pins, or signals with no writers):\n+\n[source,{ini}]\n----\nAPP = sim_pin motion.probe-input halui.abort motion.analog-in-00\n----\n** Invoke halshow with a previuosly saved watchlist.\n Since LinuxCNC sets the working directory to the directory for the INI file, you can refer to files in that directory (example: my.halshow):\n+\n[source,{ini}]\n----\nAPP = halshow my.halshow\n----\n** Alternatively, a watchlist file identified with a full pathname could be specified:\n+\n[source,{ini}]\n----\nAPP = halshow ~/saved_shows/spindle.halshow\n----\n** Open halscope using a previously saved configuration:\n+\n[source,{ini}]\n----\nAPP = halscope -i my.halscope\n----\n\n[[sub:ini:sec:traj]]\n=== [TRAJ] Section(((INI File,Sections,[TRAJ] Section)))\n\n[WARNING]\n====\nThe new Trajectory Planner (TP) is on by default.\nIf you have no TP settings in your [TRAJ] section - LinuxCNC defaults to: +\nARC_BLEND_ENABLE = 1 +\nARC_BLEND_FALLBACK_ENABLE = 0 +\nARC_BLEND_OPTIMIZATION_DEPTH = 50 +\nARC_BLEND_GAP_CYCLES = 4 +\nARC_BLEND_RAMP_FREQ = 100\n====\n\nThe [TRAJ] section contains general parameters for the trajectory planning module in 'motion'.\n\n* `ARC_BLEND_ENABLE = 1` - Turn on new TP.\n If set to 0 TP uses parabolic blending (1 segment look ahead) (Default: 1).\n* `ARC_BLEND_FALLBACK_ENABLE = 0` - Optionally fall back to parabolic blends if the estimated speed is faster.\n However, this estimate is rough, and it seems that just disabling it gives better performance (Default: 0).\n* `ARC_BLEND_OPTIMIZATION_DEPTH = 50` - Look ahead depth in number of segments.\n+\nTo expand on this a bit, you can choose this value somewhat arbitrarily.\nHere's a formula to estimate how much 'depth' you need for a particular config:\n+\n----\n# n = v_max / (2.0 * a_max * t_c)\n# where:\n# n = optimization depth\n# v_max = max axis velocity (UU / sec)\n# a_max = max axis acceleration (UU / sec)\n# t_c = servo period (seconds)\n----\n+\nSo, a machine with a maximum axis velocity of 10 IPS, a max acceleration of 100 IPS^2^, and a servo period of 0.001 s would need:\n+\n10 / (2.0 * 100 * 0.001) = 50 segments to always reach maximum velocity along the fastest axis.\n+\nIn practice, this number isn't that important to tune, since the look ahead rarely needs the full depth unless you have lots of very short segments.\nIf during testing, you notice strange slowdowns and can't figure out where they come from, first try increasing this depth using the formula above.\n+\nIf you still see strange slowdowns, it may be because you have short segments in the program.\nIf this is the case, try adding a small tolerance for Naive CAM detection.\nA good rule of thumb is this:\n+\n----\n# min_length ~= v_req * t_c\n# where:\n# v_req = desired velocity in UU / sec\n# t_c = servo period (seconds)\n----\n+\nIf you want to travel along a path at 1 IPS = 60 IPM, and your servo period is 0.001 s, then any segments shorter than min_length will slow the path down.\nIf you set Naive CAM tolerance to around this min length, overly short segments will be combined together to eliminate this bottleneck.\nOf course, setting the tolerance too high means big path deviations, so you have to play with it a bit to find a good value.\nI'd start at 1/2 of the min_length, then work up as needed.\n* `ARC_BLEND_GAP_CYCLES = 4` How short the previous segment must be before the trajectory planner 'consumes' it.\n+\nOften, a circular arc blend will leave short line segments in between the blends.\nSince the geometry has to be circular, we can't blend over all of a line if the next one is a little shorter.\nSince the trajectory planner has to touch each segment at least once, it means that very tiny segments will slow things down significantly.\nMy fix to this way to \"consume\" the short segment by making it a part of the blend arc.\nSince the line+blend is one segment, we don't have to slow down to hit the very short segment.\nLikely, you won't need to touch this setting.\n* `ARC_BLEND_RAMP_FREQ = 20` - This is a 'cutoff' frequency for using ramped velocity.\n+\n'Ramped velocity' in this case just means constant acceleration over the whole segment.\nThis is less optimal than a trapezoidal velocity profile, since the acceleration is not maximized.\nHowever, if the segment is short enough, there isn't enough time to accelerate much before we hit the next segment.\nRecall the short line segments from the previous example.\nSince they're lines, there's no cornering acceleration, so we're free to accelerate up to the requested speed.\nHowever, if this line is between two arcs, then it will have to quickly decelerate again to be within the maximum speed of the next segment.\nThis means that we have a spike of acceleration, then a spike of deceleration, causing a large jerk, for very little performance gain.\nThis setting is a way to eliminate this jerk for short segments.\n+\nBasically, if a segment will complete in less time than 1 / ARC_BLEND_RAMP_FREQ, we don't bother with a trapezoidal velocity profile on that segment, and use constant acceleration.\n(Setting `ARC_BLEND_RAMP_FREQ = 1000` is equivalent to always using trapezoidal acceleration, if the servo loop is 1 kHz).\n+\nYou can characterize the worst-case loss of performance by comparing the velocity that a trapezoidal profile reaches vs. the ramp:\n+\n----\n# v_ripple = a_max / (4.0 * f)\n# where:\n# v_ripple = average velocity \"loss\" due to ramping\n# a_max = max axis acceleration\n# f = cutoff frequency from INI\n----\n+\nFor the aforementioned machine, the ripple for a 20 Hz cutoff frequency is 100 / (4 * 20) = 1.25 IPS.\nThis seems high, but keep in mind that it is only a worst-case estimate.\nIn reality, the trapezoidal motion profile is limited by other factors, such as normal acceleration or requested velocity, and so the actual performance loss should be much smaller.\nIncreasing the cutoff frequency can squeeze out more performance, but make the motion rougher due to acceleration discontinuities.\nA value in the range 20 Hz to 200 Hz should be reasonable to start.\n\nFinally, no amount of tweaking will speed up a tool path with lots of small, tight corners, since you're limited by cornering acceleration.\n\n* `SPINDLES = 3` - The number of spindles to support. It is imperative that this number matches the \"num_spindles\" parameter passed to the motion module.\n* `COORDINATES = X Y Z` - The names of the axes being controlled. Only X, Y, Z, A, B, C, U, V, W are valid.\n Only axes named in `COORDINATES` are accepted in G-code.\n It is permitted to write an axis name more than once (e.g., X Y Y Z for a gantry machine).\n For the common 'trivkins kinematics', joint numbers are assigned in sequence according to the trivkins parameter 'coordinates='.\n So, for trivkins 'coordinates=xz', joint0 corresponds to X and joint1 corresponds to Z.\n See the kinematics man page ('$ man kins') for information on trivkins and other kinematics modules.\n* `LINEAR_UNITS =` _ - (((LINEAR UNITS))) Specifies the 'machine units' for linear axes.\n Possible choices are mm or inch.\n This does not affect the linear units in NC code (the G20 and G21 words do this).\n* `ANGULAR_UNITS =` __ - (((ANGULAR UNITS))) Specifies the 'machine units' for rotational axes.\n Possible choices are 'deg', 'degree' (360 per circle), 'rad', 'radian' (2*π per circle), 'grad', or 'gon' (400 per circle).\n This does not affect the angular units of NC code. In RS274NGC, A-, B- and C- words are always expressed in degrees.\n* `DEFAULT_LINEAR_VELOCITY = 0.0167` - The initial rate for jogs of linear axes, in machine units per second.\n The value shown in 'AXIS' equals machine units per minute.\n* `DEFAULT_LINEAR_ACCELERATION = 2.0` - In machines with nontrivial kinematics, the acceleration used for \"teleop\" (Cartesian space) jogs, in 'machine units' per second per second.\n* `MAX_LINEAR_VELOCITY = 5.0` - (((MAX VELOCITY))) The maximum velocity for any axis or coordinated move, in 'machine units' per second.\n The value shown equals 300 units per minute.\n* `MAX_LINEAR_ACCELERATION = 20.0` - (((MAX ACCELERATION))) The maximum acceleration for any axis or coordinated axis move, in 'machine units' per second per second.\n* `POSITION_FILE =` _position.txt_ - If set to a non-empty value, the joint positions are stored between runs in this file.\n This allows the machine to start with the same coordinates it had on shutdown.\n This assumes there was no movement of the machine while powered off.\n If unset, joint positions are not stored and will begin at 0 each time LinuxCNC is started.\n This can help on smaller machines without home switches.\n If using the Mesa resolver interface this file can be used to emulate absolute encoders and eliminate the need for homing (with no loss of accuracy).\n See the hostmot2 manpage for more details.\n* `NO_FORCE_HOMING = 1` - The default behavior is for LinuxCNC to force the user to home the machine before any MDI command or a program is run.\n Normally, only jogging is allowed before homing.\n For configurations using identity kinematics, setting `NO_FORCE_HOMING = 1` allows the user to make MDI moves and run programs without homing the machine first.\n Interfaces using identity kinematics without homing ability will need to have this option set to 1.\n\n[WARNING]\n====\nLinuxCNC will not know your joint travel limits when using `NO_FORCE_HOMING = 1`.\n====\n\n* `HOME = 0 0 0 0 0 0 0 0 0` - World home position needed for kinematics modules that compute world coordinates using kinematicsForward() when switching from joint to teleop mode.\n Up to nine coordinate values (X Y Z A B C U V W) may be specified, unused trailing items may be omitted.\n This value is only used for machines with nontrivial kinematics.\n On machines with trivial kinematics (mill, lathe, gantry types) this value is ignored.\n Note: The sim hexapod config requires a non-zero value for the Z coordinate.\n* `TPMOD =` _alternate_trajectory_planning module_ [tp_parms=value] +\n The `TPMOD` variable is optional. If specified, use a specified (user-built) module instead of the default (tpmod).\n Module parameters (tp_parms) may be included if supported by the named module.\n The setting may be overridden from the command line using the -t option ($ linuxcnc -h).\n* `NO_PROBE_JOG_ERROR = 0` - Allow to bypass probe tripped check when you jog manually.\n* `NO_PROBE_HOME_ERROR = 0` - Allow to bypass probe tripped check when homing is in progress.\n\n\n[[sub:ini:sec:kins]]\n=== [KINS] Section(((INI File,Sections,KINS Section)))\n\n* `JOINTS = 3` - Specifies the number of joints (motors) in the system.\n For example, a trivkins XYZ machine with a single motor for each axis has 3 joints.\n A gantry machine with one motor on each of two of the axes, and two motors on the third axis, has 4 joints.\n (This config variable may be used by a GUI to set the number of joints (num_joints) specified to the motion module (motmod).)\n* `KINEMATICS = trivkins` - Specify a kinematics module for the motion module.\n GUIs may use this variable to specify the `loadrt`-line in HAL files for the motmod module.\n For more information on kinematics modules see the manpage: `$ man kins`.\n\n[[sub:ini:sec:axis-letter]]\n=== [AXIS_] Section(((INI File,Sections,[AXIS_] Sections)))\n\nThe __ specifies one of: X Y Z A B C U V W\n\n* `TYPE = LINEAR` - The type of this axis, either `LINEAR` or `ANGULAR`.\n Required if this axis is not a default axis type.\n The default axis types are X,Y,Z,U,V,W = LINEAR and A,B,C = ANGULAR.\n This setting is effective with the AXIS GUI but note that other\n GUI's may handle things differently.\n* `MAX_VELOCITY = 1.2` - Maximum velocity for this axis in <> per second.\n* `MAX_ACCELERATION = 20.0` - Maximum acceleration for this axis in machine units per second squared.\n* `MIN_LIMIT = -1000` - (((MIN LIMIT))) The minimum limit (soft limit) for axis motion, in machine units.\n When this limit is exceeded, the controller aborts axis motion.\n The axis must be homed before `MIN_LIMIT` is in force.\n For a rotary axis (A,B,C typ) with unlimited rotation having no `MIN_LIMIT` for that axis in the `[AXIS_``]` section a value of -1e99 is used.\n* `MAX_LIMIT = 1000` - (((MAX LIMIT))) The maximum limit (soft limit) for axis motion, in machine units.\n When this limit is exceeded, the controller aborts axis motion.\n The axis must be homed before MAX_LIMIT is in force.\n For a rotary axis (A,B,C typ) with unlimited rotation having no `MAX_LIMIT` for that axis in the `[AXIS_``]` section a value of 1e99 is used.\n* `WRAPPED_ROTARY = 1` - When this is set to 1 for an ANGULAR axis the axis will move 0-359.999 degrees.\n Positive Numbers will move the axis in a positive direction and negative numbers will move the axis in the negative direction.\n* `LOCKING_INDEXER_JOINT = 4` - This value selects a joint to use for a locking indexer for the specified axis __.\n In this example, the joint is 4 which would correspond to the B axis for a XYZAB system with trivkins (identity) kinematics.\n When set, a G0 move for this axis will initiate an unlock with the `joint.4.unlock pin` then wait for the `joint.4.is-unlocked` pin then move the joint at the rapid rate for that joint.\n After the move the `joint.4.unlock` will be false and motion will wait for `joint.4.is-unlocked` to go false.\n Moving with other joints is not allowed when moving a locked rotary joint.\n To create the unlock pins, use the motmod parameter:\n+\n[source,{ini}]\n----\nunlock_joints_mask=jointmask\n----\n+\nThe jointmask bits are: (LSB)0:joint0, 1:joint1, 2:joint2, ...\n+\nExample: `loadrt motmod ... unlock_joints_mask=0x38` creates unlock-pins for joints 3,4,5.\n\n* `OFFSET_AV_RATIO = 0.1` - If nonzero, this item enables the use of HAL input pins for external axis offsets:\n+\n[source,{ini}]\n----\naxis..eoffset-enable\naxis..eoffset-count\naxis..eoffset-scale\n----\n\nSee the chapter: <> for usage information.\n\n[[sub:ini:sec:joint-num]]\n=== [JOINT_] Sections(((INI File,Sections,[JOINT_] Sections)))\n\nThe __ specifies the joint number 0 ... (num_joints-1)\nThe value of 'num_joints' is set by `[KINS]JOINTS=`.\n\nThe `[JOINT_0]`, `[JOINT_1]`, etc. sections contains general parameters for the individual components in the joint control module.\nThe joint section names begin numbering at 0, and run through the number of joints specified in the `[KINS]JOINTS` entry minus 1.\n\nTypically (for systems using 'trivkins kinematics', there is a 1:1 correspondence between a joint and an axis coordinate letter):\n\n* JOINT_0 = X\n* JOINT_1 = Y\n* JOINT_2 = Z\n* JOINT_3 = A\n* JOINT_4 = B\n* JOINT_5 = C\n* JOINT_6 = U\n* JOINT_7 = V\n* JOINT_8 = W\n\nOther kinematics modules with identity kinematics are available to support configurations with partial sets of axes.\nFor example, using trivkins with `coordinates=XZ`, the joint-axes relationships are:\n\n* JOINT_0 = X\n* JOINT_1 = Z\n\nFor more information on kinematics modules see the manpage 'kins' (on the UNIX terminal type `man kins`).\n\n* `TYPE = LINEAR` - The type of joint, either `LINEAR` or `ANGULAR`.\n* `UNITS = INCH` - (((UNITS)))\n If specified, this setting overrides the related `[TRAJ] UNITS` setting,\n e.g., `[TRAJ]LINEAR_UNITS` if the `TYPE` of this joint is `LINEAR`, `[TRAJ]ANGULAR_UNITS` if the `TYPE` of this joint is `ANGULAR`.\n* `MAX_VELOCITY = 1.2` - Maximum velocity for this joint in <> per second.\n* `MAX_ACCELERATION = 20.0` - Maximum acceleration for this joint in machine units per second squared.\n* `BACKLASH = 0.0000` - (((Backlash))) Backlash in machine units.\n Backlash compensation value can be used to make up for small deficiencies in the hardware used to drive an joint.\n If backlash is added to an joint and you are using steppers the `STEPGEN_MAXACCEL` must be increased to 1.5 to 2 times the `MAX_ACCELERATION` for the joint.\n Excessive backlash compensation can cause an joint to jerk as it changes direction.\n If a COMP_FILE is specified for a joint BACKLASH is not used.\n// add a link to machine units\n* `COMP_FILE =` _file.extension_ - (((Compensation)))\n The compensation file consists of map of position information for the joint.\n Compensation file values are in machine units.\n Each set of values are are on one line separated by a space.\n The first value is the nominal value (the commanded position).\n The second and third values depend on the setting of `COMP_FILE_TYPE`.\n Points in between nominal values are interpolated between the two nominals.\n Compensation files must start with the smallest nominal and be in ascending order to the largest value of nominals.\n File names are case sensitive and can contain letters and/or numbers.\n Currently the limit inside LinuxCNC is for 256 triplets per joint.\n+\nIf `COMP_FILE` is specified for a joint, `BACKLASH` is not used.\n\n* `COMP_FILE_TYPE = 0` or `1` - Specifies the type of compensation file.\n The first value is the nominal (commanded) position for both types. +\n A `COMP_FILE_TYPE` must be specified for each `COMP_FILE`.\n** 'Type 0:' The second value specifies the actual position as the joint is moving in the positive direction (increasing value).\n The third value specifies the actual position as the joint is moving in the negative direction (decreasing value).\n+\n.Type 0 Example\n----\n-1.000 -1.005 -0.995\n0.000 0.002 -0.003\n1.000 1.003 0.998\n----\n\n** 'Type 1:' The second value specifies positive offset from nominal while traveling in the positive direction.\n The third value specifies the negative offset from nominal while traveling in a negative direction.\n+\n.Type 1 Example\n----\n-1.000 0.005 -0.005\n0.000 0.002 -0.003\n1.000 0.003 -0.004\n----\n\n* `MIN_LIMIT = -1000` - (((MIN LIMIT)))\n The minimum limit for joint motion, in machine units.\n When this limit is reached, the controller aborts joint motion.\n For a rotary joint with unlimited rotation having no `MIN_LIMIT` for that joint in the `[JOINT_N]` section a the value -1e99 is used.\n* `MAX_LIMIT = 1000` - (((MAX LIMIT)))\n The maximum limit for joint motion, in machine units.\n When this limit is reached, the controller aborts joint motion.\n For a rotary joint with unlimited rotation having no `MAX_LIMIT` for that joint in the `[JOINT_N]` section a the value 1e99 is used.\n\n[NOTE]\n====\nFor *identity* kinematics, the `[JOINT_N]MIN_LIMIT`/`MAX_LIMIT` settings must equal or exceed the corresponding (one-to-one identity) `[AXIS_L]` limits.\nThese settings are verified at startup when the trivkins kinematics modules is specified.\n====\n\n[NOTE]\n====\nThe `[JOINT_N]MIN_LIMIT`/`MAX_LIMIT` settings are enforced while jogging in joint mode prior to homing.\nAfter homing, `[AXIS_L]MIN_LIMIT`/`MAX_LIMIT` coordinate limits are used as constraints for axis (coordinate letter) jogging\nand by the trajectory planning used for G-code moves (programs and MDI commands).\nThe trajectory planner works in Cartesian space (XYZABCUVW) and has no information about the motion of joints implemented by *any* kinematics module.\nIt is possible for joint limit violations to occur for G-code that obeys trajectory planning position limits when non identity kinematics are used.\nThe motion module always detects joint position limit violations and faults if they occur during the execution of G-code commands.\nSee also related https://github.com/LinuxCNC/linuxcnc/issues/97[GitHub issue #97].\n====\n\n* `MIN_FERROR = 0.010` - (((MIN FERROR)))\n This is the value in machine units by which the joint is permitted to deviate from commanded position at very low speeds.\n If MIN_FERROR is smaller than FERROR, the two produce a ramp of error trip points.\n You could think of this as a graph where one dimension is speed and the other is permitted following error.\n As speed increases the amount of following error also increases toward the `FERROR` value.\n* `FERROR = 1.0` - (((FERROR))) `FERROR` is the maximum allowable following error, in machine units.\n If the difference between commanded and sensed position exceeds this amount, the controller disables servo calculations,\n sets all the outputs to 0.0, and disables the amplifiers. If `MIN_FERROR` is present in the INI file, velocity-proportional following errors are used.\n Here, the maximum allowable following error is proportional to the speed,\n with `FERROR` applying to the rapid rate set by `[TRAJ]MAX_VELOCITY`, and proportionally smaller following errors for slower speeds.\n The maximum allowable following error will always be greater than `MIN_FERROR`.\n This prevents small following errors for stationary axes from inadvertently aborting motion.\n Small following errors will always be present due to vibration, etc.\n* `LOCKING_INDEXER = 1` - Indicates the joint is used as a locking indexer.\n\n==== Homing\n\nThese parameters are Homing related, for a better explanation read the <> Chapter.\n\n* `HOME = 0.0` - The position that the joint will go to upon completion of the homing sequence.\n* `HOME_OFFSET = 0.0` -\n The joint position of the home switch or index pulse, in <>.\n When the home point is found during the homing process, this is the position that is assigned to that point.\n When sharing home and limit switches and using a home sequence that will leave the home/limit switch in the toggled state,\n the home offset can be used define the home switch position to be other than 0 if your HOME position is desired to be 0.\n* `HOME_SEARCH_VEL = 0.0` - (((HOME SEARCH VEL))) Initial homing velocity in machine units per second.\n Sign denotes direction of travel.\n A value of zero means assume that the current location is the home position for the machine.\n If your machine has no home switches you will want to leave this value at zero.\n* `HOME_LATCH_VEL = 0.0` -\n Homing velocity in machine units per second to the home switch latch position.\n Sign denotes direction of travel.\n* `HOME_FINAL_VEL = 0.0` -\n Velocity in machine units per second from home latch position to home position.\n If left at 0 or not included in the joint rapid velocity is used.\n Must be a positive number.\n* `HOME_USE_INDEX = NO` -\n If the encoder used for this joint has an index pulse, and the motion card has provision for this signal you may set it to yes.\n When it is yes, it will affect the kind of home pattern used.\n Currently, you can't home to index with steppers unless you're using StepGen in velocity mode and PID.\n* `HOME_INDEX_NO_ENCODER_RESET = NO` -\n Use YES if the encoder used for this joint does not reset its counter when an index pulse is detected after assertion of the joint `index_enable` HAL pin.\n Applicable only for `HOME_USE_INDEX = YES`.\n* `HOME_IGNORE_LIMITS = NO` -\n When you use the limit switch as a home switch and the limit switch this should be set to YES.\n When set to YES the limit switch for this joint is ignored when homing.\n You must configure your homing so that at the end of your home move the home/limit switch is not in the toggled state you will get a limit switch error after the home move.\n* `HOME_IS_SHARED =` __ -\n If the home input is shared by more than one joint set __ to 1 to prevent homing from starting if the one of the shared switches is already closed.\n Set __ to 0 to permit homing if a switch is closed.\n* `HOME_ABSOLUTE_ENCODER = 0` | `1` | `2` - Used to indicate the joint uses an absolute encoder.\n At a request for homing, the current joint value is set to the `HOME_OFFSET` value.\n If the `HOME_ABSOLUTE_ENCODER` setting is 1, the machine makes the usual final move to the `HOME` value.\n If the `HOME_ABSOLUTE_ENCODER` setting is 2, no final move is made.\n* `HOME_SEQUENCE =` __ - Used to define the \"Home All\" sequence.\n __ must start at `0` or `1` or `-1`.\n Additional sequences may be specified with numbers increasing by 1 (in absolute value).\n Skipping of sequence numbers is not allowed.\n If a `HOME_SEQUENCE` is omitted, the joint will not be homed by the \"Home All\" function.\n More than one joint can be homed at the same time by specifying the same sequence number for more than one joint.\n A negative sequence number is used to defer the final move for all joints having that (negative or positive) sequence number.\n For additional info, see: <>.\n* `VOLATILE_HOME = 0` -\n When enabled (set to `1`) this joint will be unhomed if the Machine Power is off or if E-Stop is on.\n This is useful if your machine has home switches and does not have position feedback such as a step and direction driven machine.\n\n==== Servos\n\nThese parameters are relevant to joints controlled by servos.\n\n[WARNING]\nThe following are custom INI file entries that you may find in a sample INI file or a wizard generated file.\nThese are not used by the LinuxCNC software.\nThey are only there to put all the settings in one place.\nFor more information on custom INI file entries see the <> subsection.\n\nThe following items might be used by a PID component and the assumption is that the output is volts.\n\n* `DEADBAND = 0.000015` - How close is close enough to consider the motor in position, in <>.\n+\n--\nThis is often set to a distance equivalent to 1, 1.5, 2, or 3 encoder counts, but there are no strict rules.\nLooser (larger) settings allow less servo 'hunting' at the expense of lower accuracy.\nTighter (smaller) settings attempt higher accuracy at the expense of more servo 'hunting'.\nIs it really more accurate if it's also more uncertain?\nAs a general rule, it's good to avoid, or at least limit, servo 'hunting' if you can.\n\nBe careful about going below 1 encoder count, since you may create a condition where there is no place that your servo is happy.\nThis can go beyond 'hunting' (slow) to 'nervous' (rapid), and even to 'squealing' which is easy to confuse with oscillation caused by improper tuning.\nBetter to be a count or two loose here at first, until you've been through 'gross tuning' at least.\n\nExample of calculating machine units per encoder pulse to use in deciding `DEADBAND` value:\n\n////////////////////////////////////////////////////////////////////////\nlatexmath:[ \\frac{X\\, inches}{1\\, encoder\\, count} =\n\\frac{1\\, revolution}{1000\\, encoder\\, lines} \\times\n\\frac{1\\, encoder\\, line}{4\\, quadrature\\, counts} \\times\n\\frac{0.200\\, inches}{1\\, revolution} =\n\\frac{0.200\\, inches}{4000\\, encoder\\, counts} =\n\\frac{0.000050\\, inches}{1\\, encoder\\, count} ]\n////////////////////////////////////////////////////////////////////////\n\nimage::images/encoder-counts-math.png[align=\"center\"]\n--\n\n* `BIAS = 0.000` - This is used by hm2-servo and some others.\n Bias is a constant amount that is added to the output.\n In most cases it should be left at zero.\n However, it can sometimes be useful to compensate for offsets in servo\n amplifiers, or to balance the weight of an object that moves vertically.\n Bias is turned off when the PID loop is disabled, just like all other components of the output.\n* `P = 50` - The proportional gain for the joint servo.\n This value multiplies the error between commanded and actual position in machine units, resulting in a contribution to the computed voltage for the motor amplifier.\n The units on the P gain are volts per machine unit, e.g., image:images/p-term.png[height=25]\n//latexmath:[$\\frac{volt}{mu}$].\n* `I = 0` - The integral gain for the joint servo.\n The value multiplies the cumulative error between commanded and actual position in machine units, resulting in a contribution to the computed voltage for the motor amplifier.\n The units on the I gain are volts per machine unit second, e.g., image:images/i-term.png[height=25]\n//latexmath:[$\\frac{volt}{mu\\, s}$].\n* `D = 0` - The derivative gain for the joint servo.\n The value multiplies the difference between the current and previous errors, resulting in a contribution to the computed voltage for the motor amplifier.\n The units on the D gain are volts per machine unit per second, e.g., image:images/i-term.png[height=25]\n// latexmath:[$\\frac{volt}{mu/s}$].\n* `FF0 = 0` - The 0^th^ order feed forward gain.\n This number is multiplied by the commanded position, resulting in a contribution to the computed voltage for the motor amplifier.\n The units on the FF0 gain are volts per machine unit, e.g., image:images/p-term.png[height=25]\n// latexmath:[$\\frac{volt}{mu}$].\n* `FF1 = 0` - The 1^st^ order feed forward gain.\n This number is multiplied by the change in commanded position per second, resulting in a contribution to the computed voltage for the motor amplifier.\n The units on the FF1 gain are volts per machine unit per second, e.g., image:images/i-term.png[height=25]\n// latexmath:[$\\frac{volt}{mu\\, s}$].\n* `FF2 = 0` - The 2^nd^ order feed forward gain.\n This number is multiplied by the change in commanded position per second per second, resulting in a contribution to the computed voltage for the motor amplifier.\n The units on the FF2 gain are volts per machine unit per second per second, e.g., image:images/ff2.png[height=25]\n// latexmath:[$\\frac{volt}{mu\\, s^{2}}$].\n* `OUTPUT_SCALE = 1.000`\n* `OUTPUT_OFFSET = 0.000`\n+\n--\nThese two values are the scale and offset factors for the joint output to the motor amplifiers.\n\nThe second value (offset) is subtracted from the computed output (in volts), and divided by the first value (scale factor), before being written to the D/A converters.\nThe units on the scale value are in true volts per DAC output volts.\nThe units on the offset value are in volts.\nThese can be used to linearize a DAC.\nSpecifically, when writing outputs, the LinuxCNC first converts the desired output in quasi-SI units to raw actuator values, e.g., Volts for an amplifier DAC.\nThis scaling looks like: image:images/output-offset.png[]\n\n// latexmath:[raw=\\frac{output-offset}{scale}]\n\nThe value for scale can be obtained analytically by doing a unit analysis, i.e., units are [output SI units]/[actuator units].\nFor example, on a machine with a velocity mode amplifier such that 1 V results in 250 mm/s velocity.\n\nimage::images/scale-math.png[align=\"center\"]\n\n// latexmath:[$ amplifier [volts] = (output [\\frac{mm}{sec}]\n// - offset [\\frac{mm}{sec}]) / 250 \\frac{mm}{sec\\, volt} ] $]\n\nNote that the units of the offset are in machine units, e.g. mm/s, and they are pre-subtracted from the sensor readings.\nThe value for this offset is obtained by finding the value of your output which yields 0.0 for the actuator output.\nIf the DAC is linearized, this offset is normally 0.0.\n\nThe scale and offset can be used to linearize the DAC as well, resulting in values that reflect the combined effects of amplifier gain, DAC non-linearity, DAC units, etc.\n\nTo do this, follow this procedure.\n\n. Build a calibration table for the output, driving the DAC with a desired voltage and measuring the result.\n. Do a least-squares linear fit to get coefficients a, b such that image:images/calibration-1.png[]\n. Note that we want raw output such that our measured result is identical to the commanded output. This means\n.. image:images/calibration-2.png[]\n.. image:images/calibration-3.png[]\n. As a result, the a and b coefficients from the linear fit can be used as the scale and offset for the controller directly.\n\nSee the following table for an example of voltage measurements.\n\n// latexmath:[ meas=a*raw+b ]\n// latexmath:[ cmd=a*raw+b ]\n// latexmath:[ raw=(cmd-b)/a ]\n\n.Output Voltage Measurements\n[width=\"50%\",cols=\"2*^\",options=\"header\"]\n|===\n|Raw | Measured\n|-10 | -9.93\n| -9 | -8.83\n| 0 | -0.03\n| 1 | 0.96\n| 9 | 9.87\n| 10 | 10.87\n|===\n--\n\n* `MAX_OUTPUT = 10` - The maximum value for the output of the PID compensation that is written to the motor amplifier, in volts.\n The computed output value is clamped to this limit.\n The limit is applied before scaling to raw output units.\n The value is applied symmetrically to both the plus and the minus side.\n* `INPUT_SCALE = 20000` - in Sample configs\n* `ENCODER_SCALE = 20000` - in PnCconf built configs\n\nSpecifies the number of pulses that corresponds to a move of one machine unit as set in the `[TRAJ]` section.\nFor a linear joint one machine unit will be equal to the setting of `LINEAR_UNITS`.\nFor an angular joint one unit is equal to the setting in `ANGULAR_UNITS`.\nA second number, if specified, is ignored.\nFor example, on a 2000 counts per rev encoder, and 10 revs/inch gearing, and desired units of inch, we have:\n\nimage::images/encoder-scale.png[align=\"center\"]\n\n//latexmath:[ INPUT\\_SCALE =\n//\\frac{2000\\, counts}{rev} \\times \\frac{10\\, rev}{inch} =\n//\\frac{20000\\, counts}{inch} ]\n\n==== Stepper\n\nThese parameters are relevant to joints controlled by steppers.\n\n[WARNING]\nThe following are custom INI file entries that you may find in a sample INI file or a wizard generated file.\nThese are not used by the LinuxCNC software and meant only to put all the settings in one place.\nFor more information on custom INI file entries see the <> subsection.\n\nThe following items might be used by a StepGen component.\n\n* `SCALE = 4000` - in Sample configs\n* `STEP_SCALE = 4000` - in PnCconf built configs\n\nSpecifies the number of pulses that corresponds to a move of one machine unit as set in the `[TRAJ]` section.\nFor stepper systems, this is the number of step pulses issued per machine unit.\nFor a linear joint one machine unit will be equal to the setting of `LINEAR_UNITS`.\nFor an angular joint one unit is equal to the setting in `ANGULAR_UNITS`.\nFor servo systems, this is the number of feedback pulses per machine unit.\nA second number, if specified, is ignored.\n\nFor example, on a 1.8 degree stepper motor with half-stepping, and 10 revs/inch gearing, and desired <> of inch, we have:\n\nimage::images/stepper-scale.png[align=\"center\"]\n\n//latexmath:[ scale =\n//\\frac{2\\, steps}{1.8\\, degree} \\times \\frac{360\\, degree}{rev} \\times \\frac{10\\, rev}{inch} =\n//\\frac{4000\\, steps}{inch} ]\n\n[NOTE]\nOld INI and HAL files used `INPUT_SCALE` for this value.\n\n* `ENCODER_SCALE = 20000` (Optionally used in PnCconf built configs) -\n Specifies the number of pulses that corresponds to a move of one machine unit as set in the `[TRAJ]` section.\n For a linear joint one machine unit will be equal to the setting of `LINEAR_UNITS`.\n For an angular joint one unit is equal to the setting in `ANGULAR_UNITS`.\n A second number, if specified, is ignored.\n For example, on a 2000 counts per rev encoder, and 10 revs/inch gearing, and desired units of inch, we have:\n\nimage::images/encoder-scale.png[align=\"center\"]\n\n//latexmath:[ ENCODER\\_SCALE =\n//\\frac{2000\\, counts}{rev} \\times \\frac{10\\, rev}{inch} =\n//\\frac{20000\\, counts}{inch} ]\n\n* `STEPGEN_MAXACCEL = 21.0` - Acceleration limit for the step generator.\n This should be 1% to 10% larger than the joint `MAX_ACCELERATION`.\n This value improves the tuning of StepGen's \"position loop\".\n If you have added backlash compensation to an joint then this should be 1.5 to 2 times greater than `MAX_ACCELERATION`.\n* `STEPGEN_MAXVEL = 1.4` - Older configuration files have a velocity limit for the step generator as well.\n If specified, it should also be 1% to 10% larger than the joint `MAX_VELOCITY`.\n Subsequent testing has shown that use of `STEPGEN_MAXVEL` does not improve the tuning of StepGen's position loop.\n\n[[sub:ini:sec:spindle-num]]\n=== [SPINDLE_] Section(s)(((INI File,Sections,[SPINDLE_] Section(s))))\n\nThe __ specifies the spindle number 0 ... (num_spindles-1) +\nThe value of _num_spindles_ is set by `[TRAJ]SPINDLES=` . +\nBy default maximum velocity of the spindle in forward and reverse is approximately 2147483000 RPM. +\nBy default minimum velocity of the spindle in forward and reverse is 0 RPM. +\nBy default the increment is 100 RPM. +\nYou change these default by setting the following INI variables:\n\n[NOTE]\nThese settings are for the motion controller component.\nControl screens can limit these settings further. \n\n* `MAX_FORWARD_VELOCITY = 20000`\n The maximum spindle speed (in rpm) for the specified spindle. Optional.\n This will also set MAX_REVERSE_VELOCITY to the negative value unless overridden.\n* `MIN_FORWARD_VELOCITY = 3000`\n The minimum spindle speed (in rpm) for the specified spindle. Optional.\n Many spindles have a minimum speed below which they should not be run.\n Any spindle speed command below this limit will be /increased/ to this limit.\n* `MAX_REVERSE_VELOCITY = 20000`\n This setting will default to `MAX_FORWARD_VELOCITY` if omitted.\n It can be used in cases where the spindle speed is limited in reverse.\n Set to zero for spindles which must not be run in reverse.\n In this context \"max\" refers to the absolute magnitude of the spindle speed.\n* `MIN_REVERSE_VELOCITY = 3000``\n This setting is equivalent to `MIN_FORWARD_VELOCITY` but for reverse spindle rotation.\n It will default to the MIN_FORWARD_VELOCITY if omitted.\n* `INCREMENT = 200`\n Sets the step size for spindle speed increment / decrement commands.\n This can have a different value for each spindle.\n This setting is effective with AXIS and Touchy but note that some\n control screens may handle things differently.\n* `HOME_SEARCH_VELOCITY = 100` - FIXME: Spindle homing not yet working.\n Sets the homing speed (rpm) for the spindle.\n The spindle will rotate at this velocity during the homing sequence until the spindle index is located, at which point the spindle position will be set to zero.\n Note that it makes no sense for the spindle home position to be any value other than zero, and so there is no provision to do so.\n* `HOME_SEQUENCE = 0` - FIXME: Spindle homing not yet working\n Controls where in the general homing sequence the spindle homing rotations occur.\n Set the `HOME_SEARCH_VELOCITY` to zero to avoid spindle rotation during the homing sequence.\n\n[[sub:ini:sec:emcio]]\n=== [EMCIO] Section(((INI File,Sections,[EMCIO] Section)))\n\n* `EMCIO = io` - Name of IO controller program.\n* `CYCLE_TIME = 0.100` - The period, in seconds, at which EMCIO will run.\n Making it 0.0 or a negative number will tell EMCIO not to sleep at all.\n There is usually no need to change this number.\n* `TOOL_TABLE = tool.tbl` - The file which contains tool information, described in the User Manual.\n* `DB_PROGRAM = db_program` - Path to an executable program that manages tool data.\n When a DB_PROGRAM is specified, a TOOL_TABLE entry is ignored.\n* `TOOL_CHANGE_POSITION = 0 0 2` -\n Specifies the XYZ location to move to when performing a tool change if three digits are used.\n Specifies the XYZABC location when 6 digits are used.\n Specifies the XYZABCUVW location when 9 digits are used.\n Tool Changes can be combined.\n For example if you combine the quill up with change position you can move the Z first then the X and Y.\n* `TOOL_CHANGE_WITH_SPINDLE_ON = 1` -\n The spindle will be left on during the tool change when the value is 1.\n Useful for lathes or machines where the material is in the spindle, not the tool.\n* `TOOL_CHANGE_QUILL_UP = 1` -\n The Z axis will be moved to machine zero prior to the tool change when the value is 1.\n This is the same as issuing a `G0 G53 Z0`.\n* `TOOL_CHANGE_AT_G30 = 1` -\n The machine is moved to reference point defined by parameters 5181-5186 for G30 if the value is 1.\n For more information see <> and <>.\n* `RANDOM_TOOLCHANGER = 1` -\n This is for machines that cannot place the tool back into the pocket it came from.\n For example, machines that exchange the tool in the active pocket with the tool in the spindle.\n\n// vim: set syntax=asciidoc:\n"} {"id": "linuxcnc-docs:docs/src/config/python-hal-interface.adoc", "source": "linuxcnc-docs", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "docs/src/config/python-hal-interface.adoc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/docs/src/config/python-hal-interface.adoc", "license": "GFDL-1.1-or-later", "encoding": "utf-8", "sha256": "c8c1f46568f6e78a07bb48421c10bb5c707a12e2855f95b3c797014189f1d9c7", "bytes": 3824, "tokens": 1451, "text": ":lang: en\n:toc:\n\n[[cha:python-hal-interface]]\n= The HAL Python module\n\n:ini: {basebackend@docbook:'':ini}\n:hal: {basebackend@docbook:'':hal}\n:ngc: {basebackend@docbook:'':ngc}\n\nThis documentation describes the `hal` python module, which provides\na Python API for creating and accessing HAL pins and signals.\n\n\n== Basic usage\n\n\n[source,python]\n----\n#!/usr/bin/env python3\nimport hal, time\nh = hal.component(\"passthrough\")\nh.newpin(\"in\", hal.HAL_FLOAT, hal.HAL_IN)\nh.newpin(\"out\", hal.HAL_FLOAT, hal.HAL_OUT)\nh.ready()\n----\n\n== Functions\n\n\n*component*:: +\nThe component itself is created by a call to the constructor `hal.component`.\nThe arguments are the HAL component name and (optionally) the\nprefix used for pin and parameter names. If the prefix is not\nspecified, the component name is used. +\n.Example\n[source,python]\n----\nh = hal.component(\"passthrough\")\n----\n\n*newpin*:: +\nCreate new pin. +\nArguments: pin name suffix, pin type, and pin direction. For\nparameters, the arguments are: parameter name suffix, parameter type,\nand parameter direction. +\n.Example:\n[source,python]\n----\nh.newpin(\"in\", hal.HAL_FLOAT, hal.HAL_IN)\n----\n\n\n*ready* ::\nTells the HAL system the component is initialized. Locks out adding pins.\n\n*unready* ::\nAllows a component to add pins after 'ready()' has been called.\nOne should call 'ready()' on the component after.\n\n*component_exists* ::\nDoes the specified component exist at this time.\n\n.Example\n----\nhal.component_exists(\"testpanel\")\n----\n\n*component_is_ready* ::\nIs the specified component ready at this time.\n\n.Example\n----\nhal.component_is_ready(\"testpanel\")\n----\n\n*get_msg_level* ::\nGet the current Realtime msg level.\n\n*set_msg_level* ::\nSet the current Realtime msg level.\nused for debugging information.\n\n*connect* ::\nConnect a pin to a signal.\n\n.Example\n----\nhal.connect(\"pinname\",\"signal_name\")\n----\n\n*disconnect* ::\nDisconnect a pin from a signal.\n\n.Example\n----\nhal.disconnect(\"pinname\")\n----\n\n*get_value* ::\nRead a pin, param, or signal directly.\n\n.Example\n[source,python]\n----\nvalue = hal.get_value(\"iocontrol.0.emc-enable-in\")\n----\n\n*get_info_pins()* ::\nReturns a list of dicts of all system pins.\n\n[source,python]\n----\nlistOfDicts = hal.get_info_pins()\npinName1 = listOfDicts[0].get('NAME')\npinValue1 = listOfDicts[0].get('VALUE')\npinType1 = listOfDicts[0].get('TYPE')\npinDirection1 = listOfDicts[0].get('DIRECTION')\n----\n\n*get_info_signals()* ::\nReturns a list of dicts of all system signals.\n\n[source,python]\n----\nlistOfDicts = hal.get_info_signals()\nsignalName1 = listOfDicts[0].get('NAME')\nsignalValue1 = listOfDicts[0].get('VALUE')\ndriverPin1 = listOfDicts[0].get('DRIVER')\n----\n\n*get_info_params()* ::\nReturns a list of dicts of all system parameters.\n\n[source,python]\n----\nlistOfDicts = hal.get_info_params()\nparamName1 = listOfDicts[0].get('NAME')\nparamValue1 = listOfDicts[0].get('VALUE')\nparamDirection1 = listOfDicts[0].get('DIRECTION')\n----\n\n*new_sig* ::\nCreate a new signal of the type specified.\n\n.Example\n[source,python]\n----\nhal.new_sig(\"signalname\",hal.HAL_BIT)\n----\n\n*pin_has_writer* ::\nDoes the specified pin have a driving pin connected. +\nReturns True or False.\n\n----\nh.in.pin_has_writer()\n----\n\n*get_name* ::\nGet the HAL object name. +\nReturn a string.\n\n----\nh.in.get_name()\n----\n\n*get_type* ::\nGet the HAL object's type. +\nReturns an integer.\n\n----\nh.in.get_type()\n----\n\n*get_dir* ::\nGet the HAL object direction type. +\nReturns an integer.\n\n----\nh.in.get_dir()\n----\n\n*get* ::\nGet the HAL object value.\n\n----\nh.in.get()\n----\n\n*set* ::\nSet the HAL object value.\n\n----\nh.out.set(10)\n----\n\n*is_pin* ::\nIs the object a pin or parameter? +\nReturns True or False.\n\n----\nh.in.is_pin()\n----\n\n*sampler_base* ::\nTODO\n\n*stream_base* ::\nTODO\n\n*stream* ::\nTODO\n\n*set_p* ::\nSet a pin value of any pin in the HAL system.\n\n.Example\n----\nhal.set_p(\"pinname\",\"10\")\n----\n"} {"id": "linuxcnc-docs:docs/src/drivers/pmx485.adoc", "source": "linuxcnc-docs", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "docs/src/drivers/pmx485.adoc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/docs/src/drivers/pmx485.adoc", "license": "GFDL-1.1-or-later", "encoding": "utf-8", "sha256": "4fe8dd110c45e161ed7a750fe865095e5896ae6b412719321a4e9a878259b8e6", "bytes": 2688, "tokens": 878, "text": ":lang: en\n:toc:\n\n[[cha:pmx485]]\n= Powermax Modbus Driver\n\n// Custom lang highlight\n// must come after the doc title, to work around a bug in asciidoc 8.6.6\n:ini: {basebackend@docbook:'':ini}\n:hal: {basebackend@docbook:'':hal}\n:ngc: {basebackend@docbook:'':ngc}\n\nThis is a non-realtime HAL program, written in python, to control Hypetherm Powermax plasma cutters using the Modbus ASCII protocol over RS485.\n\nNOTE: Since this is a non-realtime program it can be affected by computer loading and latency. It is possible to lose communications which will be indicated by a change in the status output. One should always have an Estop circuit that kills the power to the unit in case of emergency.\n\nThis component is loaded using the halcmd \"loadusr\" command:\n\n[source,{hal}]\n----\nloadusr -Wn pmx485 pmx485 /dev/ttyUSB0\n----\n\nThis will load the pmx485 component using the /dev/ttyUSB0 port and wait\nfor it to become ready.\n\nIt is necessary to name the port to use for communications.\n\n== Pins\n\n* *pmx485.mode-set* (bit, in) # set cutting mode\n* *pmx485.current-set* (bit, in) # set cutting current\n* *pmx485.pressure-set* (bit, in) # set gas pressure\n* *pmx485.enable* (bit, in) # enable the component\n* *pmx485.mode* (bit, out) # cut mode feedback\n* *pmx485.current* (bit, out) # cutting current feedback\n* *pmx485.pressure* (bit, out) # gas pressure feedback\n* *pmx485.fault* (bit, out) # powermax fault code\n* *pmx485.status* (bit, out) # connection status\n* *pmx485.current-min* (bit, out) # minimum allowed current\n* *pmx485.current-max* (bit, out) # maximum allowed current\n* *pmx485.pressure-min* (bit, out) # minimum allowed gas pressure\n* *pmx485.pressure-max* (bit, out) # maximum allowed gas pressure\n\n== Description\n\nTo communicate with a Powermax, the component must first be enabled via\nthe *enable* pin and it may then initiate a request to the Powermax by\nwriting a valid string to the following pins:\n\n* *mode-set*\n* *current-set*\n* *pressure-set*\n\nNOTE: A *pressure-set* value of zero is valid, the Powermax will then\ncalculate the required pressure internally.\n\nCommunications may be validated from the Powermax display or the *status*\npin. While in remote mode, the mode, current and pressure may be changed\nas needed.\n\nTo terminate the communications, do one of the following:\n\n* Set all set pins to zero: *mode-set*, *current-set*, and\n *pressure-set*.\n* Disconnect the Powermax power supply from its power source for\n approximately 30 seconds. When you power the system back ON, it will\n no longer be in remote mode.\n\n== Reference:\n\n* Hypertherm Application Note #807220 +\n \"Powermax45 XP/65/85/105/125® Serial Communication Protocol\"\n\n// vim: set syntax=asciidoc:\n"} {"id": "linuxcnc-docs:docs/src/gui/qtvcp-vcp-panels.adoc", "source": "linuxcnc-docs", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "docs/src/gui/qtvcp-vcp-panels.adoc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/docs/src/gui/qtvcp-vcp-panels.adoc", "license": "GFDL-1.1-or-later", "encoding": "utf-8", "sha256": "878695df318a50e1b4dff9e4e8c452b4671e74b8fb891175f6e1ff4cc2375879", "bytes": 17840, "tokens": 6174, "text": ":lang: en\n:toc:\n\n[[cha:qtvcp:panels]]\n= QtVCP Virtual Control Panels\n\n// Custom lang highlight\n// must come after the doc title, to work around a bug in asciidoc 8.6.6\n:ini: {basebackend@docbook:'':ini}\n:hal: {basebackend@docbook:'':hal}\n:ngc: {basebackend@docbook:'':ngc}\n\nQtVCP can be used to *create control panels* that interface with _HAL_.\n\n[[sec:qtvcp:panels:builtin]]\n== Builtin Virtual Control Panels\n\nThere are several *builtin HAL panels* available.\n\nIn a terminal type `qtvcp list` to see a list.\n\n//TODO Add list output\n\n[[sub:qtvcp:panels:copy]]\n=== `copy`\n\nUsed for *copying QtVCP's builtin Screens/VCP Panels/QtVismach code to a folder* so one can _customize_ it.\n\nIn a terminal run:\n\n[source,{hal}]\n----\nqtvcp copy\n----\n\n.QtVCP `copy` Dialog - Screen, VCP Panel or QtVismach Code Copy Panel\nimage::images/qtvcp_copy_dialog.png[\"QtVCP copy Dialog - Screen, Panel or Vismach Code Copy Panel\",align=\"center\"]\n\n[[sub:qtvcp:panels:spindle-belts]]\n=== spindle_belts\n\nThis panel is designed to display additional RS485 VFD data and also to configure a 4 sheave, 2 belt spindle drive via a series of buttons.\n\nimage::images/qtvcp_spindle_belts.png[\"QtVCP spindle_belts Panel - Spindle Belts VCP\",align=\"center\"]\n\nIn addition, it is also a useful template to use for your custom panel because it includes:\n\n* Display of additional HAL data\n* Buttons and button groups\n* Dynamic changes to button enabled/disabled state based on the state of other buttons\n* Saving data to the qtdragon.prefs file\n* Custom button to reset the VFD\n\nModify this panel to suit your own requirements. Most common features are used.\nThe advantage of using panels is that it separates your custom display code from the qtdragon core code so upgrading the system will not break your customization.\n\n==== Additional Requirements\n\n* A spindle drive (for instance VFDMOD)\n* A custom component that scales the VFD frequency to obtain the desired spindle speed.\n* A belt driven spindle that uses two belts and an intermediate idler pulley much like a drill press.\n* Connect the input pins qtdragon.belts. in your postgui HAL file.\n\n==== Function\nThe belts are broken into two button groups, the front belts and the rear belts.\nThese are numbered as per the plate on the machine.\nButtons in a group are mutually exclusive, i.e., only one can be selected in the group.\n\nAdditionally, it's not possible to have both belts on the same level with this kind of mechanism because you cannot fit two belts to the one idler pulley sheave.\nSo if a belt is selected, its opposite button is disabled.\nE.g., if belt 3 is selected, belt 7 is disabled.\n\n==== Embedding commands\nAdd these lines to the [DISPLAY] section in your .ini file +\nThe example tab_location is for the QtDragon screen.\n----\nEMBED_TAB_NAME=Spindle Extras\nEMBED_TAB_COMMAND=qtvcp spindle_belts\nEMBED_TAB_LOCATION=tabWidget_utilities\n----\n\nHere is how to load `spindle_belt` from a HAL script:\n\n[source,{hal}]\n----\nloadusr qtvcp spindle_belts\n----\n\n==== Customization Hints\n\nCustomizing the panel: +\n\n* Copy the files located in /user/share/qtvcp/qtdragon/panels/belts to:\n~/linuxcnc/configs//qtvcp/panels/belts (you can use the copy dialog panel to do this)\n\n* Edit belts.ui with designer.\n* Edit belts_handler.py with a text editor\n* Connect the relevant pins in a postgui.hal file\n* Make sure your postgui file is loaded by your .ini file.\n\nFor information on the finer points, consult the QtVCP and QtDragon documentation.\nThe Python handler file also provides a useful template for any custom panel.\n\n[[sub:qtvcp:panels:test-dial]]\n=== `test_dial`\n\n- This panel has a *dial that adjusts S32 and Float HAL output pins*.\n- The dial's range can be adjusted from a drop down menu.\n- The output can be scaled with the `spinbox`.\n- A `combobox` can be used to automatically select and connect to a signal.\n\n[source,{hal}]\n----\nloadusr qtvcp test_dial\n----\n\n.QtVCP `test_dial` Panel - Test Dial VCP\nimage::images/qtvcp_test_dial.png[\"QtVCP test_dial Panel - Test Dial VCP\",align=\"center\"]\n\n=== test_button\n\n- This panel has a *button that will set a HAL pin*.\n- The button can be selected as a _momentary_ or a _toggle_ button.\n- The button's _indicator color_ can be adjusted from a drop down menu.\n- You can add more buttons from the drop down menu.\n- You can load a Halmeter from the drop down menu.\n- You can load a test LED from the drop down menu.\n- The button can be detached from the main windows.\n\nHere is how to load `test_button` from a HAL script:\n\n[source,{hal}]\n----\nloadusr qtvcp test_button\nloadusr qtvcp -o 4 test_button\n----\n\nThe `-o` switch sets how many buttons the panel starts with. +\nIf loading directly from a terminal omit the `loadusr`.\n\n.QtVCP `test_button` - Test Button VCP\nimage::images/qtvcp_test_button.png[\"QtVCP test_button - Test Button VCP\",align=\"center\"]\n\n[[sub:qtvcp:panels:test-led]]\n=== `test_led`\n\n- This panel has an *LED that can selected to watch HAL bit pins/signals*.\n- The LED's color can be adjusted from a drop down menu.\n- The text box and state can be output as speech if sound is selected.\n- A `combobox` can be used to automatically select and connect to a pin/signal.\n- You can add more LEDs from the drop down menu.\n- The LED can be detached from the main windows.\n\nHere is how to load `test_led` from a HAL script:\n\n[source,{hal}]\n----\nloadusr qtvcp test_led\nloadusr qtvcp -o 4 test_led\n----\n\nThe `-o` switch sets how many LEDs the panel starts with. +\nIf loading directly from a terminal omit the 'loadusr'.\n\n.QtVCP `test_dial` Panel - Test LED VCP\nimage::images/qtvcp_test_led.png[\"QtVCP test_dial Panel - Test LED VCP\",align=\"center\"]\n\n[[sub:qtvcp:panels:test-panel]]\n=== `test_panel`\n\n*Collection of useful widgets for testing HAL component*, including\nspeech of LED state.\n\n[source,{hal}]\n----\nloadusr qtvcp test_panel\n----\n\n.QtVCP `test_panel` - HAL Component Testing Panel\nimage::images/test_panel.png[\"QtVCP test_panel - HAL Component Testing Panel\",align=\"center\"]\n\n[[sub:qtvcp:panels:cam-align]]\n=== `cam_align`\n\nA *camera display widget for rotational alignment*.\n\n.QtVCP `cam_align` Panel - Camera Based Alignment Panel\nimage::images/qtvcp-cam-align.png[\"QtVCP cam_align Panel - Camera Based Alignment Panel\",align=\"center\"]\n\n.Usage\nAdd these lines to the INI file:\n[source,{ini}]\n----\n[DISPLAY]\nEMBED_TAB_NAME = cam_align\nEMBED_TAB_COMMAND = halcmd loadusr -Wn qtvcp_embed qtvcp -d -c qtvcp_embed -x {XID} cam_align\n# The following line is needed if embedding in GMOCCAPY\nEMBED_TAB_LOCATION = ntb_preview\n----\n\nYou can add window width and height size, rotation increment, and camera number from the INI with -o options.\n----\nEMBED_TAB_COMMAND = halcmd loadusr -Wn qtvcp_embed qtvcp -d -c qtvcp_embed -x {XID} -o size=400,400 -o rotincr=.2 -o camnumber=0 cam_align\n----\n\nMouse controls:\n\n* left mouse single click - increase cross hair rotation one increment\n* right mouse single click - decrease cross hair rotation one increment\n* middle mouse single click - cycle through rotation increments\n* left mouse hold and scroll - scroll camera zoom\n* right mouse hold and scroll - scroll cross hair rotation angle\n* mouse scroll only - scroll circle diameter\n* left mouse double click - reset zoom\n* right mouse double click - reset rotation\n* middle mouse double click - reset circle diameter\n\nTo use the top buttons you have to assign a command (or a sub-routine). This could look like this:\n[source,{ini}]\n----\n[MDI_COMMAND_LIST]\nMDI_COMMAND=G10 L20 P1 X0 Y0,Set XY\\nOrigin\nMDI_COMMAND=G0 X0 Y0,Go To\\nOrigin\n----\nWhere the first command is referring to the button \"SET origin\" and the second to the button \"GOTO Origin\". +\nNote the comma and text after is optional - it will override the default button text. +\nThese buttons are QtVCP action buttons and follow those rules.\n\n[[sub:qtvcp:panels:sim-panel]]\n=== `sim_panel`\n\nSmall control panel to *simulate MPG jogging controls etc* for simulated configurations. +\nThe MPG, selection buttons and control buttons export HAL pins to connect to linuxcnc. +\nThe selection and control group boxes can be hidden if not needed by using the '-o hide=' option. +\n'groupBoxControl' and 'groupBoxSelection' are the widget names that can be hidden. +\nIf you want to hide both, use a comma between them with no spaces. +\nThe '-a' option will make the panel always-on-top of all windows.\n\n[source,{hal}]\n----\nloadusr qtvcp sim_panel\n----\n\nHere we load the panel with no MPG selection buttons and the always-on-top option.\n\n[source,{hal}]\n----\nloadusr qtvcp -a -o hide=groupBoxSelection sim_panel\n----\n\n.QtVCP `sim_panel` - Simulated Controls Panel For Screen Testing.\nimage::images/qtvcp_sim_panel.png[\"QtVCP sim_panel - Simulated Controls Panel For Screen Testing\",align=\"center\"]\n\n[[sub:qtvcp:panels:tool-dialog]]\n=== `tool_dialog`\n\n*Manual tool change dialog* that gives tool description.\n\n[source,{hal}]\n----\nloadusr -Wn tool_dialog qtvcp -o speak_on -o audio_on tool_dialog\n----\n\nOptions:\n\n* `-o notify_on` - _use desktop notify_ dialogs instead of QtVCP native\n ones.\n* `-o audio_on` - _play sound on tool change_\n* `-o speak_on` - _speak announcement of tool change_\n\n.QtVCP `tool_dialog` - Manual Tool Change Dialog\nimage::images/qtvcp_toolChange.png[\"QtVCP tool_dialog - Manual Tool Change Dialog\",align=\"center\"]\n\n\n[[sub:qtvcp:panels:vismach]]\n== `vismach` 3D Simulation Panels\nThese panels are prebuilt simulation of common machine types.\n\nThese are also embed-able in other screens such as AXIS or GMOCCAPY.\n\n=== QtVCP `vismach_mill_xyz`\n\n3D OpenGL view of a _3-Axis milling machine_.\n\n[source,{hal}]\n----\nloadusr qtvcp vismach_mill_xyz\n----\n\n.QtVCP `vismach_mill_xyz` - 3-Axis Mill 3D View Panel\nimage::images/qtvismach.png[\"QtVCP vismach_mill_xyz - 3-Axis Mill 3D View Panel\",align=\"center\"]\n\n=== QtVCP `vismach_router_atc`\n\n3D OpenGL view of a _3-Axis router style, gantry bed milling machine_. +\nThis particular panel shows how to define and connect the model parts in the handler file,\nrather then importing the pre-built model from QtVCP's vismach library.\n\n[source,{hal}]\n----\nloadusr qtvcp vismach_router_atc\n----\n\n.QtVCP `vismach_router_atc` - 3-Axis Gantry Bed Mill 3D View Panel\nimage::images/qtvismach_router_atc.png[\"QtVCP vismach_router_atc - 3-Axis Gantry Bed Mill 3D View Panel\",align=\"center\"]\n\n=== QtVCP `vismach_scara`\n\n3D OpenGL view of a _SCARA based milling machine_.\n\n[source,{hal}]\n----\nloadusr qtvcp vismach_scara\n----\n\n.QtVCP `vismach_scara` - SCARA Mill 3D View Panel\nimage::images/qtvismach_scara.png[\"QtVCP vismach_scara - SCARA Mill 3D View Panel\",align=\"center\"]\n\n=== QtVCP `vismach_millturn`\n\n3D OpenGL view of a _3-Axis milling machine with an A axis/spindle_.\n\n[source,{hal}]\n----\nloadusr qtvcp vismach_millturn\n----\n\n.QtVCP `vismach_millturn` - 4 Axis MillTurn 3D View Panel\nimage::images/qtvismach_millturn.png[\"QtVCP vismach_millturn - 4 Axis MillTurn 3D View Panel\",align=\"center\"]\n\n=== QtVCP `vismach_mill_5axis_gantry`\n\n3D OpenGL view of a _5-Axis gantry type milling machine_.\n\n[source,{hal}]\n----\nloadusr qtvcp vismach_mill_5axis_gantry\n----\n\n.QtVCP `vismach_mill_5axis_gantry` - 5-AxIs Gantry Mill 3D View Panel\nimage::images/qtvismach_5axis_gantry.png[\"QtVCP vismach_mill_5axis_gantry - 5-Axis Gantry Mill 3D View Panel\",align=\"center\"]\n\n=== QtVCP `vismach_fanuc_200f`\n\n3D openGL view of a _6 joint robotic arm_.\n\n[source,{hal}]\n----\nloadusr qtvcp vismach_fanuc_200f\n----\n\n.QtVCP `vismach_fanuc_200f` - 6 Joint Robotic Arm\nimage::images/qtvismach_fanuc_200f.png[\"QtVCP vismach_fanuc_200f - 6 Joint Robotic Arm\",align=\"left\"]\n\n\n[[sec:qtvcp:panels:custom]]\n== Custom Virtual Control Panels\n\nYou can of course *make your own panel and load it*.\n\nIf you made a UI file named `my_panel.ui` and a HAL file named `my_panel.hal`,\nyou would then load this from a terminal with:\n\n----\nhalrun -I -f my_panel.hal\n----\n\n.Example HAL file loading a QtVCP panel\n[source,{hal}]\n----\n# load realtime components\nloadrt threads\nloadrt classicladder_rt\n\n# load non-realtime programs\nloadusr classicladder\nloadusr -Wn my_panel qtvcp my_panel.ui # <1>\n\n# add components to thread\naddf classicladder.0.refresh thread1\n\n\n# connect pins\nnet bit-input1 test_panel.checkbox_1 classicladder.0.in-00\nnet bit-hide test_panel.checkbox_4 classicladder.0.hide_gui\n\nnet bit-output1 test_panel.led_1 classicladder.0.out-00\n\nnet s32-in1 test_panel.doublescale_1-s classicladder.0.s32in-00\n\n# start thread\nstart\n----\n\n<1> In this case we load `qtvcp` using *`-Wn`* which waits for the panel to finish loading before continuing to run the next HAL command. +\n This is to _ensure that the panel created HAL pins are actually done_ in case they are used in the rest of the file.\n\n== Embedding QtVCP Virtual Control Panels into QtVCP Screens\nQtVCP panels can be embedded into most QtVCP screens and avoids problems such as focus transferring that can be a problem in non-native embedding.\n\n=== Embedding Commands\nA typical screen such as QtDragon will search the INI file under the heading [DISPLAY] for commands to embed a panel.\n\n[source,{ini}]\n----\n[DISPLAY]\nEMBED_TAB_NAME=Embedding demo\nEMBED_TAB_COMMAND=qtvcp simple_hal\nEMBED_TAB_LOCATION=tabWidget_utilities\n----\n\n*'EMBED_TAB_NAME'*:: will typically be the title of the tab.\n*'EMBED_TAB_LOCATION'*:: will be specific to the screen and specifies the tabWidget or stackedWidget to embed into.\n*'EMBED_TAB_COMMAND'*:: is the command used to invoke loading of the panel. For native embedded panels the first word will always be 'qtvcp', the last will be the panel name to load. You can also pass options to the panel with -o switches in the command line between 'qtvcp' and the panel name. The panel will follow the debugging mode setting of the main screen.\n\n=== Location of builtin Panels\nThere are panels available that are included with LinuxCNC. To see a list open a terminal and type 'qtvcp' and press return. +\nYou will get a help printout and a list of builtin screen and panels. +\nPick any of the names from the panel list and add that to the COMMAND entry after 'qtvcp'. +\nThe builtin panel search path is 'share/qtvcp/panels/PANELNAME'. +\nRun-In-Place and installed versions of LinuxCNC have these in different locations on the system.\n\n=== Location of Custom Panels\nCustom panels can be embedded too -either a modified builtin panel or a new user-built one. +\nWhen loading panels, QtVCP looks in the configuration folders path for 'qtvcp/panels/PANELNAME/PANELNAME.ui'. +\n'PANNELNAME' being any valid string with no spaces. If no path is found there, then looks in the builtin file path. +\nQtVCP will do the same process for the optional handler file: 'qtvcp/panels/PANELNAME/PANELNAME_handler.py'\n\n=== Handler Programming Tips\nIn a screen handler file, the reference used for the window is 'self.w'. +\nIn QtVCP panels, that reference will refers to the panel's window. +\nTo reference the main window use 'self.w.MAIN'\nIf your panel is to be able to run independently and embedded, you must trap errors from referencing objects not available.\n(Note, main screen objects are not available in an independent panel.)\n\nE.g., this would use the panel's preference file if there is one.\n[source,{hal}]\n----\ntry:\n belt_en = self.w.PREFS_.getpref('Front_Belt_enabled', 1, int, 'SPINDLE_EXTRAS')\nexcept:\n belt_en = 1\n----\n\nThis would use the main screen preference file if there is one.\n[source,{hal}]\n----\ntry:\n belt_en = self.w.MAIN.PREFS_.getpref('Front_Belt_enabled', 1, int, 'SPINDLE_EXTRAS')\nexcept:\n belt_en = 1\n----\n\n=== Designer Widget Tips\n\nWhen using Python command option in Action Button widgets of an embedded panel:\n\n*`INSTANCE`*::\n refers to the panel window.\n E.g., `INSTANCE.my_panel_handler_function_call(True)`\n\n*'MAIN_INSTANCE'*::\n refers to the main screen window.\n E.g., `MAIN_INSTANCE.my_main_screen_handler_function_call(True)`\n\nIf the panel is not embedded, both refer to the panel window.\n\n=== Handler Patching - Subclassing Builtin Panels\n\nWe can have QtVCP load a subclassed version of the standard handler file. in that file we can manipulate the original functions or add new ones. +\nSubclassing just means our handler file first loads the original handler file and adds our new code on top of it - so a patch of changes. +\nThis is useful for changing/adding behaviour while still retaining standard handler updates from LinuxCNC repositories. +\n\nYou may still need to use the handler copy dialog to copy the original handler file to decide how to patch it.\n\nThere should be a folder in the config folder; for panel: named '/qtvcp/panels//' +\nadd the handle patch file there, named like so _handler.py +\nie for cam_align the file would be called 'cam_align_handler.py' +\n\nHere is a sample to change the circle color in cam_align: +\n\n[source,python]\n----\nimport sys\nimport os\nimport importlib\nfrom PyQt5.QtCore import Qt\nfrom qtvcp.core import Path\n\nPATH = Path()\n\n# get reference to original handler file so we can subclass it\nsys.path.insert(0, PATH.PANELDIR)\npanel = os.path.splitext(os.path.basename(os.path.basename(__file__)))[0]\nbase = panel.replace('_handler','')\nmodule = \"{}.{}\".format(base,panel)\nmod = importlib.import_module(module, PATH.PANELDIR)\nsys.path.remove(PATH.PANELDIR)\nHandlerClass = mod.HandlerClass\n\n# return our subclassed handler object to Qtvcp\ndef get_handlers(halcomp, widgets, paths):\n return [UserHandlerClass(halcomp, widgets, paths)]\n\n# subclassed from HandlerClass which was imported above\nclass UserHandlerClass(HandlerClass):\n print('Custom subclassed panel handler loaded\\n')\n\n def initialized__(self):\n # call original handler initialized function\n super().initialized__()\n\n # add our customization\n self.w.camview.circle_color = Qt.green\n\n----\n// vim: set syntax=asciidoc:\n"} {"id": "linuxcnc-docs:docs/src/install/latency-test.adoc", "source": "linuxcnc-docs", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "docs/src/install/latency-test.adoc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/docs/src/install/latency-test.adoc", "license": "GFDL-1.1-or-later", "encoding": "utf-8", "sha256": "623ada95ef76875e000fa595231991c7a432da128aa6829efc2c06ae8b4150d0", "bytes": 9057, "tokens": 2657, "text": ":lang: en\n:toc:\n\n[[cha:latency-testing]]\n= Latency Testing(((Latency Testing)))\n\n\n[[sec:what-is-latency]]\n== What is latency?\n\nLatency is how long it takes the PC to stop what it is doing and respond\nto an external request, such as running one of LinuxCNC's periodic realtime threads.\nThe lower the latency, the faster you can run the realtime threads,\nand the smoother motion will be (and potentially faster, in the case of software stepping).\n\nLatency is far more important than CPU speed.\nA lowly Pentium II that responds to interrupts within 10 microseconds\neach and every time can give better results\nthan the latest and fastest P4 Hyperthreading beast.\n\nThe CPU isn't the only factor in determining latency.\nMotherboards, video cards, USB ports, and a number of other things can hurt the latency.\nThe best way to find out what you are dealing with is to run the latency test.\n\nGenerating step pulses in software has one very big advantage - it's free.\nJust about every PC has a parallel port that is\ncapable of outputting step pulses that are generated by the software.\nHowever, software step pulses also have some disadvantages:\n\n- limited maximum step rate\n- jitter in the generated pulses\n- loads the CPU\n\n\n[[sec:latency-tests]]\n== Latency Tests(((Latency Tests)))\n\nLinuxCNC includes several latency tests. They all produce equivalent information.\nRunning these tests will help determine if a computers is suitable for driving a CNC machine.\n\n[NOTE]\nDo not run LinuxCNC or StepConf while the latency test is running.\n\n\n[[sec:latency-test]]\n=== Latency Test(((Latency Test)))\n\nTo run the test, open a terminal window\n(in Ubuntu, from Applications → Accessories → Terminal)\nand run the following command:\n\n----\nlatency-test\n----\n\nThis will start the latency test with a base-thread period of 25uS and a\nservo-thread period of 1mS. The period times may be specified on the command\nline:\n\n----\nlatency-test 50000 1000000\n----\n\nThis will start the latency test with a base-thread period of 50uS and a\nservo-thread period of 1mS.\n\nFor available options, on the command line enter:\n\n----\nlatency-test -h\n----\n\nAfter starting a latency test you should see something like this:\n\n.HAL Latency Test\nimage::../config/images/latency-test_en.png[\"HAL Latency Test\",align=\"center\"]\n\nWhile the test is running, you should 'abuse' the computer.\nMove windows around on the screen. Surf the web. Copy some large files\naround on the disk. Play some music.\nRun an OpenGL program such as glxgears.\nThe idea is to put the PC through its paces while\nthe latency test checks to see what the worst case numbers are.\n\nThe important number for software stepping is the 'max jitter' of the base thread.\nIn the example above, that is 6693 nanoseconds (ns), or 6.693 microseconds (µs).\nRecord this number, and enter it in StepConf when it is requested.\n\nIn the example above, latency-test only ran for a few seconds.\nYou should run the test for at least several minutes; sometimes\nthe worst case latency doesn't happen very often, or only happens\nwhen you do some particular action. For instance, one Intel\nmotherboard worked pretty well most of the time, but every 64\nseconds it had a very bad 300 us latency. Fortunately that was\nfixable, see https://wiki.linuxcnc.org/cgi-bin/wiki.pl?FixingSMIIssues\n\nSo, what do the results mean? If your Max Jitter number is less\nthan about 15-20 microseconds (15000-20000 nanoseconds), the\ncomputer should give very nice results with software stepping. If\nthe max latency is more like 30-50 microseconds, you can still\nget good results, but your maximum step rate might be a little\ndisappointing, especially if you use microstepping or have very\nfine pitch leadscrews. If the numbers are 100 us or more (100,000\nnanoseconds), then the PC is not a good candidate for software\nstepping. Numbers over 1 millisecond (1,000,000 nanoseconds) mean\nthe PC is not a good candidate for LinuxCNC, regardless of whether you\nuse software stepping or not.\n\n[NOTE]\nIf you get high numbers, there may be ways to improve them.\nAnother PC had very bad latency (several milliseconds) when\nusing the onboard video. But a $5 used video card solved the problem.\nLinuxCNC does not require bleeding edge hardware.\n\nFor more information on stepper tuning see the\n<> Chapter.\n\n*Additional command line tools are available for examining latency\nwhen LinuxCNC is not running.*\n\n=== Latency Plot\n\nlatency-plot makes a strip chart recording for a base and a servo thread.\nIt may be useful to see spikes in latency when other\napplications are started or used. Usage:\n\n----\nlatency-plot --help\n\nUsage:\n latency-plot --help | -?\n latency-plot --hal [Options]\n\nOptions:\n --base nS (base thread interval, default: 25000)\n --servo nS (servo thread interval, default: 1000000)\n --time mS (report interval, default: 1000)\n --relative (relative clock time (default))\n --actual (actual clock time)\n----\n\n.`latency-plot` Window\nimage::../config/images/latency-plot.png[\"latency-plot Window\"]\n\n\n=== Latency Histogram\n\nlatency-histogram displays a histogram of latency (jitter) for\na base and servo thread.\n\n----\nUsage:\n latency-histogram --help | -?\n latency-histogram [Options]\n\nOptions:\n --base nS (base thread interval, default: 25000, min: 5000)\n --servo nS (servo thread interval, default: 1000000, min: 25000)\n --bbinsize nS (base bin size, default: 100\n --sbinsize nS (servo bin size, default: 100\n --bbins n (base bins, default: 200\n --sbins n (servo bins, default: 200\n --logscale 0|1 (y axis log scale, default: 1)\n --text note (additional note, default: \"\" )\n --show (show count of undisplayed bins)\n --nobase (servo thread only)\n --verbose (progress and debug)\n --nox (no gui, display elapsed,min,max,sdev for each thread)\n\nNotes:\n Linuxcnc and Hal should not be running, stop with halrun -U.\n Large number of bins and/or small binsizes will slow updates.\n For single thread, specify --nobase (and options for servo thread).\n Measured latencies outside of the +/- bin range are reported\n with special end bars. Use --show to show count for\n the off-chart [pos|neg] bin\n----\n\n.`latency-histogram` Window\nimage::../config/images/latency-histogram.png[\"latency-histogram Window\"]\n\n\n== Latency tuning\n\nLinuxCNC can run on many different hardware platforms and with many\ndifferent realtime kernels, and they all may benefit from tuning for\noptimal latency.\n\nA primary goal in tuning the system for LinuxCNC is to reserve a CPU for the exclusive use of LinuxCNC's realtime tasks, so that other tasks (both user programs and kernel threads) do not interfere with LinuxCNC's access to that CPU.\n\nWhen specific tuning options are believed to be universally helpful\nLinuxCNC does this tuning automatically at startup, but many tuning\noptions are machine-specific and cannot be done automatically. The person\ninstalling LinuxCNC will need to experimentally determine the optimal\ntuning for their system.\n\n\n=== Tuning the BIOS for latency\n\nPC BIOSes vary wildly in their latency behavior.\n\nTuning the BIOS is tedious because you have to reboot the computer,\nmake one small tweak in the BIOS, boot Linux, and run the latency test\n(potentially for a long time) to see what effects your BIOS change had.\nThen repeat for all the other BIOS settings you want to try.\n\nBecause BIOSes are all different and non-standard, providing a detailed\nBIOS tuning guide is not practical. In general, some things to try\ntuning in the BIOS are:\n\n* Disable ACPI, APM, and any other power-saving features. This includes\n anything related to power saving, suspending, CPU sleep states, CPU\n frequency scaling, etc.\n\n* Disable CPU \"turbo\" mode.\n\n* Disable CPU hyperthreading.\n\n* Disable (or otherwise control) System Management Interrupt (SMI).\n\n* Disable any hardware you do not intend to use.\n\n\n=== Tuning Preempt-RT for latency\n\nThe Preempt-RT kernel may benefit from tuning in order to provide the\nbest latency for LinuxCNC. Tuning may be done via the kernel command\nline, sysctl, and via files in `/proc` and `/sys`.\n\nSome tuning parameters to look into:\n\nKernel command line::\n\n Details here: \n\n * `isolcpus`: Prevent most non-LinuxCNC processes from using these\n CPUs, leaving more CPU time available for LinuxCNC.\n\n * `irqaffinity`: Select which CPUs service interrupts, so that the\n CPUs reserved for LinuxCNC realtime don't have to perform this task.\n\n * `rcu_nocbs`: Prevent RCU callbacks from running on these CPUs.\n\n * `rcu_nocb_poll`: Poll for RCU callbacks instead of using sleep/wake.\n\n * `nohz_full`: Disable clock tick on these CPUs.\n\nSysctl::\n\n Details here: \n\n * `sysctl.kernel.sched_rt_runtime_us`: Set to -1 to remove the limit\n on how much time realtime tasks may use.\n\n\n// vim: set syntax=asciidoc:\n"} {"id": "linuxcnc-source:configs/apps/gladevcp/by-widget/radiobutton.txt", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/apps/gladevcp/by-widget/radiobutton.txt", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/apps/gladevcp/by-widget/radiobutton.txt", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "7fb948fc3af710b2fa696ee12b049b4a46a0f3a2a987f6608795c895adf31532", "bytes": 229, "tokens": 77, "text": "gladevcp radiobutton example\nlifted from http://old.nabble.com/glade-and-radio-buttons.-td28793060.html\n\n------------------------------------------\nTo run independently:\n\n$ gladevcp -u radio.py radio.ui\n\nMichael Haberler 12/2010\n"} {"id": "linuxcnc-source:configs/apps/gladevcp/colored-label/coloredlabel.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/apps/gladevcp/colored-label/coloredlabel.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/apps/gladevcp/colored-label/coloredlabel.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "9ac0c206593638f38f28a5b93f1b579aadd89f1dfc37589bf4905037968801ee", "bytes": 3159, "tokens": 959, "text": "#!/usr/bin/env python3\n# vim: sts=4 sw=4 et\n# This is a component of LinuxCNC\n# complex.py Copyright 2011 Michael Haberler\n#\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.''''''\n'''\n gladevcp colored label example\n Michael Haberler 2/2011\n'''\nimport sys\nimport hal\n\nimport gi\ngi.require_version('Gtk', '3.0')\nfrom gi.repository import Gtk\nfrom gi.repository import Gdk\n\nglobal red,green,white\n\nred = Gdk.color_parse(\"red\")\ngreen = Gdk.color_parse(\"green\")\nyellow = Gdk.color_parse(\"yellow\")\n\n# data for a table-driven HAL Label\ntable = { 0: (\"No Fault\", green),\n 1: (\"Over Current\", red),\n 2: (\"Over Voltage\", red),\n 3: (\"Overheat\", red),\n 4: (\"Overload\", red),\n }\n# defaults for value not in table\ndefault_text = \"unknown value: \"\ndefault_color = yellow\n \nclass HandlerClass:\n \n def colorize(self, w, state, color):\n ''' helper method: try to do the right thing when setting the color of a widget.\n The GtkLabel, and hence HAL_Label widget doesn't take a color, so\n it needs an enclosing Eventbox which can be colorized.'''\n if isinstance(w,Gtk.Label):\n parent = w.get_parent()\n if not isinstance(parent,Gtk.EventBox):\n print(\"warning: the %s Label widget is not enclosed in an EventBox\" % w.get_name(), file=sys.stderr)\n parent.modify_bg(state, color)\n else:\n # non-label widgets can be directly colorized\n w.modify_bg(state, color) # colorize anyway\n\n def on_label_hal_pin_change(self, hal_widget, data=None):\n '''\n this is an example of a hal-pin-changed signal handler as set in glade.\n The purpose of this callback is to deliver an optional notification to your code beyond\n just reacting to the changed HAL pin.\n\n See hal_button1's 'Signals' section in glade to see how it is connected to this handler\n '''\n \n value = hal_widget.hal_pin.get()\n if value not in table:\n text = default_text + str(value)\n color = default_color\n else:\n (text,color) = table[value]\n hal_widget.set_label(text)\n self.colorize(hal_widget, Gtk.StateFlags.NORMAL, color)\n\n def __init__(self, halcomp,builder,useropts):\n\n self.hal_button1 = builder.get_object('hal_button1')\n \n\ndef get_handlers(halcomp,builder,useropts):\n return [HandlerClass(halcomp,builder,useropts)]\n"} {"id": "linuxcnc-source:configs/apps/parport/parport_base.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/apps/parport/parport_base.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/apps/parport/parport_base.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "471df25bfa70f4c120870d8498110e177fc50de4ae70adc2dc9ea273057f38d3", "bytes": 1125, "tokens": 465, "text": "# adapted from work by J Thornton\n\nloadrt threads name1=porttest period1=1000000\naddf parport.0.read porttest\naddf parport.0.write porttest\n\nnet pin01 PortTest.btn01 parport.0.pin-01-out PortTest.led-01\nnet pin02 PortTest.btn02 parport.0.pin-02-out PortTest.led-02\nnet pin03 PortTest.btn03 parport.0.pin-03-out PortTest.led-03\nnet pin04 PortTest.btn04 parport.0.pin-04-out PortTest.led-04\nnet pin05 PortTest.btn05 parport.0.pin-05-out PortTest.led-05\nnet pin06 PortTest.btn06 parport.0.pin-06-out PortTest.led-06\nnet pin07 PortTest.btn07 parport.0.pin-07-out PortTest.led-07\nnet pin08 PortTest.btn08 parport.0.pin-08-out PortTest.led-08\nnet pin09 PortTest.btn09 parport.0.pin-09-out PortTest.led-09\nnet pin14 PortTest.btn14 parport.0.pin-14-out PortTest.led-14\nnet pin16 PortTest.btn16 parport.0.pin-16-out PortTest.led-16\nnet pin17 PortTest.btn17 parport.0.pin-17-out PortTest.led-17\n\n\nnet pin10 parport.0.pin-10-in PortTest.led-10\nnet pin11 parport.0.pin-11-in PortTest.led-11\nnet pin12 parport.0.pin-12-in PortTest.led-12\nnet pin13 parport.0.pin-13-in PortTest.led-13\nnet pin15 parport.0.pin-15-in PortTest.led-15\n\nstart\n"} {"id": "linuxcnc-source:configs/attic/dallur-thc/dallur-advanced.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/attic/dallur-thc/dallur-advanced.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/attic/dallur-thc/dallur-advanced.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "0483636519e10725fce8fd2275e3ef449414a1248ef9982717ca21cdacfa4290", "bytes": 11392, "tokens": 4293, "text": "# HAL config file for Rugludallur Plasma Cutting Table using classic ladder\n# Loads the dallur-advanced.hal file first to set up motion and stepgen\n# for a 3 axis stepper system where Axis A is slaved to Axis Y \n# This adds limits and home from limit to the motion module\n# Adds ESTOP button (with classicladder)\n# Creates Charge Pump Signals for 2 Parallel ports on pins 17\n# Includes unused intermittent lube pump and pressure or level sensing\n# Includes unused coolant \n# Spindle forward is used for \"Torch ON\" signal, reverse is not used\n\n# Load Driver for Two Parallel Ports, one for Breakout Board, other for Plasma Torch Height Control\nloadrt hal_parport cfg=\"0xa400 0xac00\"\n\n# Connect both Parallel Ports to Threads for Read / Write\naddf parport.0.read base-thread 1\naddf parport.0.write base-thread -1\naddf parport.1.read base-thread 1\naddf parport.1.write base-thread -1\n\n# This configuration uses classicladder for machine logic\n# (load the realtime portion)\n# these classicladder parameters need to be optimized after ladder completion\nloadrt classicladder_rt numRungs=10 numBits=20 numWords=4 numTimers=5 numMonostables=2 numPhysInputs=20 numPhysOutputs=10 numArithmExpr=4 numSections=4\n# We kick ladder into a thread at the slower servo rate rather than base rate\naddf classicladder.0.refresh servo-thread 1\n\n# invoke the user part of CL to silently load the program\n# later we will need to add the clp file mentioned below\n# to the ini file so that we do not need to hardcode it here.\nloadusr -w classicladder --nogui dallur-advanced.clp\n# load the GUI as well\nloadusr classicladder\n\n#Reverse Direction for A(Auxiliary) Axis so both motors drive in same direction\nsetp parport.0.pin-09-out-invert 1\n\n# begin to connect physical pins to signals\n# this is EMC's standard motion pinouts\n#Axis for Cart, single stepper motor marked Axis X in breakout\nnet Xstep parport.0.pin-02-out\nnet Xdir parport.0.pin-06-out\n#Axis for Gantry, primary stepper motor (same side as ctrl box), marked Axis Y in breakout\nnet Ystep parport.0.pin-03-out\nnet Ydir parport.0.pin-07-out\n#Axis for Gantry, secondary stepper motor (other side of ctrl box), marked Axis A(Auxiliary) in breakout\nnet Ystep parport.0.pin-05-out\nnet Ydir parport.0.pin-09-out\n#Axis for Height Control, single stepper motor marked Axis Z in breakout\nnet Zstep parport.0.pin-04-out\nnet Zdir parport.0.pin-08-out\n\n#Enable signals not used because of Charge Pump\n#linksp Yen parport.0.pin-06-out\n#linksp Yen parport.0.pin-09-out\n#linksp Xen parport.0.pin-03-out\n\n# Estop signals\n# This signal is the internal or gui estop command from EMC\nnet estop-out iocontrol.0.user-enable-out classicladder.0.in-00\n# This is a one-shot on timer when signal above goes high.\nnet estop-in iocontrol.0.user-request-enable classicladder.0.in-02\n# This bit is an external estop button connected to parport pin 10 \nnet ext-estop parport.0.pin-10-in\nnet ext-estop classicladder.0.in-01\n# This bit signal is command to estop from CL to EMC\nnet emc-enable-in iocontrol.0.emc-enable-in classicladder.0.out-00 \n\n\n# Spindle Signal, forward drives Torch ON\n# Spindle reverse is not used (might be used for a Running Start later)\nnet turn_torch_on parport.1.pin-01-out\n#net spindle-reverse spindle.0.reverse parport.0.pin-17-out \n\n#Create a limit switch signal for each axis\n\n#Read limit switches from normally open circuit on parport 0\nnet limit-reached-x parport.0.pin-11-in-not\nnet limit-reached-y parport.0.pin-12-in-not\nnet limit-reached-z parport.0.pin-13-in-not\nnet limit-reached-a parport.0.pin-15-in-not\n\n#Connect all limit signals to relevant axes\nnet limit-reached-x joint.0.neg-lim-sw-in\nnet limit-reached-x joint.0.pos-lim-sw-in\nnet limit-reached-y joint.1.neg-lim-sw-in\nnet limit-reached-y joint.1.pos-lim-sw-in\nnet limit-reached-a joint.1.neg-lim-sw-in\nnet limit-reached-a joint.1.neg-lim-sw-in\nnet limit-reached-z joint.2.neg-lim-sw-in\nnet limit-reached-z joint.2.neg-lim-sw-in\n\n\n########## Charge Pump #########\n\n# This is for Charge Pump which requires a 15khz signal to activate, maxfreq is the limiter \nloadrt freqgen step_type=0\nloadrt siggen\nloadrt threads name1=fastcp period1=30000 name2=slowcp period2=1000000\n\n\nnet velcp siggen.0.square\nnet velcp freqgen.0.velocity\nnet stepcp freqgen.0.step\n\naddf siggen.0.update slowcp\naddf freqgen.update-freq slowcp\naddf freqgen.make-pulses fastcp\nsetp freqgen.0.velocity-scale 1000000\nsetp freqgen.0.maxfreq 15000\n\nnet stepcp parport.0.pin-17-out\nnet stepcp parport.1.pin-17-out\n\n\n###########Torch Height Control ########\n\n# Load the necessary functions\nloadrt mux2 count=7\nloadrt or2 count=4\nloadrt not count=4\nloadrt sum2 count=2\nloadrt comp count=2\nloadrt and2 count=2\n\n# Make a sensor for the ARC OK signal with an active low\nnet senseArcOKInverted <= parport.1.pin-15-in\n\n# Invert ArcOK Signal to so TRUE = Arc ON (active high)\nnet senseArcOKInverted not.0.in\nnet senseArcOK not.0.out\n\n# Make a sensor for the Move Down bit from the THC, active low\nnet senseZDownInverted <= parport.1.pin-11-in\n\n# Invert SenseDown Signal to so TRUE = Sense Down (active high)\nnet senseZDownInverted not.1.in\nnet senseZDown not.1.out\n\n# Make a sensor for the Move Up bit from the THC, this signal is active low\nnet senseZUpInverted <= parport.1.pin-12-in\n\n# Invert senseZUp Signal to so TRUE = Sense Up (active high)\nnet senseZUpInverted not.2.in\nnet senseZUp not.2.out\n\n# Make a sensor for the Z Float Switch\n# Invert because THC has active low\n# The Z float switch is a proxmity sensor from torch to work piece\n# PNP or NPN Capacative or Inductive switches are recommended, Capacative for non metals but Inductive for metals\nnet senseZFloatSwitchInverted <= parport.1.pin-13-in\n\n# invert the senseZFloatSwitch so TRUE = At distance (active high)\nnet senseZFloatSwitchInverted not.3.in\nnet senseZFloatSwitch not.3.out\n\n# Create signals to move Axis Y up or down with destinations, Y should never reach destination because as soon\n# as the axis moves the input signal will change and disconnect the signal at the mux\n# In the future it would be good to pull estop if Z axis is ever >= ZMaxCord\nsets ZMinCord 0\nsets ZMaxCord 300\n\n# Create signals to join the moveUP from parport and the one from init\n\nnet senseZDown or2.0.in0\nnet moveZtoFloat or2.0.in1\nnet moveZDown or2.0.out\n\nnet senseZUp or2.1.in0\nnet moveZtoSafe or2.1.in1\nnet moveZUp or2.1.out\n\nnet moveZtoFloat or2.2.in0\nnet moveZtoSafe or2.2.in1\nnet moveZtoOK or2.2.out\n\nnet LockPierceHeight or2.3.in0\nnet moveZtoOK or2.3.in1\nnet moveZEnabled or2.3.out\n\naddf or2.0 servo-thread\naddf or2.1 servo-thread\naddf or2.2 servo-thread\naddf or2.3 servo-thread\naddf not.0 servo-thread\naddf not.1 servo-thread\naddf not.2 servo-thread\naddf not.3 servo-thread\n\n# Mux the zpos-cmd and UpDest based on the state of the senseZUp signal\n\nnet Zpos-cmd mux2.0.in0\nnet ZMinCord mux2.0.in1\nnet moveZUp mux2.0.sel\nnet ZMinCord-Zpos-cmd-muxed mux2.0.out\n\naddf mux2.0 servo-thread \n\n# Mux the zpos-cmd and ZMaxCord based on the state of the senseZDown signal\n\nnet Zpos-cmd mux2.1.in0\nnet ZMaxCord mux2.1.in1\nnet moveZDown mux2.1.sel\nnet ZMaxCord-Zpos-cmd-muxed mux2.1.out\n\naddf mux2.1 servo-thread \n\n# Mux ZMaxCord-Zpos-cmd-muxed and UpDest-Zpos-cmd-muxed\n\nnet ZMinCord-Zpos-cmd-muxed mux2.2.in0\nnet ZMaxCord-Zpos-cmd-muxed mux2.2.in1\nnet moveZDown mux2.2.sel\nnet Zpos-cmd-muxed mux2.2.out\n\naddf mux2.2 servo-thread\n\n#Disconnect Machine/Manual Axis Z Control while ArcOK for safety and to eliminate jitter\nnet Zpos-instructed-cmd <= joint.2.motor-pos-cmd\n\nnet Zpos-instructed-cmd => mux2.3.in0\nnet Zpos-fb => mux2.3.in1\nnet moveZEnabled => mux2.3.sel\nnet Zpos-cmd <= mux2.3.out\n\naddf mux2.3 servo-thread\n\n# Feedhold is used to halt gcode execution while torch is placed at correct initial height\n# feedhold, uses G50 adaptive feed input\nsets zero 0.0\nsets one 1.0\nnet adaptive-feed mux2.4.out\nnet adaptive-feed motion.adaptive-feed\nnet one mux2.4.in0\nnet zero mux2.4.in1\n\n# Not only do we want to set temp. to 0 we also want to pause state within GUI App, this way the user has to confirm before cutting starts\n# Pause state will be maintained even after feedrate has been reset to 1\n# This is can now be shut off/turned on from the VCP UI\nnet feed-hold mux2.4.sel\n\n# To remove the manual pause comment out the following line\n#linksp feed-hold halui.program.pause\n\n\nnet feed-hold and2.0.in0\nnet ManualVerifyBeforePierce and2.0.in1\nnet program.pause halui.program.pause and2.0.out\n\naddf mux2.4 servo-thread\n\n# Create the signals for classicladder to control parts of THC\nnet senseZFloatSwitch => classicladder.0.in-03\nnet moveZtoFloat classicladder.0.out-03\nnet moveZtoSafe classicladder.0.out-04\nnet senseArcOK classicladder.0.in-04\nnet spindle-forward classicladder.0.in-05 <= spindle.0.forward \nnet feed-hold classicladder.0.out-06\nnet turn_torch_on classicladder.0.out-05\nnet ui_mode_is_auto halui.mode.is-auto\nnet ui_mode_is_auto classicladder.0.in-06\n\n############## PierceGap & SwitchTravel ############\n\n\n# These parameters control the SwitchTravel and PierceGap, later we hope to have piercegap automatically set\n# from the tools table as there will be a tool for each amp setting with cutting/gauging consumables\nsets SwitchTravel 10\nsets PierceHeight 50\nsets ArcStartTimeout 5\nsets PierceDelay 0.2\nsets EnablePierceDelay 1\n\n# Add PierceGap to SwitchTravel, add this to the height at the moment LockPierceHeight is received\n# Make a new height signal which is PierceGap+SwitchTravel+LockPierceHeight\n# Tell the stepgen to move to the newly calculated position\n\nnet SwitchTravel sum2.0.in0\nnet PierceGap sum2.0.in1\nnet WorkStandOff sum2.0.out\n\nnet Zpos-fb => sum2.1.in0\nnet WorkStandOff => sum2.1.in1\n#FIXME add a proper name\nnet mux2-sum2 mux2.6.in0 <= sum2.1.out\n\nnet PierceHeight mux2.6.in1\nnet PierceHeight mux2.6.out\nnet LockPierceHeight mux2.6.sel\n\nnet Zpos-cmd-muxed mux2.5.in0\nnet PierceHeight mux2.5.in1\nnet MoveZtoPierceHeight mux2.5.sel\nnet Z-pos-cmd mux2.5.out stepgen.2.position-cmd\n\naddf mux2.5 servo-thread\naddf mux2.6 servo-thread\naddf sum2.0 servo-thread\naddf sum2.1 servo-thread\naddf comp.0 servo-thread\naddf comp.1 servo-thread\naddf and2.0 servo-thread\naddf and2.1 servo-thread\n\n# Also make sure we tell classicladder when we are at pierce height so it can turn on the torch\n\nnet PierceHeight comp.0.in0\nnet Zpos-fb comp.0.in1\nnet TorchIsAtPierceHeight comp.0.out\n\n# make a signal so we do not turn Arc ON while the program is paused\n# put it through OR to make sure pause only affects operations while\n# mode is not manual\nnet PauseIsOn halui.program.is-paused\n\nnet PauseIsOn and2.0.in0\nnet ui_mode_is_auto and2.0.in1\nnet ProgramIsPaused and2.0.out\n\n# If for some reason the Z location is further down or equal than the maximum Z coord we estop!\n# if this happens it means that a. there is no work piece, b the torch is stuck, c the Floatswitch is broken\n\nnet ZMaxCord comp.1.in0\nnet Zpos-fb comp.1.in1\nnet limit-estop comp.1.out\n\n# This is an estop signal used when THC has detected a limit error\nnet limit-estop classicladder.0.in-11\n\nnet TorchIsAtPierceHeight classicladder.0.in-07\nnet LockPierceHeight classicladder.0.out-07\nnet MoveZtoPierceHeight classicladder.0.out-08\n#linksp PierceDelay classicladder.0.in-08\n#linksp ArcStartTimeout classicladder.0.in-09\nnet ProgramIsPaused classicladder.0.in-10\nnet EnablePierceDelay classicladder.0.in-12\nsets EnablePierceDelay 1\n\n############ Corner Height Lock ##################\n"} {"id": "linuxcnc-source:configs/attic/unclaimed/max/max.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/attic/unclaimed/max/max.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/attic/unclaimed/max/max.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "0bae3f652b5c8c3b0fb819c4025552bba47f3cdd3c7db940a5c1caa1d4317d26", "bytes": 7039, "tokens": 2600, "text": "# HAL config file for MAX NC test machine\n#######################################################\n# first load all the HAL modules we're going to need\n#######################################################\n# kinematics\nloadrt [KINS]KINEMATICS\n# main motion controller module\nloadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS\n# using steppers....\nloadrt stepgen step_type=0,0,0,0\n# I/O thru the parport\nloadrt hal_parport cfg=\"0x0378\"\n# counting the spindle encoder in software\nloadrt encoder num_chan=2\n# simulate the encoder\nloadrt sim_encoder num_chan=1\n# misc blocks needed to do fun things\nloadrt ddt count=8\n\n#######################################################\n# add realtime functions to the threads\n# first the high speed thread\n#######################################################\n# first we read parport inputs\naddf parport.0.read\t\tbase-thread\naddf sim-encoder.make-pulses base-thread\n# update encoder counter\naddf encoder.update-counters base-thread\n# generate step and dir signals\naddf stepgen.make-pulses\tbase-thread\n# write to outputs\naddf parport.0.write\t\tbase-thread\n\n\n# now the servo thread\n########################################################\n# capture axis and spindle positions\naddf stepgen.capture-position\tservo-thread\naddf encoder.capture-position\tservo-thread\n# process motion commands coming from user space\naddf motion-command-handler\tservo-thread\n# run main motion controller\naddf motion-controller\t\tservo-thread\n# differentiators to make vel and acc signals\naddf ddt.0\t\t\tservo-thread\naddf ddt.1\t\t\tservo-thread\naddf ddt.2\t\t\tservo-thread\naddf ddt.3\t\t\tservo-thread\naddf ddt.4\t\t\tservo-thread\naddf ddt.5\t\t\tservo-thread\naddf ddt.6\t\t\tservo-thread\naddf ddt.7\t\t\tservo-thread\n# update output info, axis and spindle\naddf stepgen.update-freq\tservo-thread\naddf sim-encoder.update-speed servo-thread\n\n\n#######################################################\n# interconnections\n#\n# first, the basic stepper machine connections\n#######################################################\n\n# connect position commands from motion module to step generator\nnet Xpos-cmd <= joint.0.motor-pos-cmd\nnet Xpos-cmd => stepgen.0.position-cmd\nnet Ypos-cmd <= joint.1.motor-pos-cmd\nnet Ypos-cmd => stepgen.1.position-cmd\nnet Zpos-cmd <= joint.2.motor-pos-cmd\nnet Zpos-cmd => stepgen.2.position-cmd\nnet Apos-cmd <= joint.3.motor-pos-cmd\nnet Apos-cmd => stepgen.3.position-cmd\n\n# connect position feedback from step generators\n# to motion module\nnet Xpos-fb <= stepgen.0.position-fb\nnet Xpos-fb => joint.0.motor-pos-fb\nnet Ypos-fb <= stepgen.1.position-fb\nnet Ypos-fb => joint.1.motor-pos-fb\nnet Zpos-fb <= stepgen.2.position-fb\nnet Zpos-fb => joint.2.motor-pos-fb\nnet Apos-fb <= stepgen.3.position-fb\nnet Apos-fb => joint.3.motor-pos-fb\n\n# connect enable signals for step generators\nnet Xen <= joint.0.amp-enable-out\nnet Xen => stepgen.0.enable\nnet Yen <= joint.1.amp-enable-out\nnet Yen => stepgen.1.enable\nnet Zen <= joint.2.amp-enable-out\nnet Zen => stepgen.2.enable\nnet Aen <= joint.3.amp-enable-out\nnet Aen => stepgen.3.enable\n\n# connect signals to step pulse generator outputs\nnet Xstep <= stepgen.0.step\nnet Xdir <= stepgen.0.dir\nnet Ystep <= stepgen.1.step\nnet Ydir <= stepgen.1.dir\nnet Zstep <= stepgen.2.step\nnet Zdir <= stepgen.2.dir\nnet Astep <= stepgen.3.step\nnet Adir <= stepgen.3.dir\n\n# create a signal for the estop loopback\nnet estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in\n\n# create signals for tool loading loopback\nnet tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared\nnet tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed\n\n# create a signal for \"spindle on\"\nnet spindle_on <= motion.spindle-on\n\n# connect physical pins to the signals\nnet Xstep => parport.0.pin-03-out\nnet Xdir => parport.0.pin-02-out\nnet Ystep => parport.0.pin-05-out\nnet Ydir => parport.0.pin-04-out\nnet Zstep => parport.0.pin-07-out\nnet Zdir => parport.0.pin-06-out\nnet Astep => parport.0.pin-09-out\nnet Adir => parport.0.pin-08-out\n# amp enable (active lo)\nnet Xen => parport.0.pin-01-out\nsetp parport.0.pin-01-out-invert 1\n# spindle enable (active lo)\nnet spindle_on => parport.0.pin-14-out\nsetp parport.0.pin-14-out-invert 1\n\n#######################################################\n# set scaling and other parameters of the basic machine\n\n# set stepgen module scaling - get values from ini file\nsetp stepgen.0.position-scale [AXIS_0]SCALE\nsetp stepgen.1.position-scale [AXIS_1]SCALE\nsetp stepgen.2.position-scale [AXIS_2]SCALE\nsetp stepgen.3.position-scale [AXIS_3]SCALE\n\n# set stepgen module accel limits - get values from ini file\n# jmk said to set these to ini value + 5% to avoid stepgen bug\nsetp stepgen.0.maxaccel [AXIS_0]HAL_MAXACCEL\nsetp stepgen.1.maxaccel [AXIS_1]HAL_MAXACCEL\nsetp stepgen.2.maxaccel [AXIS_2]HAL_MAXACCEL\nsetp stepgen.3.maxaccel [AXIS_3]HAL_MAXACCEL\n\n# end of basic machine\n\n#######################################################\n# Beginning of threading related stuff\n#######################################################\n\n# spindle speed control\nnet spindle-speed-cmd <= motion.spindle-speed-out\nnet spindle-speed-cmd => sim-encoder.0.speed\n\n# spindle encoder\n# connect encoder signals to encoder counter\nnet spindle-phase-A => encoder.0.phase-A\nnet spindle-phase-B => encoder.0.phase-B\nnet spindle-phase-Z => encoder.0.phase-Z\n\nnet spindle-phase-A <= sim-encoder.0.phase-A\nnet spindle-phase-B <= sim-encoder.0.phase-B\nnet spindle-phase-Z <= sim-encoder.0.phase-Z\n\n# assume 120 ppr = 480 counts/rev for the spindle\nsetp sim-encoder.0.ppr 120\n# iocontrol output is in rpm, but sim-encoder speed is rps\nsetp sim-encoder.0.scale 60\n# scale encoder output to read in revolutions\n# (that way thread pitches can be straightforward,\n# a 20 tpi thread would multiply the encoder output\n# by 1/20, etc)\nsetp encoder.0.position-scale 480\n\n# encoder reset control\nnet spindle-index-enable <= motion.spindle-index-enable\nnet spindle-index-enable <=> encoder.0.index-enable\n\n\n# report our revolution count to the motion controller\nnet spindle-pos <= encoder.0.position\nnet spindle-pos => motion.spindle-revs\n\n\n#######################################################\n# make vel and accel sigs for testing\n#######################################################\n\n# send the position commands thru differentiators to\n# generate velocity and accel signals (for testing)\n\n# define the signals, and hook them up\nnet Xpos-cmd => ddt.0.in\nnet Xvel <= ddt.0.out\nnet Xvel => ddt.1.in\nnet Xacc <= ddt.1.out\n\nnet Ypos-cmd => ddt.2.in\nnet Yvel <= ddt.2.out\nnet Yvel => ddt.3.in\nnet Yacc <= ddt.3.out\n\nnet Zpos-cmd => ddt.4.in\nnet Zvel <= ddt.4.out\nnet Zvel => ddt.5.in\nnet Zacc <= ddt.5.out\n\nnet Apos-cmd => ddt.6.in\nnet Avel <= ddt.6.out\nnet Avel => ddt.7.in\nnet Aacc <= ddt.7.out\n\n# for spindle velocity estimate\nloadrt lowpass count=1\nnet spindle-rpm-raw encoder.0.velocity\nnet spindle-rpm-raw lowpass.0.in\nnet spindle-rpm-filtered lowpass.0.out\nsetp lowpass.0.gain .03\naddf lowpass.0 servo-thread\n"} {"id": "linuxcnc-source:configs/by_interface/mesa/hm2-servo/5i20.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_interface/mesa/hm2-servo/5i20.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_interface/mesa/hm2-servo/5i20.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "4974beba8880756dcbfa7ebc6f355ac90c955705ee04d616d5bfc47b81f2fb97", "bytes": 5568, "tokens": 2266, "text": "[EMC]\n# The version string for this INI file.\nVERSION = 1.1\n# Name of machine, for use with display, etc.\nMACHINE = HM2-Servo\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\n#DEBUG = 0x00000003\n#DEBUG = 0x00000007\nDEBUG = 0\n\n[DISPLAY]\n# Name of display program, e.g., tklinuxcnc\nDISPLAY = axis\n# Cycle time, in seconds, that display will sleep between polls\nCYCLE_TIME = 0.0500\n# Path to help file\nHELP_FILE = tklinuxcnc.txt\n# Initial display setting for position, RELATIVE or MACHINE\nPOSITION_OFFSET = RELATIVE\n# Initial display setting for position, COMMANDED or ACTUAL\nPOSITION_FEEDBACK = ACTUAL\n# Highest value that will be allowed for feed override, 1.0 = 100%\nMAX_FEED_OVERRIDE = 1.5\n# Prefix to be used\nPROGRAM_PREFIX = ../../nc_files/\n# Introductory graphic\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[RS274NGC]\n# File containing interpreter variables\nPARAMETER_FILE = hm2-servo.var\n\n[EMCMOT]\nEMCMOT = motmod\n# Timeout for comm to emcmot, in seconds\nCOMM_TIMEOUT = 1.0\n# Servo task period, in nanoseconds\nSERVO_PERIOD = 1000000\n\n[TASK]\n# Name of task controller program, e.g., milltask\nTASK = milltask\n# Cycle time, in seconds, that task controller will sleep between polls\nCYCLE_TIME = 0.010\n\n[HAL]\n# The run script first uses halcmd to execute any HALFILE\n# files, and then to execute any individual HALCMD commands.\n# list of hal config files to run through halcmd\n# files are executed in the order in which they appear\nHALFILE = hm2-servo.hal\n# list of halcmd commands to execute\n# commands are executed in the order in which they appear\n#HALCMD = save neta\n\n[HALUI]\n#No Content\n\n[TRAJ]\n# COORDINATES = X Y Z R P W\nCOORDINATES = X Y Z\nHOME = 0 0 0 0\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 3.0\nMAX_LINEAR_VELOCITY = 4.0\nDEFAULT_LINEAR_ACCELERATION = 6.0\nMAX_LINEAR_ACCELERATION = 7.0\n\n[EMCIO]\n# Name of IO controller program, e.g., io\nEMCIO = io\n# cycle time, in seconds\nCYCLE_TIME = 0.100\n# tool table file\nTOOL_TABLE = tool.tbl\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -3.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 4.0\n\n[JOINT_0]\nTYPE = LINEAR\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 4.0\nBACKLASH = 0.000\nFERROR = 0.010\nMIN_FERROR = 0.002\nINPUT_SCALE = 81920\nOUTPUT_SCALE = -1.000\nOUTPUT_OFFSET = 0.0\nMAX_OUTPUT = 1.0\nMIN_LIMIT = -3.0\nMAX_LIMIT = 10.0\nHOME = 0.000\nHOME_OFFSET = -2.9\nHOME_SEARCH_VEL = -0.50\nHOME_LATCH_VEL = 0.10\n# the X axis servo's encoder does not have an index channel, so we have to home without index\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = YES\nHOME_SEQUENCE = 1\n# PID tuning params\nDEADBAND = 0.000015\nP = 100.0\nI = 0.000\nD = 0.000\nFF0 = 0.000\nFF1 = 1.000\nFF2 =\t\t\t0.0\nBIAS = 0.000\n\n[AXIS_Y]\nMIN_LIMIT = -3.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 4.0\n\n[JOINT_1]\nTYPE = LINEAR\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 4.0\nBACKLASH = 0.000\nFERROR = 0.010\nMIN_FERROR = 0.002\nINPUT_SCALE = -81920\nOUTPUT_SCALE = 1.000\nOUTPUT_OFFSET = 0.0\nMAX_OUTPUT = 1.0\nMIN_LIMIT = -3.0\nMAX_LIMIT = 10.0\nHOME = 0.000\nHOME_OFFSET = -2.9\nHOME_SEARCH_VEL = -0.50\nHOME_LATCH_VEL = 0.10\n# the Y axis servo's encoder has an index channel, so we use it to improve the home accuracy\nHOME_USE_INDEX = YES\nHOME_IGNORE_LIMITS = YES\nHOME_SEQUENCE = 1\n# PID tuning params\nDEADBAND = 0.000015\nP = 100.0\nI = 0.000\nD = 0.000\nFF0 = 0.000\nFF1 = 1.000\nFF2 =\t\t\t0.0\nBIAS = 0.000\n\n[AXIS_Z]\nMIN_LIMIT = -3.0\nMAX_LIMIT = 3.0\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 4.0\n\n[JOINT_2]\nTYPE = LINEAR\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 4.0\nBACKLASH = 0.000\nFERROR = 0.010\nMIN_FERROR = 0.002\nINPUT_SCALE = 81920\nOUTPUT_SCALE = -1.000\nOUTPUT_OFFSET = 0.0\nMAX_OUTPUT = 1.0\nMIN_LIMIT = -3.0\nMAX_LIMIT = 3.0\nHOME = 0.0\nHOME_OFFSET = -2.9\nHOME_SEARCH_VEL = -0.50\nHOME_LATCH_VEL = 0.10\n# the Z axis servo's encoder does not have an index channel, so we have to home without index\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = YES\nHOME_SEQUENCE = 0\n# PID tuning params\nDEADBAND = 0.000015\nP = 100.0\nI = 0.000\nD = 0.000\nFF0 = 0.000\nFF1 = 1.000\nFF2 =\t\t\t0.0\nBIAS = 0.000\n\n[HOSTMOT2]\nDRIVER=hm2_pci\nBOARD=5i20\nCONFIG=\"firmware=hm2/5i20/SVST8_4.BIT num_encoders=3 num_pwmgens=3 num_stepgens=0\"\n"} {"id": "linuxcnc-source:configs/by_interface/parport/classicladder/cl-estop/custom.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_interface/parport/classicladder/cl-estop/custom.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_interface/parport/classicladder/cl-estop/custom.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "193ebe404d450c2c1285bbf9896935b528041d590f64e7beb028e122eb3e8b5e", "bytes": 318, "tokens": 99, "text": "# Include your customized HAL commands here\n# This file will not be overwritten when you run stepconf again\n\n# Load ClassicLadder\nloadrt classicladder_rt\n\n# Add the ClassicLadder refresh function to the servo thread\naddf classicladder.0.refresh servo-thread\n\n# Load the ladder\nloadusr classicladder --nogui estop.clp\n"} {"id": "linuxcnc-source:configs/by_interface/parport/nist-lathe/inch.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_interface/parport/nist-lathe/inch.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_interface/parport/nist-lathe/inch.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "658c3d6d8a967385fddc6d0f6aa6b0c5ef197bfd4f2b86f43748d7684ef52435", "bytes": 7411, "tokens": 2379, "text": "# EMC controller parameters for generic controller. Make these what you need\n# for your system.\n# General note: Comments can either be preceded with a # or ; - either is\n# acceptable, although # is in keeping with most linux config files.\n# Settings with a + at the front of the comment are likely needed to get \n# changed by the user.\n# Settings with a - at the front are highly unneeded to be changed\n###############################################################################\n# General section \n###############################################################################\n\n[EMC]\n#- Version of this INI file\nVERSION = 1.1\n#+ Name of machine, for use with display, etc.\nMACHINE = LinuxCNC-NIST-LATHE-IN\n#+ Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\nDEBUG = 0\n# DEBUG = 0x00000007\n# DEBUG = 0x7FFFFFFF\n###############################################################################\n# Sections for display options \n###############################################################################\n\n[DISPLAY]\n#+ Name of display program, e.g., axis\nDISPLAY = axis\n# DISPLAY = \t\ttklinuxcnc\n# Cycle time, in seconds, that display will sleep between polls\nLATHE = 1\nCYCLE_TIME = 0.200\n#- Path to help file\nHELP_FILE = doc/help.txt\n#- Initial display setting for position, RELATIVE or MACHINE\nPOSITION_OFFSET = RELATIVE\n#- Initial display setting for position, COMMANDED or ACTUAL\nPOSITION_FEEDBACK = ACTUAL\n#+ Highest value that will be allowed for feed override, 1.0 = 100%\nMAX_FEED_OVERRIDE = 1.4\n#- Prefix to be used\nPROGRAM_PREFIX = ../../nc_files/\n#- Introductory graphic\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n# Editor to be used with Axis\n#EDITOR = geany\n###############################################################################\n# Task controller section \n###############################################################################\n\n[FILTER]\n#No Content\n\n[RS274NGC]\n#- File containing interpreter variables\nPARAMETER_FILE = nist-lathe.var\n###############################################################################\n# Motion control section \n###############################################################################\n\n[EMCMOT]\n#- Name of the motion controller to use (only one exists for nontrivkins)\nEMCMOT = motmod\n#- Timeout for comm to emcmot, in seconds\nCOMM_TIMEOUT = 1.0\n#+ Base task period, in nanosecs - this is the fastest thread in the machine\nBASE_PERIOD = 20000\n#- Servo task period, in nanosecs - will be rounded to an int multiple of BASE_PERIOD\nSERVO_PERIOD = 1000000\n###############################################################################\n# Hardware Abstraction Layer section\n###############################################################################\n\n[TASK]\n# Name of task controller program, e.g., milltask\nTASK = milltask\n#- Cycle time, in seconds, that task controller will sleep between polls\nCYCLE_TIME = 0.010\n###############################################################################\n# Part program interpreter section \n###############################################################################\n\n[HAL]\n# The run script first uses halcmd to execute any HALFILE\n# files, and then to execute any individual HALCMD commands.\n#\n# list of hal config files to run through halcmd\n#+ files are executed in the order in which they appear\nHALFILE = nist-lathe.hal\n#- list of halcmd commands to execute\n# commands are executed in the order in which they appear\n#HALCMD = save neta\n###############################################################################\n# Trajectory planner section\n###############################################################################\n\n[HALUI]\n#No Content\n\n[TRAJ]\n#+ machine specific settings\n# COORDINATES = X Y Z R P W\nCOORDINATES = X Y Z\nHOME = 0 0 0\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = .5\nMAX_LINEAR_VELOCITY = .5\nDEFAULT_LINEAR_ACCELERATION = 20.0\nMAX_LINEAR_ACCELERATION = 20.0\n###############################################################################\n# Axes sections\n###############################################################################\n#+ First axis\n\n[EMCIO]\n#- Name of IO controller program, e.g., io\nEMCIO = \t\tio\n#- cycle time, in seconds\nCYCLE_TIME = 0.100\n#- tool table file\nTOOL_TABLE = nist-lathe.tbl\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -0.54\nMAX_LIMIT = 1.11\nMAX_VELOCITY = 0.383333\nMAX_ACCELERATION = 5.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.5\nMAX_VELOCITY = 0.383333\n# NOTE: the step generator module applies its own limits to\n# acceleration and velocity. We have discovered that it needs\n# to have a little \"headroom\" over the accel by the trajectory\n# planner, otherwise it can fall slightly behind during accel\n# and later overshoot as it catches up. In the long term we\n# hope to come up with a clean fix for this problem. In the\n# meantime, please set STEPGEN_MAXACCEL below to a few percent\n# higher than the regular acceleration limit MAX_ACCELERATION\nMAX_ACCELERATION = 5.0\nSTEPGEN_MAXACCEL = 7.7\nBACKLASH = 0.000\nSCALE = -8000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -0.54\nMAX_LIMIT = 1.11\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = .1111\nHOME_SEARCH_VEL = -0.5\nHOME_LATCH_VEL = -0.025\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE=1\nHOME_IS_SHARED = 1\n#+ Second axis\n\n[AXIS_Y]\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 12.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 1.0\nMAX_ACCELERATION = 12.0\nSTEPGEN_MAXACCEL = 13.0\nBACKLASH = 0.000\nSCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n#+ Third axis\n\n[AXIS_Z]\nMIN_LIMIT = -0.001\nMAX_LIMIT = 4.0\nMAX_VELOCITY = 0.433333\nMAX_ACCELERATION = 5.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 1.0\nMAX_VELOCITY = 0.433333\nMAX_ACCELERATION = 5.0\nSTEPGEN_MAXACCEL = 5.7\nBACKLASH = 0.000\nSCALE = -8000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -0.001\nMAX_LIMIT = 4.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.5\nHOME_SEARCH_VEL = -0.5\nHOME_LATCH_VEL = -0.025\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n###############################################################################\n# section for main IO controller parameters \n###############################################################################\n"} {"id": "linuxcnc-source:configs/by_interface/parport/plasma-thc-sim/thc_vcp.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_interface/parport/plasma-thc-sim/thc_vcp.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_interface/parport/plasma-thc-sim/thc_vcp.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "1df9292e2d07dd75d5480ba248ff7da895473f803b419e3f587b3e7554f4cae7", "bytes": 906, "tokens": 391, "text": "############### Torch Height Control Python Widgets #################### \n\n# Hook up PyVCP pins using the net command\nnet CHLThreshold pyvcp.Scale-CHLThreshold-f => scale.0.in\nnet CHLEnable pyvcp.Check-CHLEnable => and2.0.in1\nnet TravelHeight pyvcp.Spin-TravelHeight => sum2.3.in0\nnet PierceDelay pyvcp.Spin-PierceDelay => oneshot.0.width\nnet THCStepSize pyvcp.Spin-THCStepSize => mult2.0.in0\nnet PierceGap pyvcp.Spin-PierceGap => sum2.0.in1\nnet SwitchTravel pyvcp.Spin-SwitchTravel => sum2.0.in0\nnet Autostart pyvcp.Check-AutoStart and2.8.in1\n\n# Hook up pins connecting to PyVCP objects\nnet MoveDown => pyvcp.Led-MoveDown\nnet MoveUp => pyvcp.Led-MoveUp\nnet FloatSwitch => pyvcp.Led-FloatSwitch\nnet ArcOK => pyvcp.Led-ArcOK\nnet LockHeight => pyvcp.Led-HeightLocked\nnet TorchOn => pyvcp.Led-TorchOn\nnet ExtEStop => pyvcp.Led-ExtEStop\nnet PierceDelayTimer oneshot.0.time-left => pyvcp.Num-PierceDelayTimer\n"} {"id": "linuxcnc-source:configs/by_interface/parport/stepper-xyza/standard_pinout.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_interface/parport/stepper-xyza/standard_pinout.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_interface/parport/stepper-xyza/standard_pinout.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "649077987cbec09d2129d186e59903ab17b63be35a4325f5e502791b9f9f208f", "bytes": 1102, "tokens": 416, "text": "# standard pinout config file for 3-axis steppers\n# using a parport for I/O\n#\n# first load the parport driver\nloadrt hal_parport cfg=\"0x0378\"\n#\n# next connect the parport functions to threads\n# read inputs first\naddf parport.0.read base-thread 1\n# write outputs last\naddf parport.0.write base-thread -1\n#\n# finally connect physical pins to the signals\nnet Xstep parport.0.pin-03-out\nnet Xdir parport.0.pin-02-out\nnet Ystep parport.0.pin-05-out\nnet Ydir parport.0.pin-04-out\nnet Zstep parport.0.pin-07-out\nnet Zdir parport.0.pin-06-out\nnet Astep parport.0.pin-09-out\nnet Adir parport.0.pin-08-out\n\n\n# create a signal for the estop loopback\nnet estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in\n\n# create signals for tool loading loopback\nnet tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared\nnet tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed\n\n# create a signal for \"spindle on\"\n\n# commented out till we resolve this issue\n# connect it to the iocontroller\nnet spindle_on spindle.0.on\n# connect it to a physical pin\nnet spindle_on parport.0.pin-01-out\n"} {"id": "linuxcnc-source:configs/by_interface/parport/stepper/sim_inch.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_interface/parport/stepper/sim_inch.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_interface/parport/stepper/sim_inch.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "9c7d501fccc188f8e6adee982f9eb8e50dbcb4ea6748f3a2c50353eb599b3d47", "bytes": 7385, "tokens": 2335, "text": "# EMC controller parameters for generic controller. Make these what you need\n# for your system.\n# General note: Comments can either be preceded with a # or ; - either is\n# acceptable, although # is in keeping with most linux config files.\n# Settings with a + at the front of the comment are likely needed to get \n# changed by the user.\n# Settings with a - at the front are highly unneeded to be changed\n###############################################################################\n# General section \n###############################################################################\n\n[EMC]\n#- Version of this INI file\nVERSION = 1.1\n#+ Name of machine, for use with display, etc.\nMACHINE = LinuxCNC-HAL-STEP-SIM\n#+ Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\nDEBUG = 0\n# DEBUG = 0x00000007\n# DEBUG = 0x7FFFFFFF\n###############################################################################\n# Sections for display options \n###############################################################################\n\n[DISPLAY]\n#+ Name of display program, e.g., axis\n# DISPLAY = axis\n DISPLAY = \t\taxis\n# Cycle time, in seconds, that display will sleep between polls\nCYCLE_TIME = 0.200\n#- Path to help file\nHELP_FILE = doc/help.txt\n#- Initial display setting for position, RELATIVE or MACHINE\nPOSITION_OFFSET = RELATIVE\n#- Initial display setting for position, COMMANDED or ACTUAL\nPOSITION_FEEDBACK = ACTUAL\n#+ Highest value that will be allowed for feed override, 1.0 = 100%\nMAX_FEED_OVERRIDE = 1.2\n#- Prefix to be used\nPROGRAM_PREFIX = ../../nc_files/\n#- Introductory graphic\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n# Editor to be used with Axis\n#EDITOR = geany\n###############################################################################\n# Task controller section \n###############################################################################\n\n[FILTER]\n#No Content\n\n[RS274NGC]\n#- File containing interpreter variables\nPARAMETER_FILE = stepper.var\n###############################################################################\n# Motion control section \n###############################################################################\n\n[EMCMOT]\n#- Name of the motion controller to use (only one exists for nontrivkins)\nEMCMOT = motmod\n#- Timeout for comm to emcmot, in seconds\nCOMM_TIMEOUT = 1.0\n#+ Base task period, in nanosecs - this is the fastest thread in the machine\nBASE_PERIOD = 50000\n#- Servo task period, in nanosecs - will be rounded to an int multiple of BASE_PERIOD\nSERVO_PERIOD = 1000000\n###############################################################################\n# Hardware Abstraction Layer section\n###############################################################################\n\n[TASK]\n# Name of task controller program, e.g., milltask\nTASK = milltask\n#- Cycle time, in seconds, that task controller will sleep between polls\nCYCLE_TIME = 0.010\n###############################################################################\n# Part program interpreter section \n###############################################################################\n\n[HAL]\n# The run script first uses halcmd to execute any HALFILE\n# files, and then to execute any individual HALCMD commands.\n#\n# list of hal config files to run through halcmd\n#+ files are executed in the order in which they appear\nHALFILE = core_stepper.hal\n#HALFILE = xylotex_pinout.hal\nHALFILE = sim_pinout.hal\n#- list of halcmd commands to execute\n# commands are executed in the order in which they appear\n#HALCMD = save neta\n###############################################################################\n# Trajectory planner section\n###############################################################################\n\n[HALUI]\n#No Content\n\n[TRAJ]\n#+ machine specific settings\n# COORDINATES = X Y Z A B C\nCOORDINATES = X Y Z\nHOME = 0 0 0\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 1.2\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_ACCELERATION = 15.0\nMAX_LINEAR_ACCELERATION = 20.0\n###############################################################################\n# Axes sections\n###############################################################################\n#+ First axis\n\n[EMCIO]\n#- Name of IO controller program, e.g., io\nEMCIO = \t\tio\n#- cycle time, in seconds\nCYCLE_TIME = 0.100\n#- tool table file\nTOOL_TABLE = stepper.tbl\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 1.2\n# NOTE: the step generator module applies its own limits to\n# acceleration and velocity. We have discovered that it needs\n# to have a little \"headroom\" over the accel by the trajectory\n# planner, otherwise it can fall slightly behind during accel\n# and later overshoot as it catches up. In the long term we\n# hope to come up with a clean fix for this problem. In the\n# meantime, please set STEPGEN_MAXACCEL below to a few percent\n# higher than the regular acceleration limit MAX_ACCELERATION\nMAX_ACCELERATION = 20.0\nSTEPGEN_MAXACCEL = 21.0\nBACKLASH = 0.000\nSCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n#+ Second axis\n\n[AXIS_Y]\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\nSTEPGEN_MAXACCEL = 21.0\nBACKLASH = 0.000\nSCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n#+ Third axis\n\n[AXIS_Z]\nMIN_LIMIT = -2.0\nMAX_LIMIT = 4.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\nSTEPGEN_MAXACCEL = 21.0\nBACKLASH = 0.000\nSCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -2.0\nMAX_LIMIT = 4.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n###############################################################################\n# section for main IO controller parameters \n###############################################################################\n"} {"id": "linuxcnc-source:configs/by_interface/parport/stepper/sim_pinout.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_interface/parport/stepper/sim_pinout.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_interface/parport/stepper/sim_pinout.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "80a65581d0d5709561afe63a376c01e6378cad023f35e3f07ead4a86c4c70108", "bytes": 792, "tokens": 290, "text": "# standard pinout config file for 3-axis steppers\n# using a parport for I/O\n#\n# first load the parport driver\nloadrt hal_speaker\n#\n# next connect the parport functions to threads\n# write outputs last\naddf speaker.0.write base-thread 1\n#\n# finally connect physical pins to the signals\nnet Xstep => speaker.0.pin-03-out\nnet Xdir => speaker.0.pin-02-out\nnet Ystep => speaker.0.pin-05-out\nnet Ydir => speaker.0.pin-04-out\nnet Zstep => speaker.0.pin-07-out\nnet Zdir => speaker.0.pin-06-out\n\n# create a signal for the estop loopback\nnet estop-loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in\n\n# create signals for tool loading loopback\nnet tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared\nnet tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed\n"} {"id": "linuxcnc-source:configs/by_machine/cooltool/Uni-fraes-v3.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_machine/cooltool/Uni-fraes-v3.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_machine/cooltool/Uni-fraes-v3.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "da65c0145a646296a772f595394dfb7fec4a4dc86b3a214aaefe72b67bc6e112", "bytes": 6576, "tokens": 2308, "text": "# EMC controller parameters for generic controller. Make these what you need\n# for your system.\n# General note: Comments can either be preceded with a # or ; - either is\n# acceptable, although # is in keeping with most linux config files.\n# General section -------------------------------------------------------------\n\n[EMC]\n# Version of this INI file\nVERSION = 1.1\n# Name of machine, for use with display, etc.\nMACHINE = UNI-FRAES-V3 \n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\n# DEBUG = 0x00000003\n# DEBUG = 0x00000007\n# DEBUG = 0x7FFFFFFF\nDEBUG = 0\n# Sections for display options ------------------------------------------------\n\n[DISPLAY]\n#DISPLAY = tklinuxcnc\nDISPLAY = axis\n#EDITOR = geany\n# Cycle time, in seconds, that display will sleep between polls\nCYCLE_TIME = 0.200\n# Path to help file\nHELP_FILE = doc/help.txt\n# Initial display setting for position, RELATIVE or MACHINE\nPOSITION_OFFSET = RELATIVE\n# Initial display setting for position, COMMANDED or ACTUAL\nPOSITION_FEEDBACK = ACTUAL\n# Highest value that will be allowed for feed override, 1.0 = 100%\nMAX_FEED_OVERRIDE = 2.0\n# Prefix to be used\nPROGRAM_PREFIX = ../../nc_files/\n# Introductory graphic\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n# Task controller section -----------------------------------------------------\n\n[FILTER]\nPROGRAM_EXTENSION = .py Python Script\npy = python3\n# Trajectory planner section --------------------------------------------------\n\n[RS274NGC]\n# File containing interpreter variables\nPARAMETER_FILE = stepper.var\n# Motion control section ------------------------------------------------------\n\n[EMCMOT]\nEMCMOT = motmod\n# Timeout for comm to emcmot, in seconds\nCOMM_TIMEOUT = 1.0\n# Base task period, in seconds - this is the fastest thread in the machine\nBASE_PERIOD = 50000\n# Servo task period, in seconds - will be rounded to an integer multiple\n# of BASE_PERIOD\nSERVO_PERIOD = 1000000\n# Trajectory Planner task period, in seconds - will be rounded to an\n# integer multiple of SERVO_PERIOD\nTRAJ_PERIOD = 10000000\n# Hardware Abstraction Layer section --------------------------------------------------\n\n[TASK]\n# Name of task controller program, e.g., bridgeporttask\nTASK = milltask\n# Cycle time, in seconds, that task controller will sleep between polls\nCYCLE_TIME = 0.010\n# Part program interpreter section --------------------------------------------\n\n[HAL]\n# The run script first uses halcmd to execute any HALFILE\n# files, and then to execute any individual HALCMD commands.\n#\n# list of hal config files to run through halcmd\n# files are executed in the order in which they appear\nHALFILE = core_stepper4.hal\nHALFILE = standard_pinout4.hal\n# list of halcmd commands to execute\n# commands are executed in the order in which they appear\n#HALCMD = save neta\n# Section Filter\n\n[HALUI]\n#No Content\n\n[TRAJ]\nCOORDINATES = X Y Z\nHOME = 0 0 0\nLINEAR_UNITS = mm\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 2\nMAX_LINEAR_VELOCITY = 50\nDEFAULT_LINEAR_ACCELERATION = 20.0\nMAX_LINEAR_ACCELERATION = 20.0\n# Axes sections ---------------------------------------------------------------\n# First axis\n\n[EMCIO]\n# Name of IO controller program, e.g., io\nEMCIO = \t\tio\n# cycle time, in seconds\nCYCLE_TIME = 0.100\n# tool table file\nTOOL_TABLE = stepper.tbl\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -145.0\nMAX_LIMIT = 145.0\nMAX_VELOCITY = 5\nMAX_ACCELERATION = 20.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 5\nMAX_ACCELERATION = 20.0\nSTEPGEN_MAXVEL =\t\t6\nSTEPGEN_MAXACCEL =\t\t22\nBACKLASH = 0.000\nSCALE = 800\nMIN_LIMIT = -145.0\nMAX_LIMIT = 145.0\nFERROR = 0.500\nMIN_FERROR = 0.500\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n# Second axis\n\n[AXIS_Y]\nMIN_LIMIT = -50.0\nMAX_LIMIT = 50.0\nMAX_VELOCITY = 5\nMAX_ACCELERATION = 20.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 5\nMAX_ACCELERATION = 20.0\nSTEPGEN_MAXVEL =\t\t6\nSTEPGEN_MAXACCEL =\t\t22\nBACKLASH = 0.000\nSCALE = -800\nMIN_LIMIT = -50.0\nMAX_LIMIT = 50.0\nFERROR = 0.500\nMIN_FERROR = 0.500\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n# Third axis\n\n[AXIS_Z]\nMIN_LIMIT = -50.0\nMAX_LIMIT = 50.0\nMAX_VELOCITY = 5\nMAX_ACCELERATION = 20.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 5\nMAX_ACCELERATION = 20.0\nSTEPGEN_MAXVEL =\t\t6\nSTEPGEN_MAXACCEL =\t\t22\nBACKLASH = 0.000\nSCALE = -800\nMIN_LIMIT = -50.0\nMAX_LIMIT = 50.0\nFERROR = 0.500\nMIN_FERROR = 0.500\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n# Four axis\n\n[AXIS_A]\nMIN_LIMIT = -10000\nMAX_LIMIT = 10000\nMAX_VELOCITY = 50\nMAX_ACCELERATION = 20.0\n\n[JOINT_3]\nTYPE = ANGULAR\nHOME = 0.0\nMAX_VELOCITY = 50\nMAX_ACCELERATION = 20.0\nSTEPGEN_MAXVEL =\t\t52\nSTEPGEN_MAXACCEL =\t\t22\nBACKLASH = 0.000\nSCALE = -8.8888888888\nMIN_LIMIT = -10000\nMAX_LIMIT = 10000\nFERROR = 50.000\nMIN_FERROR = 10.000\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\n# section for main IO controller parameters -----------------------------------\n"} {"id": "linuxcnc-source:configs/by_machine/scorbot-er-3/gripper.xml", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_machine/scorbot-er-3/gripper.xml", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_machine/scorbot-er-3/gripper.xml", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "4f4d10a048727cb73b67957e4fbeb0535fbbc65962a819b60aadd6eeacc3d94a", "bytes": 414, "tokens": 135, "text": "\n\n\n \n \n \n \"gripper\"\n 1\n HORIZONTAL\n 0\n -200\n 200\n \n \n \n\n\n"} {"id": "linuxcnc-source:configs/by_machine/smithy/1240_4axis.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_machine/smithy/1240_4axis.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_machine/smithy/1240_4axis.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "f801857d0f84ffc3125e07a8bbe5fef1d47ece8e09840de9b133a452664dbce5", "bytes": 7607, "tokens": 3629, "text": "# 5i20 config file for 4 Axis Smithy 1240 Mill\n\n# load the hostmot2 driver, this doesn't do anything by itself,\n# it just waits for low-level drivers to register boards\nloadrt hostmot2 debug_idrom=1 debug_module_descriptors=1 debug_pin_descriptors=1 debug_modules=1\n\n# load the low-level driver for the board\n# this will load the board's firmware and register it with the hostmot2\n# driver loaded above, and it'll show up in HAL\nloadrt hm2_pci config=\"firmware=hm2/5i20/SVST2_4_7I47.BIT num_encoders=1 num_pwmgens=1 num_stepgens=4 enable_raw\"\n\n# 13312 = 0x3400 = Encoder Sample Rate Register\nsetp hm2_5i20.0.raw.write_address 13312\n# sample rate is clock (33 MHz)/SRR+2 = 33MHz/10 = 3.3MHz\nsetp hm2_5i20.0.raw.write_data 8\n# write data\nsetp hm2_5i20.0.raw.write_strobe 1\n\n# set up the watchdog\n#setp hm2_5i20.0.watchdog.timeout_ns 10000000\n\n# load kinematics\nloadrt [KINS]KINEMATICS\n\n# load motion controller, get name and thread periods from ini file\nloadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[KINS]JOINTS\n\n# load charge pump\nloadrt charge_pump\n\n# These loopbacks are usually disconnected by a postgui halfile\nnet tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed\nnet tool-prepare-loopback iocontrol.0.tool-prepare iocontrol.0.tool-prepared\n\n#the Enable signal is used to permanently enable things\nnewsig Enable bit\nsets Enable TRUE\n\n#configure the spindle speed\nnet scmd spindle.0.speed-out hm2_5i20.0.pwmgen.00.value\nsetp hm2_5i20.0.pwmgen.00.scale 4000\nsetp hm2_5i20.0.pwmgen.00.output-type 1\nsetp hm2_5i20.0.pwmgen.pwm_frequency 100\n\n# invert the step pulse polarity\nsetp hm2_5i20.0.gpio.000.invert_output TRUE\nsetp hm2_5i20.0.gpio.002.invert_output TRUE\nsetp hm2_5i20.0.gpio.016.invert_output TRUE\nsetp hm2_5i20.0.gpio.018.invert_output TRUE\n\n# configure the stepgen parameters\nsetp hm2_5i20.0.stepgen.00.dirsetup 5000\nsetp hm2_5i20.0.stepgen.00.dirhold 1250\nsetp hm2_5i20.0.stepgen.00.steplen 1250\nsetp hm2_5i20.0.stepgen.00.stepspace 1250\nsetp hm2_5i20.0.stepgen.00.position-scale [JOINT_0]SCALE\nsetp hm2_5i20.0.stepgen.00.maxaccel [JOINT_0]STEPGEN_MAXACCEL\nsetp hm2_5i20.0.stepgen.00.maxvel [JOINT_0]STEPGEN_MAXVEL\nsetp hm2_5i20.0.stepgen.01.dirsetup 5000\nsetp hm2_5i20.0.stepgen.01.dirhold 1250\nsetp hm2_5i20.0.stepgen.01.steplen 1250\nsetp hm2_5i20.0.stepgen.01.stepspace 1250\nsetp hm2_5i20.0.stepgen.01.position-scale [JOINT_1]SCALE\nsetp hm2_5i20.0.stepgen.01.maxaccel [JOINT_1]STEPGEN_MAXACCEL\nsetp hm2_5i20.0.stepgen.01.maxvel [JOINT_1]STEPGEN_MAXVEL\nsetp hm2_5i20.0.stepgen.02.dirsetup 5000\nsetp hm2_5i20.0.stepgen.02.dirhold 1250\nsetp hm2_5i20.0.stepgen.02.steplen 1250\nsetp hm2_5i20.0.stepgen.02.stepspace 1250\nsetp hm2_5i20.0.stepgen.02.position-scale [JOINT_2]SCALE\nsetp hm2_5i20.0.stepgen.02.maxaccel [JOINT_2]STEPGEN_MAXACCEL\nsetp hm2_5i20.0.stepgen.02.maxvel [JOINT_2]STEPGEN_MAXVEL\nsetp hm2_5i20.0.stepgen.03.dirsetup 5000\nsetp hm2_5i20.0.stepgen.03.dirhold 1250\nsetp hm2_5i20.0.stepgen.03.steplen 1250\nsetp hm2_5i20.0.stepgen.03.stepspace 1250\nsetp hm2_5i20.0.stepgen.03.position-scale [JOINT_3]SCALE\nsetp hm2_5i20.0.stepgen.03.maxaccel [JOINT_3]STEPGEN_MAXACCEL\nsetp hm2_5i20.0.stepgen.03.maxvel [JOINT_3]STEPGEN_MAXVEL\n\n# connect position commands from motion module to step generator\nnet Xpos-cmd joint.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd\nnet Ypos-cmd joint.1.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd\nnet Zpos-cmd joint.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd\nnet Apos-cmd joint.3.motor-pos-cmd => hm2_5i20.0.stepgen.03.position-cmd\n\n# connect position feedback from step generators to motion module\nnet Xpos-fb hm2_5i20.0.stepgen.00.position-fb => joint.0.motor-pos-fb\nnet Ypos-fb hm2_5i20.0.stepgen.01.position-fb => joint.1.motor-pos-fb\nnet Zpos-fb hm2_5i20.0.stepgen.02.position-fb => joint.2.motor-pos-fb\nnet Apos-fb hm2_5i20.0.stepgen.03.position-fb => joint.3.motor-pos-fb\n\n# connect enable signals for step generators\nnet Xen joint.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable\nnet Yen joint.1.amp-enable-out => hm2_5i20.0.stepgen.01.enable\nnet Zen joint.2.amp-enable-out => hm2_5i20.0.stepgen.02.enable\nnet Aen joint.3.amp-enable-out => hm2_5i20.0.stepgen.03.enable\n\n# enable velocity mode jogging\nnet Enable joint.0.jog-vel-mode\nnet Enable joint.1.jog-vel-mode\nnet Enable joint.2.jog-vel-mode\nnet Enable joint.3.jog-vel-mode\n\n# enable the PWM generator\nnet Enable => hm2_5i20.0.pwmgen.00.enable\n\n# enable the charge pump\nnet Enable charge-pump.enable\n\n# connect the charge pump signal to an output\nsetp hm2_5i20.0.gpio.022.is_output TRUE\nnet chargepump hm2_5i20.0.gpio.022.out => charge-pump.out\n\n# Safety Relay Monitoring Contacts\nnet estop-enable hm2_5i20.0.gpio.037.in => iocontrol.0.emc-enable-in\n# Run Switch\nnet machine-on hm2_5i20.0.gpio.039.in_not => halui.machine.on\n\n#connect limit switches to limit inputs\nnet Xmax hm2_5i20.0.gpio.024.in_not => joint.0.pos-lim-sw-in\nnet Xmin hm2_5i20.0.gpio.026.in_not => joint.0.neg-lim-sw-in\nnet Ymax hm2_5i20.0.gpio.028.in_not => joint.1.pos-lim-sw-in\nnet Ymin hm2_5i20.0.gpio.030.in_not => joint.1.neg-lim-sw-in\nnet Zmax hm2_5i20.0.gpio.032.in_not => joint.2.pos-lim-sw-in\nnet Zmin hm2_5i20.0.gpio.034.in_not => joint.2.neg-lim-sw-in\n\n#connect positive limit signals to home inputs\nnet Xmax => joint.0.home-sw-in\nnet Ymax => joint.1.home-sw-in\nnet Zmax => joint.2.home-sw-in\n\n# Spindle Contactor Enable\nsetp hm2_5i20.0.gpio.041.is_output TRUE\nsetp hm2_5i20.0.gpio.041.invert_output TRUE\n# Door Closed - Energizes spindle contactor\nnet CLOSED hm2_5i20.0.gpio.029.in_not hm2_5i20.0.gpio.041.out\n\n# Main Contactors - True when both contactors are energized\nnet ACOK hm2_5i20.0.gpio.035.in_not\n# VFD Fault Relay - True when VFD is not faulted\n#net VFDOK hm2_5i20.0.gpio.031.in_not\n# A Axis Home - On Sieg machines there is no VFD fault signal,\n# it is used for the A axis home sensor on 4 axis machines\nnet VFDOK hm2_5i20.0.gpio.031.in_not\n#net AHOME hm2_5i20.0.gpio.031.in joint.3.home-sw-in\n# Spindle Contactor - False when spindle contactor is energized\nnet SOFF hm2_5i20.0.gpio.033.in halui.program.pause motion.feed-hold\n\n# Axis Drive Status Signals\n# True when YAKO stepper drive is on a full step position\n# True when a Leadshine stepper drive is in the READY state\nnet DRV0 hm2_5i20.0.gpio.025.in_not\nnet DRV1 hm2_5i20.0.gpio.027.in_not\nnet DRV2 hm2_5i20.0.gpio.036.in_not\nnet DRV3 hm2_5i20.0.gpio.038.in_not\n\n# Output Bits\n# KA1\nsetp hm2_5i20.0.gpio.040.is_output TRUE\nsetp hm2_5i20.0.gpio.040.invert_output TRUE\nnet KA1 spindle.0.reverse => hm2_5i20.0.gpio.040.out\n# KA2\nsetp hm2_5i20.0.gpio.042.is_output TRUE\nsetp hm2_5i20.0.gpio.042.invert_output TRUE\nnet KA2 spindle.0.forward => hm2_5i20.0.gpio.042.out\n# Flood Coolant\nsetp hm2_5i20.0.gpio.043.is_output TRUE\nsetp hm2_5i20.0.gpio.043.invert_output TRUE\nnet M8 hm2_5i20.0.gpio.043.out => iocontrol.0.coolant-flood\n# Mist Coolant\nsetp hm2_5i20.0.gpio.045.is_output TRUE\nsetp hm2_5i20.0.gpio.045.invert_output TRUE\nnet M7 hm2_5i20.0.gpio.045.out => iocontrol.0.coolant-mist\n\n# hook the functions to threads\n# read inputs\naddf hm2_5i20.0.read servo-thread\n# handle motion commands\naddf motion-command-handler servo-thread\n# run the motion controller\naddf motion-controller servo-thread\n# write outputs\naddf hm2_5i20.0.write servo-thread\n# toggle the charge pump\naddf charge-pump servo-thread\n"} {"id": "linuxcnc-source:configs/by_machine/smithy/1315postgui.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_machine/smithy/1315postgui.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_machine/smithy/1315postgui.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "bb37822b870ee8f187a5e4c9e4237775f7dd9364969bbf0c89d7f16d3e22f9ce", "bytes": 177, "tokens": 74, "text": "loadrt scale count=1\nnet Svel scale.0.in\nsetp scale.0.gain 60\nnet Scmd pyvcp.commanded-spindle-speed\nnet Sact pyvcp.actual-spindle-speed scale.0.out\naddf scale.0 servo-thread\n"} {"id": "linuxcnc-source:configs/by_machine/smithy/naiky_test.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_machine/smithy/naiky_test.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_machine/smithy/naiky_test.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "08c5d3160703e54f25480980e549add219f4d4c02c64415c1c0cd214c40f1d82", "bytes": 3166, "tokens": 1715, "text": "# Jog Pendant\n# load the hostmot2 driver, this doesn't do anything by itself,\n# it just waits for low-level drivers to register boards\nloadrt hostmot2 debug_idrom=1 debug_module_descriptors=1 debug_pin_descriptors=1 debug_modules=1\n\n# load the low-level driver for the board\n# this will load the board's firmware and register it with the hostmot2\n# driver loaded above, and it'll show up in HAL\nloadrt hm2_pci config=\"firmware=hm2/5i20/SVST2_4_7I47.BIT num_encoders=1 num_pwmgens=0 num_stepgens=0\"\n# set up the watchdog\n#setp hm2_5i20.0.watchdog.timeout_ns 10000000\n\nloadusr -Wn naiky pyvcp -c naiky naiky.xml\n\n# create realtime thread\nloadrt threads name1=base-thread period1=50000 name2=servo-thread period2=1000000\n\nloadrt encoder num_chan=1\n\n# \"times 4 mode\" one count per full quadrature cycle, instead of the usual one count per edge. \n# mpg jog wheels often have a full quadrature cycle per \"click\". 0 for off and 1 for on.\nsetp encoder.0.x4-mode FALSE\n\n#net X1 hm2_5i20.0.gpio.000.in_not naiky.x1\n#net X10 hm2_5i20.0.gpio.002.in_not naiky.x10\n#net X100 hm2_5i20.0.gpio.004.in_not naiky.x100\n#net SEL-X hm2_5i20.0.gpio.006.in_not naiky.x\n#net SEL-Y hm2_5i20.0.gpio.008.in_not naiky.y\n#net SEL-Z hm2_5i20.0.gpio.010.in_not naiky.z\n#net SEL-4 hm2_5i20.0.gpio.012.in_not naiky.4\n#net SEL-OFF hm2_5i20.0.gpio.014.in_not naiky.off\n#setp hm2_5i20.0.gpio.016.is_output TRUE\n#setp hm2_5i20.0.gpio.016.invert_output TRUE\n#net LED hm2_5i20.0.gpio.016.out naiky.led\n#net MPG-A encoder.0.phase-A hm2_5i20.0.gpio.003.in_not naiky.a\n#net MPG-B encoder.0.phase-B hm2_5i20.0.gpio.001.in_not naiky.b\n\n#net X1 hm2_5i20.0.gpio.024.in_not naiky.x1\n#net X10 hm2_5i20.0.gpio.026.in_not naiky.x10\n#net X100 hm2_5i20.0.gpio.028.in_not naiky.x100\n#net SEL-X hm2_5i20.0.gpio.030.in_not naiky.x\n#net SEL-Y hm2_5i20.0.gpio.032.in_not naiky.y\n#net SEL-Z hm2_5i20.0.gpio.034.in_not naiky.z\n#net SEL-4 hm2_5i20.0.gpio.036.in_not naiky.4\n#net SEL-OFF hm2_5i20.0.gpio.038.in_not naiky.off\n#setp hm2_5i20.0.gpio.040.is_output TRUE\n#setp hm2_5i20.0.gpio.040.invert_output TRUE\n#net LED hm2_5i20.0.gpio.040.out naiky.led\n#net MPG-A encoder.0.phase-A hm2_5i20.0.gpio.027.in_not naiky.a\n#net MPG-B encoder.0.phase-B hm2_5i20.0.gpio.025.in_not naiky.b\n\nnet X1 hm2_5i20.0.gpio.048.in_not naiky.x1\nnet X10 hm2_5i20.0.gpio.050.in_not naiky.x10\nnet X100 hm2_5i20.0.gpio.052.in_not naiky.x100\nnet SEL-X hm2_5i20.0.gpio.054.in_not naiky.x\nnet SEL-Y hm2_5i20.0.gpio.056.in_not naiky.y\nnet SEL-Z hm2_5i20.0.gpio.058.in_not naiky.z\nnet SEL-4 hm2_5i20.0.gpio.060.in_not naiky.4\nnet SEL-OFF hm2_5i20.0.gpio.062.in_not naiky.off\nsetp hm2_5i20.0.gpio.064.is_output TRUE\nsetp hm2_5i20.0.gpio.064.invert_output TRUE\nnet LED hm2_5i20.0.gpio.064.out naiky.led\nnet MPG-A encoder.0.phase-A hm2_5i20.0.gpio.051.in_not naiky.a\nnet MPG-B encoder.0.phase-B hm2_5i20.0.gpio.049.in_not naiky.b\n\n\nnet COUNT encoder.0.position naiky.count\nnet RESET encoder.0.reset naiky.reset\n\n# hook the functions to threads\n# read inputs\naddf hm2_5i20.0.read base-thread\naddf encoder.update-counters base-thread\naddf encoder.capture-position servo-thread\n# write outputs\naddf hm2_5i20.0.write servo-thread\n\nstart\nshow pin\nwaitusr naiky\n"} {"id": "linuxcnc-source:configs/by_machine/tormach/pcnc-1100.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/by_machine/tormach/pcnc-1100.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/by_machine/tormach/pcnc-1100.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "0a4d4d5dc1012019b9571ab873ede0e0e884858b9500b616aead6004486ae6ad", "bytes": 5618, "tokens": 2527, "text": "loadrt [KINS]KINEMATICS\nloadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS\nloadrt hal_parport cfg=0x378\nsetp parport.0.reset-time 4000\nloadrt stepgen step_type=0,0,0,0,0 ctrl_type=p,p,p,p,v\n\nloadrt estop_latch\nnet charge-pump <= estop-latch.0.watchdog\n\naddf parport.0.read base-thread\naddf stepgen.make-pulses base-thread\naddf estop-latch.0 base-thread\naddf parport.0.write base-thread\naddf parport.0.reset base-thread\n\naddf stepgen.capture-position servo-thread\naddf motion-command-handler servo-thread\naddf motion-controller servo-thread\naddf stepgen.update-freq servo-thread\nnet spindle-cw <= spindle.0.forward\nnet coolant-flood <= iocontrol.0.coolant-flood\nnet spindle-on spindle.0.on stepgen.4.enable\n\n\n#\n# Spindle gear selection code.\n#\n# emc2 (rpm) => gearchange => stepgen (step & dir) => spindle\n# low gear: 100-2000 rpm, 327 ppr, 10900 Hz => 2000 rpm, 5.450 Hz/rpm\n# high gear: 250-5140 rpm, 127 ppr, 10900 Hz => 5140 rpm, 2.121 Hz/rpm\n# low/high ppr = 327/127 = 2.575\n#\n\nsetp stepgen.4.maxaccel 20000\nsetp stepgen.4.maxvel 2000\nsetp stepgen.4.position-scale 5.450\nnet spindle-pwm stepgen.4.step parport.0.pin-01-out\nsetp stepgen.4.stepspace 0\nsetp stepgen.4.steplen 1\nsetp parport.0.pin-01-out-reset 1\nloadrt or2 count=1\nnet spindle-cw or2.0.in0\nnet spindle-ccw spindle.0.reverse or2.0.in1\n\nloadrt toggle count=1\nloadrt not count=1\nloadrt gearchange count=1\naddf toggle.0 servo-thread\naddf not.0 servo-thread\naddf gearchange.0 servo-thread\nsetp toggle.0.debounce 0\nsetp gearchange.0.min1 100\nsetp gearchange.0.max1 2000\nsetp gearchange.0.min2 250\nsetp gearchange.0.max2 5140\nsetp gearchange.0.scale2 2.575\n# we're not controlling the direction with the gearchanger, so reverse isn't set\n# and the dir-in and dir-out pins aren't linked\nnet spindle-speed-raw spindle.0.speed-out gearchange.0.speed-in\nnet spindle-speed gearchange.0.speed-out stepgen.4.velocity-cmd\n\nnet xdir => parport.0.pin-02-out\nsetp parport.0.pin-03-out-invert 1\nnet xstep => parport.0.pin-03-out\nsetp parport.0.pin-03-out-reset 1\nnet ydir => parport.0.pin-04-out\nsetp parport.0.pin-05-out-invert 1\nnet ystep => parport.0.pin-05-out\nsetp parport.0.pin-05-out-reset 1\nsetp parport.0.pin-06-out-invert 1\nnet zdir => parport.0.pin-06-out\nsetp parport.0.pin-07-out-invert 1\nnet zstep => parport.0.pin-07-out\nsetp parport.0.pin-07-out-reset 1\nnet adir => parport.0.pin-08-out\nsetp parport.0.pin-09-out-invert 1\nnet astep => parport.0.pin-09-out\nsetp parport.0.pin-09-out-reset 1\nnet coolant-flood => parport.0.pin-14-out\nnet spindle-cw => parport.0.pin-16-out\nnet charge-pump => parport.0.pin-17-out\n\nnet both-home-x <= parport.0.pin-10-in\nnet both-home-y <= parport.0.pin-11-in\nnet both-home-z <= parport.0.pin-12-in\nnet home-a <= parport.0.pin-13-in\nnet machine-ok <= parport.0.pin-15-in-not\n\nsetp stepgen.0.position-scale [JOINT_0]SCALE\nsetp stepgen.0.steplen 1\nsetp stepgen.0.stepspace 0\nsetp stepgen.0.dirhold 45000\nsetp stepgen.0.dirsetup 26000\nsetp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL\nnet xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd\nnet xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb\nnet xstep <= stepgen.0.step\nnet xdir <= stepgen.0.dir\nnet xenable joint.0.amp-enable-out => stepgen.0.enable\nnet both-home-x => joint.0.home-sw-in\nnet both-home-x => joint.0.neg-lim-sw-in\nnet both-home-x => joint.0.pos-lim-sw-in\n\nsetp stepgen.1.position-scale [JOINT_1]SCALE\nsetp stepgen.1.steplen 1\nsetp stepgen.1.stepspace 0\nsetp stepgen.1.dirhold 45000\nsetp stepgen.1.dirsetup 26000\nsetp stepgen.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL\nnet ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd\nnet ypos-fb stepgen.1.position-fb => joint.1.motor-pos-fb\nnet ystep <= stepgen.1.step\nnet ydir <= stepgen.1.dir\nnet yenable joint.1.amp-enable-out => stepgen.1.enable\nnet both-home-y => joint.1.home-sw-in\nnet both-home-y => joint.1.neg-lim-sw-in\nnet both-home-y => joint.1.pos-lim-sw-in\n\nsetp stepgen.2.position-scale [JOINT_2]SCALE\nsetp stepgen.2.steplen 1\nsetp stepgen.2.stepspace 0\nsetp stepgen.2.dirhold 45000\nsetp stepgen.2.dirsetup 26000\nsetp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL\nnet zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd\nnet zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb\nnet zstep <= stepgen.2.step\nnet zdir <= stepgen.2.dir\nnet zenable joint.2.amp-enable-out => stepgen.2.enable\nnet both-home-z => joint.2.home-sw-in\nnet both-home-z => joint.2.neg-lim-sw-in\nnet both-home-z => joint.2.pos-lim-sw-in\n\nsetp stepgen.3.position-scale [JOINT_3]SCALE\nsetp stepgen.3.steplen 1\nsetp stepgen.3.stepspace 0\nsetp stepgen.3.dirhold 45000\nsetp stepgen.3.dirsetup 26000\nsetp stepgen.3.maxaccel [JOINT_3]STEPGEN_MAXACCEL\nnet apos-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd\nnet apos-fb stepgen.3.position-fb => joint.3.motor-pos-fb\nnet astep <= stepgen.3.step\nnet adir <= stepgen.3.dir\nnet aenable joint.3.amp-enable-out => stepgen.3.enable\nnet home-a => joint.3.home-sw-in\n\n#linksp xenable estop-latch.0.ok-out\nnet estop-out <= iocontrol.0.user-enable-out\nnet machine-ok => estop-latch.0.ok-in\nnet estop estop-latch.0.ok-out => iocontrol.0.emc-enable-in\nnet estop-reset iocontrol.0.user-request-enable => estop-latch.0.reset\n\nloadusr -W hal_manualtoolchange\nnet tool-change iocontrol.0.tool-change => hal_manualtoolchange.change\nnet tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed\nnet tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number\nnet tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared\n\nnet probe parport.0.pin-13-in-not => motion.probe-input\n"} {"id": "linuxcnc-source:configs/common/configurable_options/pyvcp/xyzjog.xml", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/common/configurable_options/pyvcp/xyzjog.xml", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/common/configurable_options/pyvcp/xyzjog.xml", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "1e7c851f1e8a333075fb45518ecfee935f1bec8ccc70e12f910758e1e2d9a2e8", "bytes": 6585, "tokens": 1623, "text": "\n\n \n RIDGE \n 6\n \n (\"Helvetica\",20)\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n (\"Helvetica\",20)\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"jog-speed\"\n 0\n .5\n \"2.1f\"\n 5\n (\"Arial\",30)\n RIGHT\n 20\n \n \n \n \n \n \n (\"Helvetica\",20)\n\t\t\n \n \n\t\t\n \n \n \n (\"Helvetica\",20)\n \n\t\t\t \n \n \n \n\t \"ostop-is-on\" \n\t\t\t 20 \n\t\t\t \"blue\" \n\t\t\t \"grey\" \n\t\t\t\t\n \n \n\t\t\n \n \n \n (\"Helvetica\",20)\n\t\t\n\t\t \n\t\t\t\n\t\t \n \n \n\t\t\t\n\t\t\t\n\t\t\n \n \n \n\n"} {"id": "linuxcnc-source:configs/sim/axis/db_demo/db_postgui.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/db_demo/db_postgui.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/db_demo/db_postgui.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "af87d1abdd7f2bac828d7a8f675bbd5cbe2b7308fb500c1439299bfff74a51e3", "bytes": 3064, "tokens": 1283, "text": "# display iocontrol tool prepare/change pins\n# and simulate an automatic toolchanger\ndelsig tool:change-loop # remove basic_sim.tcl loops\ndelsig tool:prep-loop # remove basic_sim.tcl loops\n\nloadrt oneshot names=prepare_time,prepare_pulse,change_time,change_pulse\naddf prepare_time servo-thread\naddf prepare_pulse servo-thread\naddf change_time servo-thread\naddf change_pulse servo-thread\n\nsetp prepare_time.width 2.0 # simulate changer\n\nsetp prepare_pulse.width 1 # (resets at tool-change)\nsetp prepare_pulse.rising 0\nsetp prepare_pulse.falling 1\n\nsetp change_time.width 0.5 # simulate changer\n\nsetp change_pulse.width 1 # (resets at tool-prepare)\nsetp change_pulse.rising 0\nsetp change_pulse.falling 1\n\n#==========================================================\n# simulate tool prepare,tool change\nnet db:tool-prepare <= iocontrol.0.tool-prepare\nnet db:tool-prepare => change_pulse.reset\nnet db:tool-prepare => prepare_time.in\nnet db:tool-prepare => pyvcp.tool-prepare\n\nnet db:start_prepare_pulse <= prepare_time.out\nnet db:start_prepare_pulse => prepare_pulse.in\n\nnet db:tool-prepared <= prepare_pulse.out\nnet db:tool-prepared => iocontrol.0.tool-prepared\nnet db:tool-prepared => pyvcp.tool-prepared\n\nnet db:tool-change <= iocontrol.0.tool-change\nnet db:tool-change => prepare_pulse.reset\nnet db:tool-change => change_time.in\nnet db:tool-change => pyvcp.tool-change\n\nnet db:start_change_pulse <= change_time.out\nnet db:start_change_pulse => change_pulse.in\n\nnet db:tool-changed <= change_pulse.out\nnet db:tool-changed => iocontrol.0.tool-changed\nnet db:tool-changed => pyvcp.tool-changed\n\nnet db:tool-number <= iocontrol.0.tool-number\nnet db:tool-number => pyvcp.tool-number\n\nnet db:tool-prep-index <= iocontrol.0.tool-prep-index\nnet db:tool-prep-index => pyvcp.tool-prep-index\n\nnet db:tool-prep-number <= iocontrol.0.tool-prep-number\nnet db:tool-prep-number => pyvcp.tool-prep-number\n\nnet db:tool-prep-pocket <= iocontrol.0.tool-prep-pocket\nnet db:tool-prep-pocket => pyvcp.tool-prep-pocket\n\nnet db:tool-from-pocket <= iocontrol.0.tool-from-pocket\nnet db:tool-from-pocket => pyvcp.tool-from-pocket\n#==========================================================\n# tooloffsets\nnet db:tooloffset.x <= motion.tooloffset.x\nnet db:tooloffset.x => pyvcp.tooloffset.x\n\nnet db:tooloffset.y <= motion.tooloffset.y\nnet db:tooloffset.y => pyvcp.tooloffset.y\n\nnet db:tooloffset.z <= motion.tooloffset.z\nnet db:tooloffset.z => pyvcp.tooloffset.z\n\nnet db:tooloffset.a <= motion.tooloffset.a\nnet db:tooloffset.a => pyvcp.tooloffset.a\n\nnet db:tooloffset.b <= motion.tooloffset.b\nnet db:tooloffset.b => pyvcp.tooloffset.b\n\nnet db:tooloffset.c <= motion.tooloffset.c\nnet db:tooloffset.c => pyvcp.tooloffset.c\n\nnet db:tooloffset.u <= motion.tooloffset.u\nnet db:tooloffset.u => pyvcp.tooloffset.u\n\nnet db:tooloffset.v <= motion.tooloffset.v\nnet db:tooloffset.v => pyvcp.tooloffset.v\n\nnet db:tooloffset.w <= motion.tooloffset.w\nnet db:tooloffset.w => pyvcp.tooloffset.w\n\nnet db:tooldiam <= halui.tool.diameter\nnet db:tooldiam => pyvcp.tooldiam\n"} {"id": "linuxcnc-source:configs/sim/axis/gantry/gantry_panel.xml", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/gantry/gantry_panel.xml", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/gantry/gantry_panel.xml", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "43411a6517eab3695592d248dac59ab371061305e3a1b27894f96eb67718de00", "bytes": 1514, "tokens": 509, "text": "\n\n\n\n \n \n \n\n \n \n \n \"w\"\n \"jj_enable\"\n \"\"\n 0\n \n \n \n \n \n \"jj_scale\"\n 0.01\n 10.0\n 4\n 0.01\n 0.01\n \"5.2f\"\n \n \n \n\n \n \n \"jj_counts\"\n 0.1\n VERTICAL\n 0\n \"1\"\n -100\n 100\n 1\n \n \n \n\n\n \n\n"} {"id": "linuxcnc-source:configs/sim/axis/gladevcp/gladevcp_panel.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/gladevcp/gladevcp_panel.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/gladevcp/gladevcp_panel.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "c216752c2f032d47fe3910f6b66ac6375c8cb1201b6393b2f01b9c978f0708e6", "bytes": 2323, "tokens": 1314, "text": "[EMC]\nVERSION = 1.1\nMACHINE = LinuxCNC-PANEL-GLADEVCP\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\nDEBUG = 0\n\n[DISPLAY]\nGLADEVCP= -u hitcounter.py manual-example.ui\nDISPLAY = axis\nCYCLE_TIME = 0.100\nHELP_FILE = doc/help.txt\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nMAX_FEED_OVERRIDE = 1.2\nMAX_SPINDLE_OVERRIDE = 1.0\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_VELOCITY = .25\nPROGRAM_PREFIX = ../../nc_files/\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n#EDITOR = geany\nTOOL_EDITOR = tooledit\nINCREMENTS = 1 in, 0.1 in, 10 mil, 1 mil, 1mm, .1mm, 1/8000 in\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[RS274NGC]\nPARAMETER_FILE = sim.var\nSUBROUTINE_PATH = ../../nc_files/gladevcp_lib\n\n[EMCMOT]\nEMCMOT = motmod\nCOMM_TIMEOUT = 1.0\nSERVO_PERIOD = 1000000\n\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n\n[HAL]\nHALUI = halui\nHALFILE = LIB:basic_sim.tcl\nPOSTGUI_HALFILE= manual-example.hal\n\n[TRAJ]\nCOORDINATES = X Y Z\nHOME = 0 0 0\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 1.2\nPOSITION_FILE = position.txt\nMAX_LINEAR_VELOCITY = 1.2\nNO_FORCE_HOMING = 1\n\n[EMCIO]\nEMCIO = io\nCYCLE_TIME = 0.100\nTOOL_TABLE = sim.tbl\nTOOL_CHANGE_POSITION = 0 0 0\nTOOL_CHANGE_QUILL_UP = 1\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nHOME = 0.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n[AXIS_Y]\nHOME = 0.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 1\n\n[AXIS_Z]\nHOME = 0.0\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nHOME_OFFSET = 1.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n"} {"id": "linuxcnc-source:configs/sim/axis/gladevcp/gladevcp_panel_tester.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/gladevcp/gladevcp_panel_tester.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/gladevcp/gladevcp_panel_tester.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "e8e88a97002d008d234d664d6f14e866b39c89fc09d2d392fffb80367cb6ed68", "bytes": 2316, "tokens": 1315, "text": "[EMC]\nVERSION = 1.1\nMACHINE = LinuxCNC-PANEL-GLADEVCP\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\nDEBUG = 0\n\n[DISPLAY]\nGLADEVCP= -u test_handler.py test.ui\nDISPLAY = axis\nCYCLE_TIME = 0.100\nHELP_FILE = doc/help.txt\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nMAX_FEED_OVERRIDE = 1.2\nMAX_SPINDLE_OVERRIDE = 1.0\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_VELOCITY = .25\nPROGRAM_PREFIX = ../../nc_files/\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n#EDITOR = geany\nTOOL_EDITOR = tooledit\nINCREMENTS = 1 in, 0.1 in, 10 mil, 1 mil, 1mm, .1mm, 1/8000 in\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[RS274NGC]\nPARAMETER_FILE = sim.var\nSUBROUTINE_PATH = ../../nc_files/gladevcp_lib\n\n[EMCMOT]\nEMCMOT = motmod\nCOMM_TIMEOUT = 1.0\nSERVO_PERIOD = 1000000\n\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n\n[HAL]\nHALUI = halui\nHALFILE = LIB:basic_sim.tcl\n#POSTGUI_HALFILE= manual-example.hal\n\n[TRAJ]\nCOORDINATES = X Y Z\nHOME = 0 0 0\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 1.2\nPOSITION_FILE = position.txt\nMAX_LINEAR_VELOCITY = 1.2\nNO_FORCE_HOMING = 1\n\n[EMCIO]\nEMCIO = io\nCYCLE_TIME = 0.100\nTOOL_TABLE = sim.tbl\nTOOL_CHANGE_POSITION = 0 0 0\nTOOL_CHANGE_QUILL_UP = 1\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nHOME = 0.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n[AXIS_Y]\nHOME = 0.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 1\n\n[AXIS_Z]\nHOME = 0.0\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nHOME_OFFSET = 1.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n"} {"id": "linuxcnc-source:configs/sim/axis/iocontrolv2/owordm6-ui.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/iocontrolv2/owordm6-ui.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/iocontrolv2/owordm6-ui.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "b8de1b4257ef8b8eded585e02e36e3ee6caedad53b3f18f45f94bc9cc0b12b2b", "bytes": 3382, "tokens": 1651, "text": "[EMC]\nVERSION = 1.1\nMACHINE = owordm6-ui\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\nDEBUG = 0\n\n[DISPLAY]\nGLADEVCP= osubdemo.ui\nDISPLAY = axis\nOPEN_FILE= ./toolchange-demo.ngc\nCYCLE_TIME = 0.100\nHELP_FILE = doc/help.txt\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nMAX_FEED_OVERRIDE = 1.2\nMAX_SPINDLE_OVERRIDE = 1.0\nPROGRAM_PREFIX = ../../nc_files/\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n#EDITOR = geany\nINCREMENTS = 1 mm, .01 in, .1mm, 1 mil, .1 mil, 1/8000 in\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[RS274NGC]\nSUBROUTINE_PATH = ../../nc_files/remap_lib/common_nc_subs\n\n# remap T to a named oword subroutine.\n# The tool number will be passed as parameter #1\n# The pocket number will be passed as parameter #2\nT_COMMAND= ocall\n\n# remap M6 to a named oword subroutine.\n# the tool number currently loaded (in spindle) is passed as parameter #1\nM6_COMMAND= ocall\n# to use the M69 iocontrol based toolchange:\n#M6_COMMAND= ocall\n\n# handler gsub called on IoAborts - to cleanup HAL pins etc\nON_ABORT_COMMAND= ocall\n\nLOG_LEVEL = 2\n# File containing interpreter variables\nPARAMETER_FILE = sim_mm.var\n\n[EMCMOT]\nEMCMOT = motmod\nCOMM_TIMEOUT = 1.0\nBASE_PERIOD = 0\nSERVO_PERIOD = 1000000\n\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n\n[HAL]\nHALUI = halui\nHALFILE = core_sim.hal\nHALFILE = simulated_home.hal\n\n[TRAJ]\nCOORDINATES = X Y Z\nLINEAR_UNITS = mm\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 30.48\nMAX_LINEAR_VELOCITY = 53.34\nDEFAULT_LINEAR_ACCELERATION = 508\nMAX_LINEAR_ACCELERATION = 508\nPOSITION_FILE = position_mm.txt\n\n[EMCIO]\n# Name of IO controller program, e.g., io\n\n# explicitly support the start-change protocol.\n# needs to be explicitly enabled for backwards compatibility.\n# NB: if the start-change pin isn't used it needs to be looped like below to\n# start-change-ack or an M6 will hang waiting for start-change-ack:\n# net start-change iocontrol.0.start-change iocontrol.0.start-change-ack\n#EMCIO = iov2 -support-start-change\n\n# starting iov2 like so will create the start-change and start-change-ack pins\n# but the start-change protocol remains disabled - start-change remains low and\n# start-change-ack is ignored:\n\nEMCIO = iov2\n\nCYCLE_TIME = 0.100\nTOOL_TABLE = sim_mm.tbl\nTOOL_CHANGE_POSITION = 0 0 50.8\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -254\nMAX_LIMIT = 254\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\nMIN_LIMIT = -254\nMAX_LIMIT = 254\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 127\nHOME_LATCH_VEL = 25.4\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n[AXIS_Y]\nMIN_LIMIT = -254\nMAX_LIMIT = 254\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\nMIN_LIMIT = -254\nMAX_LIMIT = 254\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 127\nHOME_LATCH_VEL = 25.4\nHOME_SEQUENCE = 1\n\n[AXIS_Z]\nMIN_LIMIT = -50.8\nMAX_LIMIT = 101.6\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 30.48\nMAX_ACCELERATION = 508\nMIN_LIMIT = -50.8\nMAX_LIMIT = 101.6\nHOME_OFFSET = 25.4\nHOME_SEARCH_VEL = 127\nHOME_LATCH_VEL = 25.4\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n"} {"id": "linuxcnc-source:configs/sim/axis/iocontrolv2/v2_oword_gladevcp_postgui.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/iocontrolv2/v2_oword_gladevcp_postgui.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/iocontrolv2/v2_oword_gladevcp_postgui.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "c9ffdf7c0f5022c217a3b9bb4a57970fff08cde6da8dd26d335cff75161f18e4", "bytes": 1153, "tokens": 500, "text": "# unlink because core_sim.hal looped them already\nunlinkp iocontrol.0.tool-change\nunlinkp iocontrol.0.tool-changed\nunlinkp iocontrol.0.tool-prepare\nunlinkp iocontrol.0.tool-prepared\n\n# loop back iocontrol(v2) pins to keep her happy\nnet io-tool-prepare iocontrol.0.tool-prepare iocontrol.0.tool-prepared\nnet io-tool-change iocontrol.0.tool-change iocontrol.0.tool-changed\n\n# Tx pins\nnet tool-prep-number-f motion.analog-out-00 gladevcp.tool-prep-number\n\n\nnet tool-prep-pocket-f motion.analog-out-01 gladevcp.tool-prep-pocket\n\nnet tool-prepare motion.digital-out-00 gladevcp.tool-prepare\nnet tool-prepared gladevcp.tool-prepared motion.digital-in-00\n\n\n# M6 pins\n\nnet tool-number-f motion.analog-out-02 gladevcp.tool-number\nnet tool-change motion.digital-out-01 gladevcp.tool-change\nnet tool-changed gladevcp.tool-changed motion.digital-in-01\n\nnet halui-abort gladevcp.halui-abort halui.abort\n\n\n# fail change\n\n# ??? no pin named gladevcp.fail-change-led\n# net fail-change gladevcp.fail-next-op gladevcp.fail-change-led motion.digital-in-02\nnet fail-change gladevcp.fail-next-op motion.digital-in-02\n\nnet fvalue gladevcp.spinbutton-f motion.analog-in-00\n"} {"id": "linuxcnc-source:configs/sim/axis/ja_tests/xyzb_locking_indexer/xyyzb.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/ja_tests/xyzb_locking_indexer/xyyzb.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/ja_tests/xyzb_locking_indexer/xyyzb.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "466833eb371da18428abeac86d759fe36ed5bff73b60a51c10e5303e39c86316", "bytes": 2849, "tokens": 1535, "text": "[APPLICATIONS]\n# wheel jog simulation:\n# independent joint and axis wheels:\nAPP = sim_pin halui.mode.joint/mode=Pulse \\\n joint.0.jog-counts \\\n joint.1.jog-counts \\\n joint.2.jog-counts \\\n joint.3.jog-counts \\\n joint.4.jog-counts \\\n >/dev/null\nAPP = sim_pin halui.mode.teleop/mode=Pulse \\\n axis.x.jog-counts \\\n axis.y.jog-counts \\\n axis.z.jog-counts \\\n >/dev/null\nAPP = halshow xyzb.halshow\n\n[KINS]\nJOINTS = 5\nKINEMATICS = trivkins coordinates=xyyzb kinstype=both\n\n[HAL]\n HALUI = halui\nHALFILE = LIB:basic_sim.tcl\nHALFILE = LIB:wheeljogpins.tcl 0.1\n\n# simulate a locking rotary joint4\nHALCMD = loadrt timedelay names=timedelay_unlock\nHALCMD = addf timedelay_unlock servo-thread\nHALCMD = net B-unlock joint.4.unlock => timedelay_unlock.in\nHALCMD = net B-is-unlocked timedelay_unlock.out => joint.4.is-unlocked\nHALCMD = setp timedelay_unlock.on-delay 0.75\nHALCMD = setp timedelay_unlock.off-delay 0.5\n\n[EMC]\nVERSION = 1.1\nMACHINE = XYYZB trivkins coordinates=xyyzb KINEMATICS_BOTH\n[DISPLAY]\nDISPLAY = axis\nCYCLE_TIME = 0.100\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nMAX_FEED_OVERRIDE = 1.2\nGEOMETRY = XYZB\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n[RS274NGC]\nPARAMETER_FILE = xyzb.var\n[EMCMOT]\nEMCMOT = motmod unlock_joints_mask=0x10\nCOMM_TIMEOUT = 1.0\nSERVO_PERIOD = 1000000\n[EMCIO]\nEMCIO = io\nCYCLE_TIME = 0.100\n[TRAJ]\nNO_FORCE_HOMING = 1\nCOORDINATES = X Y Y Z B\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 10.0\nDEFAULT_LINEAR_ACCELERATION = 200.0\nDEFAULT_ANGULAR_VELOCITY = 45.0\nMAX_LINEAR_VELOCITY = 10\nMAX_LINEAR_ACCELERATION = 200.0\nMAX_ANGULAR_VELOCITY = 3600.0\n[AXIS_X]\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 10\nMAX_ACCELERATION = 200\n[AXIS_Y]\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 10\nMAX_ACCELERATION = 200\n[AXIS_Z]\nMIN_LIMIT = -2.0\nMAX_LIMIT = 4.0\nMAX_VELOCITY = 10\nMAX_ACCELERATION = 200\n[AXIS_B]\nLOCKING_INDEXER_JOINT = 4\nMAX_ACCELERATION = 200\nMAX_VELOCITY = 3600\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 10\nMAX_ACCELERATION = 200.0\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nHOME_SEARCH_VEL = 0\nHOME_LATCH_VEL = 0\nHOME_SEQUENCE = 0\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 10\nMAX_ACCELERATION = 200.0\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nHOME_SEARCH_VEL = 0\nHOME_LATCH_VEL = 0\nHOME_SEQUENCE = 0\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 10\nMAX_ACCELERATION = 200.0\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nHOME_SEARCH_VEL = 0\nHOME_LATCH_VEL = 0\nHOME_SEQUENCE = 0\n\n[JOINT_3]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 10\nMAX_ACCELERATION = 200.0\nMIN_LIMIT = -2.0\nMAX_LIMIT = 4.0\nHOME_SEARCH_VEL = 0\nHOME_LATCH_VEL = 0\nHOME_SEQUENCE = 0\n\n[JOINT_4]\nTYPE = ANGULAR\nHOME = 0.0\nMAX_VELOCITY = 90.0\nMAX_ACCELERATION = 1200.0\nHOME_SEARCH_VEL = 0\nHOME_LATCH_VEL = 0\nLOCKING_INDEXER = 1\nHOME_SEQUENCE = 0\n"} {"id": "linuxcnc-source:configs/sim/axis/lathe_multispindle/lathe_postgui.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/lathe_multispindle/lathe_postgui.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/lathe_multispindle/lathe_postgui.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "8e298396c54c93faaf6fa15a725d29971ff31a9e573c4f0dad468bf9890014ac", "bytes": 205, "tokens": 102, "text": "net spindle-rpm-filtered.0 => pyvcp.spindle.0.speed\nnet spindle-at-speed.0 => pyvcp.spindle.0.at-speed\nnet spindle-rpm-filtered.1 => pyvcp.spindle.1.speed\nnet spindle-at-speed.1 => pyvcp.spindle.1.at-speed\n"} {"id": "linuxcnc-source:configs/sim/axis/moveoff/1_onpause_local.txt", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/moveoff/1_onpause_local.txt", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/moveoff/1_onpause_local.txt", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "93dce18a58053f9982844b54362c9420de9ee80b7b26bb520adcbfc7f101952c", "bytes": 915, "tokens": 306, "text": "Moveoff demo\n\nMoveoff_gui options:\n\n onpause -- offsets when program paused\n local -- local controls\n\nMoveoff component installed and connected using:\n\n [HAL]HALFILE = LIB:hookup_moveoff.tcl\n\nFor additional info:\n\n man moveoff ------ moveoff component\n man moveoff_gui --- moveoff sample gui\n\n----------------------------------------------------\nDemo usage:\n 1) Start linuxcnc using the 1_onpause_local config.\n 2) Set halscope to ROLL mode.\n 3) (remove ESTOP)\n 4) (turn on machine)\n 5) (home all axes)\n 6) (Run the program)\n 7)

(Pause the program)\n 8) Enable offsets with the Enable Offsets checkbutton.\n 9) Change the x,y,z offsets sliders and observe\n on halscope\n10) Uncheck the Enable Offsets checkbutton to remove\n offsets and allow program resumption.\n11) Repeat steps 6) thru 9) but alter waypoint\n backtracking with the Enable Backtrack checkbutton.\n"} {"id": "linuxcnc-source:configs/sim/axis/moveoff/5_no_gui_es.txt", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/moveoff/5_no_gui_es.txt", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/moveoff/5_no_gui_es.txt", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "283ba76c88eebb7cdec0e4d0ea4400db32ef4a32d28c02fc263da6044e3265ed", "bytes": 999, "tokens": 348, "text": "moveoff no_gui\n\nEsta demostración no proporciona soporte gui, pero muestra varias utilidades de uso general para mostrar el comportamiento de un solo eje (2 => z).\n\nLa utilidad sim_pin se usa para establecer valores de pin que normalmente se conectarían a una gui o se establecerían en valores fijos de acuerdo con la configuración de archivos:\n\nLa utilidad sim_pin se usa para establecer pines para controlar el componente.\n\nUn widget de la aplicación halshow muestra un panel de observación para los pines asociados con el desplazamiento del eje z. Vea el archivo moveoff.hal para las conexiones.\n\nSe inicia una sesión halscope (seleccione 'Roll' para comenzar) para mostrar el comportamiento de las entradas y salidas importantes de moveoff\n\nEstas utilidades pueden mostrarse o deshabilitarse usando la configuración inifile:\n [APPLICATIONS]APP = nombre_programa\n\nNota: Esta es una implementación solo de Hal y las posiciones de offset NO se muestran en la vista previa de la gui Axis.\n"} {"id": "linuxcnc-source:configs/sim/axis/moveoff/removeshort.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/moveoff/removeshort.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/moveoff/removeshort.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "9ece08f0a672c053fb33e0feec791c8a747fb45a997d604240ca7aee338b13b7", "bytes": 2410, "tokens": 981, "text": "# removeshort.hal\n# (for use following core_sim.hal and simulated_home.hal)\n# (this halfile should follow core_sim.hal)\n\n# Demonstrate that hookup_moveoff.tcl works with\n# non-shortcircuit hal configurations (like a servo)\n\n# Also: use sample-hold (mux2) to simulate a system\n# with encoder measuring output when power off too\n\n# remove usual sim signals\ndelsig Xpos\ndelsig Ypos\ndelsig Zpos\n\n# add pid components, and addf in right sequence\nloadrt pid names=xpid,ypid,zpid\naddf xpid.do-pid-calcs servo-thread 3\naddf ypid.do-pid-calcs servo-thread 3\naddf zpid.do-pid-calcs servo-thread 3\n\n# add mux2 for sample-hold on output, and addf in right sequence\n# to simulate system with encoder measuring output\nloadrt mux2 names=xmux,ymux,zmux\naddf xmux servo-thread 6\naddf ymux servo-thread 6\naddf zmux servo-thread 6\n\n# note: pid has default PGain=1, Dgain=Igain=FF0=FF1=FF2=0\nsetp xpid.Pgain 0\nsetp ypid.Pgain 0\nsetp zpid.Pgain 0\n\n# pass thru input to output by using FF0=1\nsetp xpid.FF0 1\nsetp ypid.FF0 1\nsetp zpid.FF0 1\n\n# enable pid in usual manner\nnet xenable joint.0.amp-enable-out => xpid.enable\nnet yenable joint.1.amp-enable-out => ypid.enable\nnet zenable joint.2.amp-enable-out => zpid.enable\n\n# connect without a shortcircuit using pass-thru pid\nnet Xpos-cmd <= joint.0.motor-pos-cmd\nnet Xpos-cmd => xpid.command\n\n# sample-hold\nnet sample <= motion.motion-enabled\nnet sample => xmux.sel\nnet sample => ymux.sel\nnet sample => zmux.sel\n#---------------------------------------\nnet Xonposition <= xpid.output\nnet Xonposition => xmux.in1\n\n# hold position when power off (in0):\nnet Xpos-fb => xmux.in0\n\nnet Xpos-fb <= xmux.out\nnet Xpos-fb => joint.0.motor-pos-fb\nnet Xpos-fb => comp_x.in1\nnet Xpos-fb => ddt_x.in\n#---------------------------------------\nnet Yonposition <= ypid.output\nnet Yonposition => ymux.in1\n\n# hold position when power off (in0):\nnet Ypos-fb => ymux.in0\n\nnet Ypos-fb <= ymux.out\nnet Ypos-cmd <= joint.1.motor-pos-cmd\nnet Ypos-cmd => ypid.command\nnet Ypos-fb => joint.1.motor-pos-fb\nnet Ypos-fb => comp_y.in1\nnet Ypos-fb => ddt_y.in\n#---------------------------------------\nnet Zonposition <= zpid.output\nnet Zonposition => zmux.in1\n\n# hold position when power off (in0):\nnet Zpos-fb => zmux.in0\n\nnet Zpos-fb <= zmux.out\nnet Zpos-cmd <= joint.2.motor-pos-cmd\nnet Zpos-cmd => zpid.command\nnet Zpos-fb => joint.2.motor-pos-fb\nnet Zpos-fb => comp_z.in1\nnet Zpos-fb => ddt_z.in\n"} {"id": "linuxcnc-source:configs/sim/axis/ngcgui/pyngcgui_axis.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/ngcgui/pyngcgui_axis.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/ngcgui/pyngcgui_axis.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "71f8ed201b46c4642e3f7d787065940e5d29b31452a5802056ede460cecd9f52", "bytes": 3874, "tokens": 1877, "text": "[EMC]\nVERSION = 1.1\nMACHINE = pyngcgui-axis demo\nDEBUG = 0\n\n[DISPLAY]\nPROGRAM_PREFIX = ../../nc_files\n\nUSER_COMMAND_FILE = ./fullscreen.py\nEMBED_TAB_NAME = Pyngcgui\nEMBED_TAB_COMMAND = gladevcp -x {XID} pyngcgui_axis.ui\n\nEMBED_TAB_NAME = Gremlinview\nEMBED_TAB_COMMAND = gladevcp -x {XID} gremlin_view.ui\n\nNGCGUI_FONT = Helvetica -12 normal\n\n# for startup NGCGUI_PREAMBLE, NGCGUI_SUBFILE, NGCGUI_POSTAMBLE\n# items, specifly:\n# a) absolute filename (start with /)\n# b) relative filename: search directories specified by\n# [DISPLAY]PROGRAM_PREFIX and [RS274NGC]SUBROUTINE_PATH\n\nNGCGUI_PREAMBLE = in_std.ngc\nNGCGUI_SUBFILE = simp.ngc\nNGCGUI_SUBFILE = db25.ngc\nNGCGUI_SUBFILE = gosper.ngc\nNGCGUI_SUBFILE = xyz.ngc\nNGCGUI_SUBFILE = iquad.ngc\nNGCGUI_SUBFILE = qpocket.ngc\nNGCGUI_SUBFILE = arc2.ngc\nNGCGUI_SUBFILE = ihex.ngc\n# specify \"\" for a custom tab page\nNGCGUI_SUBFILE = \"\"\n\nNGCGUI_OPTIONS =\n#NGCGUI_OPTIONS = opt1 opt2 ...\n# opt items:\n# nonew -- disallow making new tab page\n# noremove -- disallow removing any tab page\n# noauto -- no autosend (makeFile, then manually send)\n# noiframe -- no internal image, image on separate toplevel\n# nom2 -- no m2 terminator (use %)\n\nDISPLAY = axis\nCYCLE_TIME = 0.100\nHELP_FILE = doc/help.txt\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nMAX_FEED_OVERRIDE = 2.0\nMAX_SPINDLE_OVERRIDE = 1.0\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_VELOCITY = .25\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 1\nEDITOR = gedit\n# use tooltable columns for diam and z only:\nTOOL_EDITOR = tooledit diam z\nINCREMENTS = 1 in, 0.1 in, 10 mil, 1 mil, 1mm, .1mm, 1/8000 in\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[RS274NGC]\nPARAMETER_FILE = sim.var\nSUBROUTINE_PATH = ../../nc_files/ngcgui_lib:../../nc_files/ngcgui_lib/utilitysubs\nUSER_M_PATH = ../../nc_files/ngcgui_lib/mfiles\n\n[EMCMOT]\nEMCMOT = motmod\nCOMM_TIMEOUT = 1.0\nBASE_PERIOD = 0\nSERVO_PERIOD = 1000000\n\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n\n[HAL]\nHALUI = halui\nHALFILE = LIB:basic_sim.tcl\n\n[TRAJ]\nCOORDINATES = X Y Z\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 1.2\nMAX_LINEAR_VELOCITY = 1.2\n\n[EMCIO]\nEMCIO = io\nCYCLE_TIME = 0.100\nTOOL_TABLE = sim.tbl\nTOOL_CHANGE_POSITION = 0 0 2\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -400.0\nMAX_LIMIT = 400.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_0]\nTYPE = LINEAR\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -400.0\nMAX_LIMIT = 400.0\nHOME = 0.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n[AXIS_Y]\nMIN_LIMIT = -400.0\nMAX_LIMIT = 400.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_1]\nTYPE = LINEAR\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -400.0\nMAX_LIMIT = 400.0\nHOME = 0.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_SEQUENCE = 1\n\n[AXIS_Z]\nMIN_LIMIT = -800.0\nMAX_LIMIT = 100.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_2]\nTYPE = LINEAR\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -800.0\nMAX_LIMIT = 100.0\nHOME = 0.0\nHOME_OFFSET = 1.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n"} {"id": "linuxcnc-source:configs/sim/axis/orphans/core_sim_test.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/orphans/core_sim_test.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/orphans/core_sim_test.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "b0ace08ef7d3cc047f87a30054835d09718420d00d566f88bf3beb1aa7fba866", "bytes": 1842, "tokens": 757, "text": "# core HAL config file for simulation\n\n# first load all the RT modules that will be needed\n# kinematics\nloadrt [KINS]KINEMATICS\n# motion controller, get name and thread periods from ini file\nloadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS\n# load 6 differentiators (for velocity and accel signals\nloadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv\n# load additional blocks\nloadrt hypot names=vel_xy,vel_xyz\n\n# add motion controller functions to servo thread\naddf motion-command-handler servo-thread\naddf motion-controller servo-thread\n# link the differentiator functions into the code\naddf ddt_x servo-thread\naddf ddt_xv servo-thread\naddf ddt_y servo-thread\naddf ddt_yv servo-thread\naddf ddt_z servo-thread\naddf ddt_zv servo-thread\naddf vel_xy servo-thread\naddf vel_xyz servo-thread\n\n# create HAL signals for position commands from motion module\n# loop position commands back to motion module feedback\nnet Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_x.in\nnet Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_y.in\nnet Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in\n\n# send the position commands thru differentiators to\n# generate velocity and accel signals\nnet Xvel ddt_x.out => ddt_xv.in vel_xy.in0\nnet Xacc <= ddt_xv.out\nnet Yvel ddt_y.out => ddt_yv.in vel_xy.in1\nnet Yacc <= ddt_yv.out\nnet Zvel ddt_z.out => ddt_zv.in vel_xyz.in0\nnet Zacc <= ddt_zv.out\n\n# Cartesian 2- and 3-axis velocities\nnet XYvel vel_xy.out => vel_xyz.in1\nnet XYZvel <= vel_xyz.out\n\n# estop loopback\nnet estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in\n\n# create signals for tool loading loopback\nnet tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared\nnet tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed\n\n#net foo bar\n"} {"id": "linuxcnc-source:configs/sim/axis/orphans/iocontrol-removed/python/embedding.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/orphans/iocontrol-removed/python/embedding.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/orphans/iocontrol-removed/python/embedding.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "bb612334c5ad73f84252ef043743276508d039e77f2ac69d76e5f54b91afcd8b", "bytes": 2594, "tokens": 943, "text": "# This is a component of LinuxCNC\n# Copyright 2011, 2013 Dewey Garrett , Michael\n# Haberler \n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n#\n# a tour of accessing interpreter internals\n\ndef call_stack(self,*args):\n print(\"------- interpreter call stack: \")\n for i in range(self.call_level):\n s = self.sub_context[i]\n print(\"%d: position=%d sequence_number=%d filename=%s subname=%s context_status=%x\" % (i, s.position, s.sequence_number,s.filename,s.subname,s.context_status), end=\" \")\n print(\"named_params=\",s.named_params)\n\ndef remap_stack(self, *args):\n print(\"------- interpreter remap stack: \")\n for i in range(self.remap_level):\n r = self.blocks[i].executing_remap\n print(\"%d: name=%s argspec=%s prolog_func=%s ngc=%s py=%s epilog=%s modal_group=%d\" % (r.name,r.argspec,r.prolog_func,r.ngc,r.epilog_func,r.modal_group))\n\ndef tooltable(self, *args):\n print(\"------- tool table:\")\n for i in range(len(self.tool_table)):\n t = self.tool_table[i]\n if t.toolno != -1: print(str(t))\n print(\"tool in spindle=%d pocketPrepped=%d\" % (self.current_tool,self.selected_pocket))\n\n\ndef show_block(self,*args):\n if len(args) > 0:\n n = int(args[0])\n else:\n n = 0\n b = self.blocks[n]\n print(\"-- blocks[%d]\" % (n))\n print(\"line_number=%d o_name=%s p_flag=%d p_number%g q_flag=%d q_number=%g comment=%s\" % (b.line_number,b.o_name,b.p_flag,b.p_number,b.q_flag,b.q_number,b.comment))\n\n\ndef show(self,*args):\n print(\"dir(interpreter)=\",dir(self))\n tooltable(self)\n show_block(self,0)\n if self.remap_level: show_block(self,self.remap_level)\n call_stack(self)\n remap_stack(self)\n print(\"active G-codes:\",self.active_g_codes)\n print(\"active M-codes:\",self.active_m_codes)\n print(\"active settings:\",self.active_settings)\n print(\"parameters:\",self.parameters)\n"} {"id": "linuxcnc-source:configs/sim/axis/qtvcp/qtvismach_tab.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/qtvcp/qtvismach_tab.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/qtvcp/qtvismach_tab.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "5e610fd07b44d291422378996f098fa27e4dc075e3f3fb49ad6267471b426206", "bytes": 2406, "tokens": 1384, "text": "[EMC]\nVERSION = 1.1\nMACHINE = LinuxCNC-TAB-GLADEVCP\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\nDEBUG = 0\n\n[DISPLAY]\n# Embed tabs\nEMBED_TAB_NAME= qtscreen\nEMBED_TAB_COMMAND= halcmd loadusr -Wn qtvcp_embed qtvcp -d -c qtvcp_embed -x {XID} vismach_mill_xyz\nDISPLAY = axis\nCYCLE_TIME = 0.100\nHELP_FILE = doc/help.txt\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nMAX_FEED_OVERRIDE = 1.2\nMAX_SPINDLE_OVERRIDE = 1.0\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_VELOCITY = .25\nPROGRAM_PREFIX = ../../nc_files/\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n#EDITOR = geany\nTOOL_EDITOR = tooledit\nINCREMENTS = 1 in, 0.1 in, 10 mil, 1 mil, 1mm, .1mm, 1/8000 in\n\n[MDI_COMMAND_LIST]\nMDI_COMMAND = G10 L20 P0 X0Y0\nMDI_COMMAND = G0x0y0z0\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[RS274NGC]\nPARAMETER_FILE = sim.var\n\n[EMCMOT]\nEMCMOT = motmod\nCOMM_TIMEOUT = 1.0\nSERVO_PERIOD = 1000000\n\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n\n[HAL]\nHALUI = halui\nHALFILE = LIB:basic_sim.tcl\n\n[TRAJ]\nCOORDINATES = X Y Z\nHOME = 0 0 0\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 1.2\nPOSITION_FILE = position.txt\nMAX_LINEAR_VELOCITY = 1.2\nNO_FORCE_HOMING = 1\n\n[EMCIO]\nEMCIO = io\nCYCLE_TIME = 0.100\nTOOL_TABLE = sim.tbl\nTOOL_CHANGE_POSITION = 0 0 0\nTOOL_CHANGE_QUILL_UP = 1\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nHOME = 0.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n[AXIS_Y]\nHOME = 0.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 1\n\n[AXIS_Z]\nHOME = 0.0\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nHOME_OFFSET = 1.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n"} {"id": "linuxcnc-source:configs/sim/axis/remap/extend-builtins/nc_subroutines/change.ngc", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/remap/extend-builtins/nc_subroutines/change.ngc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/remap/extend-builtins/nc_subroutines/change.ngc", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "f31cade1e71a8bb3fb768bf8b3dc1f3d437f94025e404929295cb5be9bb9753d", "bytes": 314, "tokens": 118, "text": "o sub\n(debug, in change tool_in_spindle=# current_pocket=#)\n(debug, selected_tool=# selected_pocket=#)\n; using the code being remapped here means 'use builtin behaviour'\nM6\n; signal success be returning a value > 0:\no endsub [1]\nm2\n"} {"id": "linuxcnc-source:configs/sim/axis/remap/extend-builtins/nc_subroutines/setspeed.ngc", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/remap/extend-builtins/nc_subroutines/setspeed.ngc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/remap/extend-builtins/nc_subroutines/setspeed.ngc", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "feeb1976c9be9d78263206b009a2bceb28648b9066f9e4ff43bb6ac8073d5ad1", "bytes": 199, "tokens": 68, "text": "o sub\n(debug, in setspeed speed=#)\n; using the code being remapped here means 'use builtin behaviour'\nS#\n; signal success be returning a value > 0:\no endsub [1]\nm2\n"} {"id": "linuxcnc-source:configs/sim/axis/remap/rack-toolchange/nc_subroutines/on_abort.ngc", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/remap/rack-toolchange/nc_subroutines/on_abort.ngc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/remap/rack-toolchange/nc_subroutines/on_abort.ngc", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "42f7aefa2db005c2714baf3ebbd1c579141a785d481da0113ad41179463f3797", "bytes": 219, "tokens": 98, "text": "; if aborted during a toolchange, disable pins\n\no sub\n\n(print, on_abort executing)\nM65 P #<_ini[pins]lock> ; drop lock pin\nM65 P #<_ini[pins]flush> ; drop flush pin\n\no call\n\no endsub\nm2\n"} {"id": "linuxcnc-source:configs/sim/axis/remap/rack-toolchange/racktoolchange.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/remap/rack-toolchange/racktoolchange.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/remap/rack-toolchange/racktoolchange.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "edf2f401d6c23500a6dd71ab715f1902c3f4b4b7d31c77f87902336650e77af6", "bytes": 168, "tokens": 68, "text": "# in case they were linked already\nunlinkp iocontrol.0.tool-change\nunlinkp iocontrol.0.tool-changed\n\nnet tool-change iocontrol.0.tool-change iocontrol.0.tool-changed\n"} {"id": "linuxcnc-source:configs/sim/axis/simtcl/twopass_basic.txt", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/simtcl/twopass_basic.txt", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/simtcl/twopass_basic.txt", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "053a1d452f0f496650068e1f6b266e28b8926b15970dc1a0fa2bfb577d90149d", "bytes": 73, "tokens": 25, "text": "twopass_basic -- demonstrates twopass processing using LIB:basic_sim.tcl\n"} {"id": "linuxcnc-source:configs/sim/axis/vismach/5axis/bridgemill/5axis.xml", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/vismach/5axis/bridgemill/5axis.xml", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/vismach/5axis/bridgemill/5axis.xml", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "e50b4898e89796b5b711f827efe798519983cbabc4f8bee4ba98fe01d2d61473", "bytes": 2793, "tokens": 1106, "text": "\n\n\n \n \"ridge\"\n 5\n \n \n [\" 0:BRIDGE \", \"1:IDENTITY\", \" 2:USERK \"]\n (\"DejaVu Sans Mono\",16)\n \"black\"\n \"yellow\"\n \n \n \n \n \n\n \n \n (\"Helvetica\",14)\n \n \n \n \"joint0\"\n (\"Helvetica\",14)\n \"4.4f\"\n \n \n \n \n \n \"joint1\"\n (\"Helvetica\",14)\n \"4.4f\"\n \n \n \n \n \n \"joint2\"\n (\"Helvetica\",14)\n \"4.4f\"\n \n \n \n \n \n \"joint3\"\n (\"Helvetica\",14)\n \"4.4f\"\n \n \n \n \n \n \"joint4\"\n (\"Helvetica\",14)\n \"4.4f\"\n \n \n \n \n \n \"joint5\"\n (\"Helvetica\",14)\n \"4.4f\"\n \n \n \n \n \n \"joint6\"\n (\"Helvetica\",14)\n \"4.4f\"\n \n \n \n \n\n \n \"ridge\"\n 5\n \n \n\n\n"} {"id": "linuxcnc-source:configs/sim/axis/vismach/melfa-sim/remap_subs/429remap.ngc", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/vismach/melfa-sim/remap_subs/429remap.ngc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/vismach/melfa-sim/remap_subs/429remap.ngc", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "608afc1f094ffa9e69010d20551a26b583c35a6284656c60d7a524254b01bdf4", "bytes": 771, "tokens": 334, "text": ";M429 by remap: select identity kins\no<429remap>sub\n # = 3 ; set N as required: motion.analog-out-0N\n # = 1 ; identity kins\n\no1 if [exists [#<_hal[motion.switchkins-type]>]]\no1 else\n (debug,M429:Missing [RS274NGC]FEATURE==8)\n (debug,STOP)\n M2\no1 endif\n\n M66 E0 L0 ; force synch\n M68 E# Q# ; set kinstype value\n G10 L2 P8 X0 Y-90 Z0 A0 B90 C0\n G59.2\n M66 E0 L0 ; force synch\n; (debug, M429:identity kins)\n\no2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE 1]]\n (debug,M429:Wrong motion.switchkins-type)\n (debug,or missing hal net to analog-out-0x)\n (debug,STOP)\n M2\no2 else\no2 endif\n\no<429remap>endsub\n"} {"id": "linuxcnc-source:configs/sim/axis/vismach/puma/puma560_postgui.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/vismach/puma/puma560_postgui.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/vismach/puma/puma560_postgui.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "a5db7c206ab77f08907f333e4a53f777ce76abf7aeabda58988651a106132909", "bytes": 1184, "tokens": 547, "text": "#note pumagui joint numbers are 1-based:\nnet :j0 <= joint.0.pos-fb => pyvcp.joint0 => puma560gui.joint1\nnet :j1 <= joint.1.pos-fb => pyvcp.joint1 => puma560gui.joint2\nnet :j2 <= joint.2.pos-fb => pyvcp.joint2 => puma560gui.joint3\nnet :j3 <= joint.3.pos-fb => pyvcp.joint3 => puma560gui.joint4\nnet :j4 <= joint.4.pos-fb => pyvcp.joint4 => puma560gui.joint5\nnet :j5 <= joint.5.pos-fb => pyvcp.joint5 => puma560gui.joint6\n\nnet :kinstype.is-0 <= kinstype.is-0 => pyvcp.multilabel.0.legend0\nnet :kinstype.is-1 <= kinstype.is-1 => pyvcp.multilabel.0.legend1\nnet :kinstype.is-2 <= kinstype.is-2 => pyvcp.multilabel.0.legend2\n\nnet :vismach-clear <= pyvcp.vismach-clear => vismach.plotclear\n\n# mdi-commands 00,01,02 do not alter limits when switching:\n#net :type0-button <= pyvcp.type0-button => halui.mdi-command-00\n#net :type1-button <= pyvcp.type1-button => halui.mdi-command-01\n#net :type2-button <= pyvcp.type2-button => halui.mdi-command-02\n\n# mdi-commands 03,04,05 alter limits when switching:\nnet :type0-button <= pyvcp.type0-button => halui.mdi-command-03\nnet :type1-button <= pyvcp.type1-button => halui.mdi-command-04\nnet :type2-button <= pyvcp.type2-button => halui.mdi-command-05\n"} {"id": "linuxcnc-source:configs/sim/axis/xhc-hb04/xhc-hb04-layout1.txt", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/axis/xhc-hb04/xhc-hb04-layout1.txt", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/axis/xhc-hb04/xhc-hb04-layout1.txt", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "13a6f376828ce0f303851d5b77a9e6e0c051b53ab1fed9d15b03a97a2cffed62", "bytes": 1452, "tokens": 420, "text": "xhc-hb04-layout1\n\n16 buttons:\n\n---------------------------------------\n|RESET | |\n---------------------------------------\n|Stop |Start/Pause|Rewind |Probe-Z |\n---------------------------------------\n|GotoZero| X2 | Y2 |Safe-Z |\n---------------------------------------\n| X=0 | Y=0 | Z=0 | Home |\n---------------------------------------\n|STEP | Mode |Spindle| |\n---------------------------------------\n| Off |\n| X |\n| Y |\n| Rotary -------> Z |\n| Switch A |\n| Spindle |\n| Feed |\n---------------------------------------\n\nButton codes defined in LIB:xhc-hb04-layout1.cfg\n\nThe Start/Pause button can be connected for standard behavior with:\n [XHC_HB04_BUTTON]start-pause = std_start_pause\n\nThe STEP button is normally connected with:\n [XHC_HB04_BUTTON]step = xhc-hb04.stepsize-up\n\nThe other buttons can be connected to hal pins -- typically halui provided pins.\n\nMDI commands can be executed using halui.mdi-command-nn pins defined in the ini file with entries like: [HALUI]MDI_COMMAND = mdi_command \n\nThe rotary switch selects the axis, spindle.0, or feedoverride for control by the jogwheel.\n\nThe switch positions (xyza) can be defined to any available axis (xyzc for instance).\n"} {"id": "linuxcnc-source:configs/sim/gmoccapy/7_axis_tool.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/gmoccapy/7_axis_tool.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/gmoccapy/7_axis_tool.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "6f48447e4576d82a57742dc94babcecf2e813a2afbe398acfcfd87d05c99f229", "bytes": 3180, "tokens": 1722, "text": "[EMC]\nVERSION = 1.1\nMACHINE = gmoccapy_9_axis\n DEBUG = 0\n\n[DISPLAY]\nDISPLAY = gmoccapy\nCYCLE_TIME = 150\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nPROGRAM_PREFIX = ../../nc_files/\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 1\nGEOMETRY = XYZABCUVW\n\n# Values that will be allowed for override, 1.0 = 100%\nMAX_FEED_OVERRIDE = 1.5\nMAX_SPINDLE_OVERRIDE = 1.2\nMIN_SPINDLE_OVERRIDE = 0.5\n\nDEFAULT_SPINDLE_SPEED = 500\n\n# list of selectable jog increments\nINCREMENTS = 1.000 mm, 0.100 mm, 0.010 mm, 0.001 mm ,1.2345 in\n\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n\n[RS274NGC]\nRS274NGC_STARTUP_CODE = G17 G21 G40 G43H0 G54 G64P0.005 G80 G90 G94 G97 M5 M9\nPARAMETER_FILE = sim.var\nSUBROUTINE_PATH = macros\n\n[EMCMOT]\nEMCMOT = motmod\nCOMM_TIMEOUT = 1.0\nSERVO_PERIOD = 1000000\n\n[EMCIO]\nEMCIO = io\nCYCLE_TIME = 0.150\nTOOL_TABLE = tool.tbl\nTOOL_CHANGE_POSITION = 0 0 2\n\n[HAL]\nHALUI = halui\nHALFILE = core_sim_7.hal\n#HALFILE = simulated_home_9.hal\n\n[TRAJ]\nCOORDINATES = X Y Z A B C U\nLINEAR_UNITS = mm\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 50.0\nDEFAULT_LINEAR_ACCEL = 500.0\nDEFAULT_ANGULAR_VELOCITY = 45.0\nMAX_LINEAR_VELOCITY = 200.0\nMAX_LINEAR_ACCEL = 250.0\nMAX_ANGULAR_VELOCITY = 90.0\n\n[KINS]\nKINEMATICS = trivkins coordinates=XYZABCU\nJOINTS = 7\n\n[AXIS_X]\nMIN_LIMIT = -250.0\nMAX_LIMIT = 250.0\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\n\n[AXIS_Y]\nMIN_LIMIT = -250.0\nMAX_LIMIT = 250.0\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\n\n[AXIS_Z]\nMIN_LIMIT = -50.0\nMAX_LIMIT = 100.0\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\n\n[AXIS_A]\nMIN_LIMIT = -360.0\nMAX_LIMIT = 360.0\nMAX_VELOCITY = 90.0\nMAX_ACCELERATION = 1200.0\n\n[AXIS_B]\nMIN_LIMIT = -360.0\nMAX_LIMIT = 360.0\nMAX_VELOCITY = 90.0\nMAX_ACCELERATION = 1200.0\n\n[AXIS_C]\nMIN_LIMIT = -360.0\nMAX_LIMIT = 360.0\nMAX_VELOCITY = 90.0\nMAX_ACCELERATION = 1200.0\n\n[AXIS_U]\nMIN_LIMIT = -50.0\nMAX_LIMIT = 100.0\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\n\n[JOINT_0]\nTYPE = LINEAR\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\nMIN_LIMIT = -250.0\nMAX_LIMIT = 250.0\nHOME_SEQUENCE = 0\n\n[JOINT_1]\nTYPE = LINEAR\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\nMIN_LIMIT = -250.0\nMAX_LIMIT = 250.0\nHOME_SEQUENCE = 0\n\n[JOINT_2]\nTYPE = LINEAR\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\nMIN_LIMIT = -50.0\nMAX_LIMIT = 100.0\nHOME_SEQUENCE = 0\n\n[JOINT_3]\nTYPE = ANGULAR\nMAX_VELOCITY = 90.0\nMAX_ACCELERATION = 1200.0\nHOME_SEQUENCE = 0\n\n[JOINT_4]\nTYPE = ANGULAR\nMAX_VELOCITY = 90.0\nMAX_ACCELERATION = 1200.0\nHOME_SEQUENCE = 0\n\n[JOINT_5]\nTYPE = ANGULAR\nMAX_VELOCITY = 90.0\nMAX_ACCELERATION = 1200.0\nHOME_SEQUENCE = 0\n\n[JOINT_6]\nTYPE = LINEAR\nMAX_VELOCITY = 100\nMAX_ACCELERATION = 1250\nMIN_LIMIT = -250.0\nMAX_LIMIT = 250.0\nHOME_SEQUENCE = 0\n\n# section for main IO controller parameters -----------------------------------\n[TOOLSENSOR]\nX = 10\nY = 10 \nZ = -20\n# abort change if no toolsensor contact after this probe distance\nMAXPROBE = -20\n\n# this is not named TOOL_CHANGE_POSITION on purpose - canon uses it and will\n# interfere\n[CHANGE_POSITION]\nX = 10\nY = 10\nZ = -2\n"} {"id": "linuxcnc-source:configs/sim/gmoccapy/non_trivial_kinematics/scara/scara_postgui.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/gmoccapy/non_trivial_kinematics/scara/scara_postgui.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/gmoccapy/non_trivial_kinematics/scara/scara_postgui.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "69db8232c9384cffcaec0b07f7616d439e4a63bd23daa9d48f7f24a2c8afa66d", "bytes": 124, "tokens": 64, "text": "net j0 scara.hal_meter_j0\nnet j1 scara.hal_meter_j1\nnet j2 scara.hal_meter_j2\nnet j3 scara.hal_meter_j3\n\nsource postgui.hal\n"} {"id": "linuxcnc-source:configs/sim/gmoccapy/plasma_config/plasma.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/gmoccapy/plasma_config/plasma.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/gmoccapy/plasma_config/plasma.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "d9b1a16cb260f017f39472cd2bd4ed1136156d7c25df183892999fdf65cf3068", "bytes": 15837, "tokens": 5537, "text": "#!/usr/bin/env python3\n# -*- coding:UTF-8 -*-\n\"\"\"\n This file will control some options of the gmoccapy plasma screen\n and demonstrates at the same time the possibilities you have introducing\n your own handler files and functions to that screen, showing the\n possibilities to modify the layout and behavior\n\n Copyright 2013 Norbert Schechner\n nieson@web.de\n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 2 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program; if not, write to the Free Software\n Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n\"\"\"\n\nimport hal_glib # needed to make our own hal pins\nimport hal # needed to make our own hal pins\nfrom gladevcp.persistence import IniFile # we use this one to save the states of the widgets on shut down and restart\nfrom gladevcp.persistence import widget_defaults\nfrom gladevcp.persistence import select_widgets\nimport gtk\nfrom gmoccapy import preferences\nfrom gmoccapy import getiniinfo\n\nclass PlasmaClass:\n\n def __init__(self, halcomp, builder, useropts):\n self.builder = builder\n self.halcomp = halcomp\n self.defaults = { IniFile.vars : { \"thcspeedval\" : 15.0 ,\n \"thcspeedmax\" : 20.0 ,\n \"thcspeedmin\" : 1.0 ,\n \"thcspeedincr\" : 1.0 ,\n\n \"cutgapval\" : 4.0 ,\n \"cutgapmax\" : 10.0 ,\n \"cutgapmin\" : 0.1 ,\n \"cutgapincr\" : 0.1 ,\n\n \"g0gapval\" : 45.0 ,\n \"g0gapmax\" : 55.0 ,\n \"g0gapmin\" : 0.5 ,\n \"g0gapincr\" : 0.5 ,\n\n \"pierceutostart\" : True ,\n\n \"piercegapval\" : 5.0 ,\n \"piercegapmax\" : 12.0 ,\n \"piercegapmin\" : 2.0 ,\n \"piercegapincr\" : 0.5 ,\n\n \"piercedelayval\" : 0.5 ,\n \"piercedelaymax\" : 10.0 ,\n \"piercedelaymin\" : 0.01 ,\n \"piercedelayincr\" : 0.01 ,\n\n \"enableheightlock\" : False,\n\n \"chlthresholdval\" : 60.0 ,\n \"chlthresholdmax\" : 100.0,\n \"chlthresholdmin\" : 10.0 ,\n \"chlthresholdincr\" : 10.0 ,\n\n \"thctargetvoltval\" : 100.0,\n \"thctargetvoltmax\" : 255.0,\n \"thctargetvoltmin\" : 55.0 ,\n \"thctargetvoltincr\" : 5.0 ,\n },\n IniFile.widgets: widget_defaults(select_widgets([self.builder.get_object(\"hal-btn-THC\"),\n ], hal_only = True, output_only = True)),\n }\n\n get_ini_info = getiniinfo.GetIniInfo()\n prefs = preferences.preferences(get_ini_info.get_preference_file_path())\n theme_name = prefs.getpref(\"gtk_theme\", \"Follow System Theme\", str)\n if theme_name == \"Follow System Theme\":\n theme_name = gtk.settings_get_default().get_property(\"gtk-theme-name\")\n gtk.settings_get_default().set_string_property(\"gtk-theme-name\", theme_name, \"\")\n\n self.ini_filename = __name__ + \".var\"\n self.ini = IniFile(self.ini_filename, self.defaults, self.builder)\n self.ini.restore_state(self)\n\n # lets make our pins\n self.THC_speed = hal_glib.GPin(halcomp.newpin(\"THC-Speed\", hal.HAL_FLOAT, hal.HAL_OUT))\n self.cut_gap = hal_glib.GPin(halcomp.newpin(\"Cut-Gap\", hal.HAL_FLOAT, hal.HAL_OUT))\n self.g0_gap = hal_glib.GPin(halcomp.newpin(\"G0-Gap\", hal.HAL_FLOAT, hal.HAL_OUT))\n self.pierce_deley = hal_glib.GPin(halcomp.newpin(\"Pierce-Delay\", hal.HAL_FLOAT, hal.HAL_OUT))\n self.pierce_gap = hal_glib.GPin(halcomp.newpin(\"Pierce-Gap\", hal.HAL_FLOAT, hal.HAL_OUT))\n self.target_voltage = hal_glib.GPin(halcomp.newpin(\"Target-Voltage\", hal.HAL_FLOAT, hal.HAL_OUT))\n\n # get all widgets and connect them\n self.lbl_prog_volt = self.builder.get_object(\"lbl_prog_volt\")\n self.lbl_cut_speed = self.builder.get_object(\"lbl_cut_speed\")\n self.lbl_cut_gap = self.builder.get_object(\"lbl_cut_gap\")\n self.lbl_g0_gap = self.builder.get_object(\"lbl_g0_gap\")\n self.lbl_pierce_gap = self.builder.get_object(\"lbl_pierce_gap\")\n self.lbl_pierce_delay = self.builder.get_object(\"lbl_pierce_delay\")\n\n self.btn_THC_speed_minus = self.builder.get_object(\"btn_THC_speed_minus\")\n self.btn_THC_speed_minus.connect(\"pressed\", self.on_btn_THC_speed_pressed, -1)\n\n self.btn_THC_speed_plus = self.builder.get_object(\"btn_THC_speed_plus\")\n self.btn_THC_speed_plus.connect(\"pressed\", self.on_btn_THC_speed_pressed, 1)\n\n self.adj_THC_speed = self.builder.get_object(\"adj_THC_speed\")\n self.adj_THC_speed.connect(\"value_changed\", self.on_adj_THC_speed_value_changed)\n\n self.adj_THC_speed.upper = self.thcspeedmax\n self.adj_THC_speed.lower = self.thcspeedmin\n self.adj_THC_speed.set_value(self.thcspeedval)\n\n self.tbl_cutting = self.builder.get_object(\"tbl_cutting\")\n self.tbl_cutting.connect(\"destroy\", self._on_destroy)\n\n self.btn_cut_gap_minus = self.builder.get_object(\"btn_cut_gap_minus\")\n self.btn_cut_gap_minus.connect(\"pressed\", self.on_btn_cut_gap_pressed, -1)\n\n self.btn_cut_gap_plus = self.builder.get_object(\"btn_cut_gap_plus\")\n self.btn_cut_gap_plus.connect(\"pressed\", self.on_btn_cut_gap_pressed, 1)\n\n self.adj_cut_gap = self.builder.get_object(\"adj_cut_gap\")\n self.adj_cut_gap.connect(\"value_changed\", self.on_adj_cut_gap_value_changed)\n self.adj_cut_gap.upper = self.cutgapmax\n self.adj_cut_gap.lower = self.cutgapmin\n self.adj_cut_gap.set_value(self.cutgapval)\n\n self.btn_g0_minus = self.builder.get_object(\"btn_g0_minus\")\n self.btn_g0_minus.connect(\"pressed\", self.on_btn_g0_pressed, -1)\n\n self.btn_g0_plus = self.builder.get_object(\"btn_g0_plus\")\n self.btn_g0_plus.connect(\"pressed\", self.on_btn_g0_pressed, 1)\n\n self.adj_G0_gap = self.builder.get_object(\"adj_G0_gap\")\n self.adj_G0_gap.connect(\"value_changed\", self.on_adj_G0_gap_value_changed)\n self.adj_G0_gap.upper = self.g0gapmax\n self.adj_G0_gap.lower = self.g0gapmin\n self.adj_G0_gap.set_value(self.g0gapval)\n\n self.Piercing_autostart = self.builder.get_object(\"Piercing-autostart\")\n self.Piercing_autostart.connect(\"toggled\", self.on_Piercing_autostart_toggled)\n self.Piercing_autostart.set_active(self.pierceutostart)\n\n self.btn_pierce_gap_minus = self.builder.get_object(\"btn_pierce_gap_minus\")\n self.btn_pierce_gap_minus.connect(\"pressed\", self.on_btn_pierce_gap_pressed, -1)\n\n self.btn_pierce_gap_plus = self.builder.get_object(\"btn_pierce_gap_plus\")\n self.btn_pierce_gap_plus.connect(\"pressed\", self.on_btn_pierce_gap_pressed, 1)\n\n self.adj_pierce_gap = self.builder.get_object(\"adj_pierce_gap\")\n self.adj_pierce_gap.connect(\"value_changed\", self.on_adj_pierce_gap_value_changed)\n self.adj_pierce_gap.upper = self.piercegapmax\n self.adj_pierce_gap.lower = self.piercegapmin\n self.adj_pierce_gap.set_value(self.piercegapval)\n\n self.btn_pierce_delay_minus = self.builder.get_object(\"btn_pierce_delay_minus\")\n self.btn_pierce_delay_minus.connect(\"pressed\", self.on_btn_pierce_delay_pressed, -1)\n\n self.btn_pierce_delay_plus = self.builder.get_object(\"btn_pierce_delay_plus\")\n self.btn_pierce_delay_plus.connect(\"pressed\", self.on_btn_pierce_delay_pressed, 1)\n\n self.adj_pierce_delay = self.builder.get_object(\"adj_pierce_delay\")\n self.adj_pierce_delay.connect(\"value_changed\", self.on_adj_pierce_delay_value_changed)\n self.adj_pierce_delay.upper = self.piercedelaymax\n self.adj_pierce_delay.lower = self.piercedelaymin\n self.adj_pierce_delay.set_value(self.piercedelayval)\n\n self.enable_HeightLock = self.builder.get_object(\"enable-HeightLock\")\n self.enable_HeightLock.connect(\"toggled\", self.on_enable_HeightLock_toggled)\n self.enable_HeightLock.set_active(self.enableheightlock)\n\n self.adj_CHL_threshold = self.builder.get_object(\"adj_CHL_threshold\")\n self.adj_CHL_threshold.connect(\"value_changed\", self.on_adj_CHL_threshold_value_changed)\n self.adj_CHL_threshold.upper = self.chlthresholdmax\n self.adj_CHL_threshold.lower = self.chlthresholdmin\n self.adj_CHL_threshold.set_value(self.chlthresholdval)\n\n self.btn_THC_target_minus = self.builder.get_object(\"btn_THC_target_minus\")\n self.btn_THC_target_minus.connect(\"pressed\", self.on_btn_THC_target_pressed, -1)\n\n self.btn_THC_target_plus = self.builder.get_object(\"btn_THC_target_plus\")\n self.btn_THC_target_plus.connect(\"pressed\", self.on_btn_THC_target_pressed, 1)\n\n self.adj_THC_Voltage = self.builder.get_object(\"adj_THC_Voltage\")\n self.adj_THC_Voltage.connect(\"value_changed\", self.on_adj_THC_Voltage_value_changed)\n self.adj_THC_Voltage.upper = self.thctargetvoltmax\n self.adj_THC_Voltage.lower = self.thctargetvoltmin\n self.adj_THC_Voltage.set_value(self.thctargetvoltval)\n\n def _on_destroy(self, obj, data = None):\n self.ini.save_state(self)\n\n # What to do on button press events?\n def on_btn_THC_speed_pressed(self, widget, dir):\n increment = self.thcspeedincr * dir\n self.thcspeedval = self.adj_THC_speed.get_value() + increment\n self.adj_THC_speed.set_value(self.thcspeedval)\n\n def on_btn_cut_gap_pressed(self, widget, dir):\n increment = self.cutgapincr * dir\n self.cutgapval = self.adj_cut_gap.get_value() + increment\n self.adj_cut_gap.set_value(self.cutgapval)\n\n def on_btn_g0_pressed(self, widget, dir):\n increment = self.g0gapincr * dir\n self.g0gapval = self.adj_G0_gap.get_value() + increment\n self.adj_G0_gap.set_value(self.g0gapval)\n\n def on_btn_pierce_gap_pressed(self, widget, dir):\n increment = self.piercegapincr * dir\n self.piercegapval = self.adj_pierce_gap.get_value() + increment\n self.adj_pierce_gap.set_value(self.piercegapval)\n\n def on_btn_pierce_delay_pressed(self, widget, dir):\n increment = self.piercedelayincr * dir\n self.piercedelayval = self.adj_pierce_delay.get_value() + increment\n self.adj_pierce_delay.set_value(self.piercedelayval)\n\n def on_btn_THC_target_pressed(self, widget, dir):\n increment = self.thctargetvoltincr * dir\n self.thctargetvoltval = self.adj_THC_Voltage.get_value() + increment\n self.adj_THC_Voltage.set_value(self.thctargetvoltval)\n\n # and the behavior of the adjustments to control max and min values\n def on_adj_THC_speed_value_changed(self, widget, data = None):\n if widget.get_value() >= widget.upper:\n self.btn_THC_speed_plus.set_sensitive(False)\n elif widget.get_value() <= widget.lower:\n self.btn_THC_speed_minus.set_sensitive(False)\n else:\n self.btn_THC_speed_plus.set_sensitive(True)\n self.btn_THC_speed_minus.set_sensitive(True)\n self.halcomp[\"THC-Speed\"] = widget.get_value()\n self.lbl_cut_speed.set_label(\"%.1f\" % (widget.get_value()))\n\n def on_adj_cut_gap_value_changed(self, widget, data = None):\n if widget.get_value() >= widget.upper:\n self.btn_cut_gap_plus.set_sensitive(False)\n elif widget.get_value() <= widget.lower:\n self.btn_cut_gap_minus.set_sensitive(False)\n else:\n self.btn_cut_gap_plus.set_sensitive(True)\n self.btn_cut_gap_minus.set_sensitive(True)\n self.halcomp[\"Cut-Gap\"] = widget.get_value()\n self.lbl_cut_gap.set_label(\"%.3f\" % (widget.get_value()))\n\n def on_adj_G0_gap_value_changed(self, widget, data = None):\n if widget.get_value() >= widget.upper:\n self.btn_g0_plus.set_sensitive(False)\n elif widget.get_value() <= widget.lower:\n self.btn_g0_minus.set_sensitive(False)\n else:\n self.btn_g0_plus.set_sensitive(True)\n self.btn_g0_minus.set_sensitive(True)\n self.halcomp[\"G0-Gap\"] = widget.get_value()\n self.lbl_g0_gap.set_label(\"%.3f\" % (widget.get_value()))\n\n def on_adj_pierce_gap_value_changed(self, widget, data = None):\n if widget.get_value() >= widget.upper:\n self.btn_pierce_gap_plus.set_sensitive(False)\n elif widget.get_value() <= widget.lower:\n self.btn_pierce_gap_minus.set_sensitive(False)\n else:\n self.btn_pierce_gap_plus.set_sensitive(True)\n self.btn_pierce_gap_minus.set_sensitive(True)\n self.halcomp[\"Pierce-Gap\"] = widget.get_value()\n self.lbl_pierce_gap.set_label(\"%.3f\" % (widget.get_value()))\n\n def on_adj_pierce_delay_value_changed(self, widget, data = None):\n if widget.get_value() >= widget.upper:\n self.btn_pierce_delay_plus.set_sensitive(False)\n elif widget.get_value() <= widget.lower:\n self.btn_pierce_delay_minus.set_sensitive(False)\n else:\n self.btn_pierce_delay_plus.set_sensitive(True)\n self.btn_pierce_delay_minus.set_sensitive(True)\n self.halcomp[\"Pierce-Delay\"] = widget.get_value()\n self.lbl_pierce_delay.set_label(\"%.2f\" % (widget.get_value()))\n\n def on_adj_CHL_threshold_value_changed(self, widget, data = None):\n self.chlthresholdval = widget.get_value()\n\n def on_adj_THC_Voltage_value_changed(self, widget, data = None):\n if widget.get_value() >= widget.upper:\n self.btn_THC_target_plus.set_sensitive(False)\n elif widget.get_value() <= widget.lower:\n self.btn_THC_target_minus.set_sensitive(False)\n else:\n self.btn_THC_target_plus.set_sensitive(True)\n self.btn_THC_target_minus.set_sensitive(True)\n self.halcomp[\"Target-Voltage\"] = widget.get_value()\n self.lbl_prog_volt.set_label(\"%d\" % (widget.get_value()))\n\n def on_Piercing_autostart_toggled(self, widget, data = None):\n self.pierceutostart = widget.get_active()\n\n def on_enable_HeightLock_toggled(self, widget, data = None):\n self.enableheightlock = widget.get_active()\n\ndef get_handlers(halcomp, builder, useropts):\n return[PlasmaClass(halcomp, builder, useropts)]\n"} {"id": "linuxcnc-source:configs/sim/gscreen/gscreen_custom/gscreen_gaxis.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/gscreen/gscreen_custom/gscreen_gaxis.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/gscreen/gscreen_custom/gscreen_gaxis.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "8b37aef313551ab9dcd3a414d582b399669dfb4375d08fe5ee709bf327c53d43", "bytes": 5546, "tokens": 2062, "text": "# EMC controller parameters for a simulated machine.\n\n# General note: Comments can either be preceded with a # or ; - either is\n# acceptable, although # is in keeping with most linux config files.\n\n# General section -------------------------------------------------------------\n[EMC]\n# Version of this INI file\nVERSION = 1.1\n\n# Name of machine, for use with display, etc.\nMACHINE = Linuxcnc-Gscreen_gaxis\n\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\n#DEBUG = 0x7FFFFFFF\nDEBUG = 0\n\n# Sections for display options ------------------------------------------------\n[DISPLAY]\n\n\n# -c sets the glade and handler file to load -d is to display extra debug messages\nDISPLAY = gscreen -c gaxis -c\n\n# Cycle time, in milliseconds, that display will sleep between polls\nCYCLE_TIME = 100\n\n# Highest / lowest value that will be allowed for overrides, 1.0 = 100%\nMAX_FEED_OVERRIDE = 2.0\nMIN_SPINDLE_OVERRIDE = .5\nMAX_SPINDLE_OVERRIDE = 1.0\n\n# Max and default jog speeds in units per second\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_VELOCITY = .25\n\n# Prefix to be used\nPROGRAM_PREFIX = ../../nc_files/\n\n# Introductory graphic\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\n\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n# Task controller section -----------------------------------------------------\n[RS274NGC]\n\n# File containing interpreter variables\nPARAMETER_FILE = sim.var\n\n# Motion control section ------------------------------------------------------\n[EMCMOT]\n\nEMCMOT = motmod\n\n# Timeout for comm to emcmot, in seconds\nCOMM_TIMEOUT = 1.0\n\n# BASE_PERIOD is unused in this configuration but specified in core_sim.hal\nBASE_PERIOD = 0\n# Servo task period, in nano-seconds\nSERVO_PERIOD = 1000000\n\n# Hardware Abstraction Layer section --------------------------------------------------\n[TASK]\n\n# Name of task controller program, e.g., milltask\nTASK = milltask\n\n# Cycle time, in seconds, that task controller will sleep between polls\nCYCLE_TIME = 0.001\n\n# Part program interpreter section --------------------------------------------\n[HAL]\n\n# The run script first uses halcmd to execute any HALFILE\n# files, and then to execute any individual HALCMD commands.\n#\n\n# list of hal config files to run through halcmd\n# files are executed in the order in which they appear\nHALFILE = core_sim.hal\nHALFILE = sim_spindle_encoder.hal\nHALFILE = axis_manualtoolchange.hal\nHALFILE = simulated_home.hal\n\n# list of halcmd commands to execute\n# commands are executed in the order in which they appear\n\n\n# Single file that is executed after the GUI has started.\nPOSTGUI_HALFILE = gaxis_postgui.hal\n\nHALUI = halui\n\n# Trajectory planner section --------------------------------------------------\n[HALUI]\n#No Content\n\n[TRAJ]\nCOORDINATES = X Y Z\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 1.2\nMAX_LINEAR_VELOCITY = 2.4\nPOSITION_FILE = position.txt\n\n# Axes sections ---------------------------------------------------------------\n\n# First axis\n[EMCIO]\n\n# Name of IO controller program, e.g., io\nEMCIO = \t\tio\n\n# cycle time, in seconds\nCYCLE_TIME = 0.100\n\n# tool table file\nTOOL_TABLE = sim.tbl\nTOOL_CHANGE_POSITION = 0 0 0\nTOOL_CHANGE_QUILL_UP = 1\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nBACKLASH = 0.000\nINPUT_SCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n# Second axis\n[AXIS_Y]\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nBACKLASH = 0.000\nINPUT_SCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 1\n\n# Third axis\n[AXIS_Z]\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nBACKLASH = 0.000\nINPUT_SCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -8.0\nMAX_LIMIT = 0.0001\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 1.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n\n# section for main IO controller parameters -----------------------------------\n"} {"id": "linuxcnc-source:configs/sim/gscreen/industrial_lathe_wear/lathe_postgui.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/gscreen/industrial_lathe_wear/lathe_postgui.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/gscreen/industrial_lathe_wear/lathe_postgui.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "42635f5a9b67b72db8f2e83b3e0318dd8887d930add4fa2059ecb80654444623", "bytes": 100, "tokens": 39, "text": "net spindle-speed-limited gscreen.spindle-readout-in\nnet spindle-at-speed gscreen.spindle-at-speed\n"} {"id": "linuxcnc-source:configs/sim/gscreen/ngcgui/pyngcgui_gscreen_popupkeyboard.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/gscreen/ngcgui/pyngcgui_gscreen_popupkeyboard.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/gscreen/ngcgui/pyngcgui_gscreen_popupkeyboard.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "d6fd8d018be34826fb7bccdad4987a8968dbfdf7a2b5794b75c809c56a18ad63", "bytes": 4701, "tokens": 2187, "text": "[EMC]\nVERSION = 1.1\nMACHINE = pyngcgui-gscreen demo (popupkeyboard)\nDEBUG = 0\n\n[DISPLAY]\nDISPLAY = gscreen\n\nEMBED_TAB_NAME = Pyngcgui\nEMBED_TAB_LOCATION = notebook_main\nEMBED_TAB_COMMAND = gladevcp -x {XID} pyngcgui_popupkeyboard.ui\n\nEMBED_TAB_NAME = Gremlinview\nEMBED_TAB_LOCATION = notebook_main\nEMBED_TAB_COMMAND = gladevcp -x {XID} gremlin_view.ui\n\n#NGCGUI_OPTIONS = opt1 opt2 ...\n# opt items:\n# nonew -- disallow making new tab page\n# noremove -- disallow removing any tab page\n# noauto -- no autosend (makeFile, then manually send)\n# noiframe -- no internal image, image on separate toplevel\n# nom2 -- no m2 terminator (use %)\nNGCGUI_PREAMBLE = in_std.ngc\nNGCGUI_SUBFILE = simp.ngc\nNGCGUI_SUBFILE = db25.ngc\nNGCGUI_SUBFILE = gosper.ngc\nNGCGUI_SUBFILE = xyz.ngc\nNGCGUI_SUBFILE = ihex.ngc\nNGCGUI_SUBFILE = slot.ngc\nNGCGUI_SUBFILE = arc2.ngc\nNGCGUI_SUBFILE = iquad.ngc\nNGCGUI_SUBFILE = qpocket.ngc\nNGCGUI_SUBFILE = \"\"\n\nCYCLE_TIME = 300\nMAX_SPINDLE_OVERRIDE = 2.0\nMIN_SPINDLE_OVERRIDE = .5\nMAX_FEED_OVERRIDE = 2.0\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_VELOCITY = .5\nINCREMENTS = 1 in, 0.1 in, 10 mil, 1 mil, 1mm, .1mm, 1/8000 in\n\n# set up 3 user popup message dialogs\nMESSAGE_BOLDTEXT = NONE\nMESSAGE_TEXT = This is a statusbar test\nMESSAGE_TYPE = status\nMESSAGE_PINNAME = statustest\n\nMESSAGE_BOLDTEXT = NONE\nMESSAGE_TEXT = This is a yes no dialog test\nMESSAGE_TYPE = yesnodialog\nMESSAGE_PINNAME = yndialogtest\n\nMESSAGE_BOLDTEXT = This is the short text\nMESSAGE_TEXT = This is the longer text of the both type test. It can be longer then the status bar text\nMESSAGE_TYPE = okdialog status\nMESSAGE_PINNAME = bothtest\n\nPROGRAM_PREFIX = ../../nc_files/\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\nTOOL_EDITOR = tooledit\n\n[FILTER]\nPROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image\nPROGRAM_EXTENSION = .py Python Script\n\npng = image-to-gcode\ngif = image-to-gcode\njpg = image-to-gcode\npy = python3\n\n[RS274NGC]\nSUBROUTINE_PATH = ../../nc_files/ngcgui_lib:../../nc_files/ngcgui_lib/utilitysubs\nUSER_M_PATH = ../../nc_files/ngcgui_lib/mfiles\n\nPARAMETER_FILE = sim.var\n\n[EMCMOT]\nEMCMOT = motmod\nCOMM_TIMEOUT = 1.0\nBASE_PERIOD = 0\nSERVO_PERIOD = 1000000\n\n[TASK]\nTASK = milltask\nCYCLE_TIME = 0.001\n\n[HAL]\nHALUI = halui\nHALFILE = LIB:basic_sim.tcl\n\n[TRAJ]\nCOORDINATES = X Y Z\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 1.2\nMAX_LINEAR_VELOCITY = 2.4\nPOSITION_FILE = position.txt\n\n[EMCIO]\nEMCIO = \t\tio\nCYCLE_TIME = 0.100\n\nTOOL_TABLE = sim.tbl\nTOOL_CHANGE_POSITION = 0 0 0\nTOOL_CHANGE_QUILL_UP = 1\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[AXIS_X]\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nBACKLASH = 0.000\nINPUT_SCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 1\nHOME_IS_SHARED = 1\n\n[AXIS_Y]\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nBACKLASH = 0.000\nINPUT_SCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -40.0\nMAX_LIMIT = 40.0\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 1\n\n[AXIS_Z]\nMIN_LIMIT = -8.0\nMAX_LIMIT = 10.0001\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 4\nMAX_ACCELERATION = 100.0\nBACKLASH = 0.000\nINPUT_SCALE = 4000\nOUTPUT_SCALE = 1.000\nMIN_LIMIT = -8.0\nMAX_LIMIT = 10.0001\nFERROR = 0.050\nMIN_FERROR = 0.010\nHOME_OFFSET = 1.0\nHOME_SEARCH_VEL = 20.0\nHOME_LATCH_VEL = 20.0\nHOME_USE_INDEX = NO\nHOME_IGNORE_LIMITS = NO\nHOME_SEQUENCE = 0\nHOME_IS_SHARED = 1\n"} {"id": "linuxcnc-source:configs/sim/qtdragon/qtdragon_xyz45/core_sim_XYZAC.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/qtdragon/qtdragon_xyz45/core_sim_XYZAC.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/qtdragon/qtdragon_xyz45/core_sim_XYZAC.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "f292b7245fe5a1da22666f618fa7e07032268d5919fb4a8d9ba175dfc635c505", "bytes": 2398, "tokens": 1023, "text": "# core HAL config file for simulation\n\n# first load all the RT modules that will be needed\n# kinematics\nloadrt [KINS]KINEMATICS\n#autoconverted trivkins\n# motion controller, get name and thread periods from ini file\nloadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS\n# load 6 differentiators (for velocity and accel signals\nloadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv\n# load additional blocks\nloadrt hypot names=vel_xy,vel_xyz\n\n# add motion controller functions to servo thread\naddf motion-command-handler servo-thread\naddf motion-controller servo-thread\n# link the differentiator functions into the code\naddf ddt_x servo-thread\naddf ddt_xv servo-thread\naddf ddt_y servo-thread\naddf ddt_yv servo-thread\naddf ddt_z servo-thread\naddf ddt_zv servo-thread\naddf vel_xy servo-thread\naddf vel_xyz servo-thread\n\n# create HAL signals for position commands from motion module\n# loop position commands back to motion module feedback\nnet Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in\nnet Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in\nnet Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in\nnet Apos joint.3.motor-pos-cmd => joint.3.motor-pos-fb\nnet Cpos joint.4.motor-pos-cmd => joint.4.motor-pos-fb\n#net Cpos joint.5.motor-pos-cmd => joint.5.motor-pos-fb\n#net Upos joint.6.motor-pos-cmd => joint.6.motor-pos-fb\n#net Vpos joint.7.motor-pos-cmd => joint.7.motor-pos-fb\n#net Wpos joint.8.motor-pos-cmd => joint.8.motor-pos-fb\n\n# send the position commands thru differentiators to\n# generate velocity and accel signals\nnet Xvel ddt_x.out => ddt_xv.in vel_xy.in0\nnet Xacc <= ddt_xv.out\nnet Yvel ddt_y.out => ddt_yv.in vel_xy.in1\nnet Yacc <= ddt_yv.out\nnet Zvel ddt_z.out => ddt_zv.in vel_xyz.in0\nnet Zacc <= ddt_zv.out\n\n# Cartesian 2- and 3-axis velocities\nnet XYvel vel_xy.out => vel_xyz.in1\nnet XYZvel <= vel_xyz.out\n\n# estop loopback\nnet estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in\n\n# create signals for tool loading loopback\nnet tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared\nnet tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed\n\nnet spindle-fwd spindle.0.forward\nnet spindle-rev spindle.0.reverse\n#net spindle-speed spindle.0.speed-out\n\nnet lube iocontrol.0.lube\nnet flood iocontrol.0.coolant-flood\nnet mist iocontrol.0.coolant-mist\n"} {"id": "linuxcnc-source:configs/sim/qtdragon_hd/qtdragon_hd_z_compensation/probe_points.txt", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/qtdragon_hd/qtdragon_hd_z_compensation/probe_points.txt", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/qtdragon_hd/qtdragon_hd_z_compensation/probe_points.txt", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "54ebb6d39a58de46edf61029af39c5bfc43bace0cc8030d4fcd8b6d75c12f666", "bytes": 2097, "tokens": 990, "text": "-50.000000 -50.000000 -0.032200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-25.000000 -50.000000 -0.008866 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n0.000000 -50.000000 0.011133 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n25.000000 -50.000000 0.037800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n50.000000 -50.000000 0.041133 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-50.000000 -25.000000 -0.028867 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-25.000000 -25.000000 -0.002200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n0.000000 -25.000000 0.024467 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n25.000000 -25.000000 0.054467 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n50.000000 -25.000000 0.044467 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-50.000000 0.000000 -0.045533 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-25.000000 0.000000 -0.012200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-0.000000 0.000000 0.021133 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n25.000000 0.000000 0.044467 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n50.000000 0.000000 0.034467 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-50.000000 25.000000 -0.055533 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-25.000000 25.000000 -0.025533 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n0.000000 25.000000 0.007800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n25.000000 25.000000 0.034467 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n50.000000 25.000000 0.041134 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-50.000000 50.000000 -0.068867 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n-25.000000 50.000000 -0.038866 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n0.000000 50.000000 -0.008866 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n25.000000 50.000000 0.027800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n50.000000 50.000000 0.031133 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n"} {"id": "linuxcnc-source:configs/sim/qtplasmac/qtplasmac_s_imperial.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/qtplasmac/qtplasmac_s_imperial.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/qtplasmac/qtplasmac_s_imperial.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "00694329d1f037d0f7a51a246b04d1743b9b4ba2983acf1edddd88fd9161d48f", "bytes": 528, "tokens": 248, "text": "[DISPLAY]\nDISPLAY = qtvcp qtplasmac_4x3\nPOSITION_OFFSET = RELATIVE\nPOSITION_FEEDBACK = ACTUAL\nMAX_FEED_OVERRIDE = 1.5\nDEFAULT_LINEAR_VELOCITY = 4.0\nMIN_LINEAR_VELOCITY = 1\nMAX_LINEAR_VELOCITY = 13.8\nINCREMENTS = 1, .1, .01, .001, .0001\nMDI_HISTORY_FILE = imperial_mdi_history.txt\nTOOL_EDITOR = tooledit x y\nPROGRAM_PREFIX = ../../nc_files\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n\n#INCLUDE qtplasmac_imperial_ini.inc\n"} {"id": "linuxcnc-source:configs/sim/tklinuxcnc/tklinuxcnc.ini", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/tklinuxcnc/tklinuxcnc.ini", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/tklinuxcnc/tklinuxcnc.ini", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "12f9c72fe2f8ab1ac7d6fcb553c902b4a2df1cecbf3ecc896fa9c0ad7a8f41b3", "bytes": 3780, "tokens": 1541, "text": "# EMC controller parameters for a simulated machine.\n\n# General note: Comments can either be preceded with a # or ; - either is\n# acceptable, although # is in keeping with most linux config files.\n\n# General section -------------------------------------------------------------\n[EMC]\n# Version of this INI file\nVERSION = 1.1\n\n# Name of machine, for use with display, etc.\nMACHINE = LinuxCNC-HAL-SIM-TkLinuxCNC\n\n# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others\nDEBUG = 0\n\n# Sections for display options ------------------------------------------------\n[DISPLAY]\n\nDISPLAY = tklinuxcnc\n\n# Cycle time, in seconds, that display will sleep between polls\nCYCLE_TIME = 0.100\n\n# Path to help file\nHELP_FILE = tklinuxcnc.txt\n\n# Initial display setting for position, RELATIVE or MACHINE\nPOSITION_OFFSET = RELATIVE\n\n# Initial display setting for position, COMMANDED or ACTUAL\nPOSITION_FEEDBACK = ACTUAL\n\n# Highest value that will be allowed for feed override, 1.0 = 100%\nMAX_FEED_OVERRIDE = 1.2\n\n# Lowest value that will be allowed for spindle speed override, 1.0 = 100%\nMIN_SPINDLE_OVERRIDE = 0.5\n\n# Highest value that will be allowed for spindle speed override, 1.0 = 100%\nMAX_SPINDLE_OVERRIDE = 1.5\n\n# Prefix to be used\nPROGRAM_PREFIX = ../../nc_files/\n\n# Introductory graphic\nINTRO_GRAPHIC = linuxcnc.gif\nINTRO_TIME = 5\n\n# Part program interpreter section --------------------------------------------\n[RS274NGC]\n# File containing interpreter variables\nPARAMETER_FILE = sim.var\n\n[EMCMOT]\nEMCMOT = motmod\n\n# Timeout for comm to emcmot, in seconds\nCOMM_TIMEOUT = 1.0\n\n# BASE_PERIOD is unused in this configuration but specified in core_sim.hal\nBASE_PERIOD = 0\n# Servo task period, in nano-seconds\nSERVO_PERIOD = 1000000\n\n# section for main IO controller parameters -----------------------------------\n[EMCIO]\n\n# Name of IO controller program, e.g., io\nEMCIO = io\n\n# cycle time, in seconds\nCYCLE_TIME = 0.100\n\n# tool table file\nTOOL_TABLE = sim.tbl\n\n[KINS]\nKINEMATICS = trivkins\nJOINTS = 3\n\n[TASK]\n\n# Name of task controller program, e.g., milltask\nTASK = milltask\n\n# Cycle time, in seconds, that task controller will sleep between polls\nCYCLE_TIME = 0.010\n\n# Hardware Abstraction Layer section --------------------------------------------------\n[HAL]\n# The run script first uses halcmd to execute any HALFILE\n# files, and then to execute any individual HALCMD commands.\n#\n\n# list of hal config files to run through halcmd\n# files are executed in the order in which they appear\nHALFILE = core_sim.hal\n\n# list of halcmd commands to execute\n# commands are executed in the order in which they appear\n#HALCMD = save neta\n\n# Trajectory planner section --------------------------------------------------\n[TRAJ]\nCOORDINATES = X Y Z\nLINEAR_UNITS = inch\nANGULAR_UNITS = degree\nDEFAULT_LINEAR_VELOCITY = 0.0167\nMAX_LINEAR_VELOCITY = 1.2\nDEFAULT_LINEAR_ACCELERATION = 20.0\nMAX_LINEAR_ACCELERATION = 20.0\n\n# Axes sections ---------------------------------------------------------------\n[AXIS_X]\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\n\n[JOINT_0]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\n\n[AXIS_Y]\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\n\n[JOINT_1]\nTYPE = LINEAR\nHOME = 0.000\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\nMIN_LIMIT = -10.0\nMAX_LIMIT = 10.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\n\n[AXIS_Z]\nMIN_LIMIT = -2.0\nMAX_LIMIT = 4.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\n\n[JOINT_2]\nTYPE = LINEAR\nHOME = 0.0\nMAX_VELOCITY = 1.2\nMAX_ACCELERATION = 20.0\nMIN_LIMIT = -2.0\nMAX_LIMIT = 4.0\nHOME_OFFSET = 0.0\nHOME_SEARCH_VEL = 0.0\nHOME_LATCH_VEL = 0.0\n"} {"id": "linuxcnc-source:configs/sim/woodpecker/core_sim.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/woodpecker/core_sim.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/woodpecker/core_sim.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "54fe4002d5db8db0d8e365b63b747602f34ec955c372023df9c848f3529e10a2", "bytes": 1846, "tokens": 756, "text": "# core HAL config file for simulation\n\n# first load all the RT modules that will be needed\n# kinematics\nloadrt [KINS]KINEMATICS\n# motion controller, get name and thread periods from ini file\nloadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_aio=13\n# load 6 differentiators (for velocity and accel signals\nloadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv\n# load additional blocks\nloadrt hypot names=vel_xy,vel_xyz\n\n# add motion controller functions to servo thread\naddf motion-command-handler servo-thread\naddf motion-controller servo-thread\n# link the differentiator functions into the code\naddf ddt_x servo-thread\naddf ddt_xv servo-thread\naddf ddt_y servo-thread\naddf ddt_yv servo-thread\naddf ddt_z servo-thread\naddf ddt_zv servo-thread\naddf vel_xy servo-thread\naddf vel_xyz servo-thread\n\n# create HAL signals for position commands from motion module\n# loop position commands back to motion module feedback\nnet Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in\nnet Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in\nnet Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in\n\n# send the position commands thru differentiators to\n# generate velocity and accel signals\nnet Xvel ddt_x.out => ddt_xv.in vel_xy.in0\nnet Xacc <= ddt_xv.out\nnet Yvel ddt_y.out => ddt_yv.in vel_xy.in1\nnet Yacc <= ddt_yv.out\nnet Zvel ddt_z.out => ddt_zv.in vel_xyz.in0\nnet Zacc <= ddt_zv.out\n\n# Cartesian 2- and 3-axis velocities\nnet XYvel vel_xy.out => vel_xyz.in1\nnet XYZvel <= vel_xyz.out\n\n# estop loopback\nnet estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in\n\n# create signals for tool loading loopback\nnet tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared\nnet tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed\n"} {"id": "linuxcnc-source:configs/sim/woodpecker/python/toplevel.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "configs/sim/woodpecker/python/toplevel.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/configs/sim/woodpecker/python/toplevel.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "7dfdbf0cbe04515b0e67c2a23a3d9946c13b10a25b008c3a7150912160004ff9", "bytes": 780, "tokens": 234, "text": "# This is a component of LinuxCNC\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n#\nimport remap\n"} {"id": "linuxcnc-source:lib/hallib/locking_indexer.hal", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/hallib/locking_indexer.hal", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/hallib/locking_indexer.hal", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "f36fa2e9b06729498e415e0eb6dd1d73dcca3e55d4b8b3f8b9c1aff3f3114d2e", "bytes": 299, "tokens": 131, "text": "# simulate a locking rotary axis B\n\nloadrt timedelay names=timedelay_unlock\naddf timedelay_unlock servo-thread\n\nnet B-unlock joint.4.unlock => timedelay_unlock.in\nnet B-is-unlocked timedelay_unlock.out => joint.4.is-unlocked\n\nsetp timedelay_unlock.on-delay 0.75\nsetp timedelay_unlock.off-delay 0.5\n"} {"id": "linuxcnc-source:lib/python/gladevcp/combi_dro.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/gladevcp/combi_dro.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/gladevcp/combi_dro.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "b6417345d81aa65f5ba4fc30f816232dc0b606dd4dacc323c27f9b4fb910220c", "bytes": 30278, "tokens": 9524, "text": "#!/usr/bin/env python3\n\n# GladeVcp Widget - DRO widget, showing all 3 reference types\n# This widgets displays linuxcnc axis position information.\n#\n# Copyright (c) 2013 Norbert Schechner\n# Based on the drowidget from Chris Morley\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n\n\nimport gi\ngi.require_version(\"Gtk\",\"3.0\")\ngi.require_version(\"Gdk\",\"3.0\")\nfrom gi.repository import Gtk\nfrom gi.repository import Gdk\nfrom gi.repository import GObject\nfrom gi.repository import Pango\nfrom gi.repository import GLib\nimport os\nimport sys\nimport math\nimport linuxcnc\nfrom hal_glib import GStat\nimport re\n\n# constants\n_INCH = 0\n_MM = 1\n_AXISLETTERS = [\"X\", \"Y\", \"Z\", \"A\", \"B\", \"C\", \"U\", \"V\", \"W\"]\n\n\n# we put this in a try so there is no error in the glade editor\n# linuxcnc is probably not running then\ntry:\n INIPATH = os.environ['INI_FILE_NAME']\nexcept:\n# INIPATH = '/home/emcmesa/linuxcnc-dev/configs/sim/gmoccapy/gmoccapy.ini'\n pass\n\n# This is the main class\nclass Combi_DRO(Gtk.Box):\n '''\n Combi_DRO will display an linuxcnc DRO with all three types at ones\n\n Combi_DRO = Combi_DRO(joint_number)\n joint_number is an integer in the range from 0 to 8\n where 0 = X, 1 = Y, 2 = Z, etc.\n '''\n\n __gtype_name__ = 'Combi_DRO'\n __gproperties__ = {\n 'joint_number' : (GObject.TYPE_INT, 'Joint Number', '0:X 1:Y 2:Z etc',\n 0, 8, 0, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'actual' : (GObject.TYPE_BOOLEAN, 'Actual Position', 'Display Actual or Commanded Position',\n True, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'metric_units' : (GObject.TYPE_BOOLEAN, 'Display in metric units', 'Display in metric or not',\n True, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'auto_units' : (GObject.TYPE_BOOLEAN, 'Change units according gcode', 'Units will toggle between metric and imperial according to gcode.',\n True, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'diameter' : (GObject.TYPE_BOOLEAN, 'Diameter Adjustment', 'Display Position As Diameter',\n False, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'mm_text_template' : (GObject.TYPE_STRING, 'Text template for Metric Units',\n 'Text template to display. Python formatting may be used for one variable',\n \"%10.3f\", GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'imperial_text_template' : (GObject.TYPE_STRING, 'Text template for Imperial Units',\n 'Text template to display. Python formatting may be used for one variable',\n \"%9.4f\", GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'homed_color' : (Gdk.RGBA.__gtype__, 'homed color', 'Sets the color of the display when the axis is homed',\n GObject.ParamFlags.READWRITE),\n 'unhomed_color' : (Gdk.RGBA.__gtype__, 'unhomed color', 'Sets the color of the display when the axis is not homed',\n GObject.ParamFlags.READWRITE),\n 'abs_color' : (Gdk.RGBA.__gtype__, 'Absolute color', 'Sets the color of the display when absolute coordinates are used',\n GObject.ParamFlags.READWRITE),\n 'rel_color' : (Gdk.RGBA.__gtype__, 'Relative color', 'Sets the color of the display when relative coordinates are used',\n GObject.ParamFlags.READWRITE),\n 'dtg_color' : (Gdk.RGBA.__gtype__, 'DTG color', 'Sets the color of the display when dtg coordinates are used',\n GObject.ParamFlags.READWRITE),\n 'font_size' : (GObject.TYPE_INT, 'Font Size', 'The font size of the big numbers, the small ones will be 2.5 times smaller',\n 8, 96, 25, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'toggle_readout' : (GObject.TYPE_BOOLEAN, 'Enable toggling readout with click', 'The DRO will toggle between Absolute, Relative and DTG with each mouse click.',\n True, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n 'cycle_time' : (GObject.TYPE_INT, 'Cycle Time', 'Time, in milliseconds, that display will sleep between polls',\n 100, 1000, 150, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT),\n }\n __gproperties = __gproperties__\n\n __gsignals__ = {\n 'clicked': (GObject.SignalFlags.RUN_FIRST, GObject.TYPE_NONE, (GObject.TYPE_STRING, GObject.TYPE_PYOBJECT)),\n 'units_changed': (GObject.SignalFlags.RUN_FIRST, GObject.TYPE_NONE, (GObject.TYPE_BOOLEAN,)),\n 'system_changed': (GObject.SignalFlags.RUN_FIRST, GObject.TYPE_NONE, (GObject.TYPE_STRING,)),\n 'axis_clicked': (GObject.SignalFlags.RUN_FIRST, GObject.TYPE_NONE, (GObject.TYPE_STRING,)),\n 'exit': (GObject.SignalFlags.RUN_FIRST, GObject.TYPE_NONE, ()),\n }\n\n # Init the class\n def __init__(self, joint_number = 0):\n super(Combi_DRO, self).__init__()\n self.set_orientation(Gtk.Orientation.VERTICAL)\n\n # we have to distinguish this, as we use the joints number to check homing\n # and we do need the axis to check for the positions\n # this is needed if non trivial kinematics are used or just a lathe,\n # as the lathe has only two joints, but Z will be the third value in position feedback\n self.axis_no = self.joint_number = joint_number\n\n # get the necessary connections to linuxcnc\n self.linuxcnc = linuxcnc\n self.status = linuxcnc.stat()\n self.gstat = GStat()\n # set some default values'\n self._ORDER = [\"Rel\", \"Abs\", \"DTG\"]\n self.system = \"Rel\"\n self.homed = False\n self.homed_color = \"#00FF00\"\n self.unhomed_color = \"#FF0000\"\n self.abs_color = \"#0000FF\"\n self.rel_color = \"#000000\"\n self.dtg_color = \"#FFFF00\"\n self.mm_text_template = \"%10.3f\"\n self.imperial_text_template = \"%9.4f\"\n self.font_size = 25\n self.metric_units = True\n self.machine_units = _MM\n self.unit_convert = 1\n self._auto_units = True\n self.toggle_readout_enable = True\n self.cycle_time = 150\n self.diameter = False\n self.actual = True\n self.dtg = 0\n self.abs_pos = 0\n self.rel_pos = 0\n\n self.widgets = {} # will hold all our widgets we need to style\n\n # Make the GUI and connect signals\n\n self.css_text = \"\"\"\n .background {background-color: #000000;}\n .labelcolor {color: #FF0000;}\n .size_big {font-size: 25px;font-weight: bold;}\n .size_small {font-size: 10px;font-weight: bold;}\n \"\"\"\n\n self.css = Gtk.CssProvider()\n self.css.load_from_data(bytes(self.css_text, 'utf-8'))\n\n eventbox = Gtk.EventBox()\n eventbox.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n eventbox.get_style_context().add_class('background')\n self.add(eventbox)\n vbox_main = Gtk.Box(homogeneous = False, spacing = 0)\n vbox_main.set_orientation(Gtk.Orientation.VERTICAL)\n eventbox.add(vbox_main)\n hbox_up = Gtk.Box(homogeneous = False, spacing = 5)\n vbox_main.pack_start(hbox_up, True, True, 0)\n self.widgets[\"eventbox\"] = eventbox\n\n lbl_axisletter = Gtk.Label(label = _AXISLETTERS[self.axis_no])\n lbl_axisletter.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n lbl_axisletter.get_style_context().add_class('background')\n lbl_axisletter.get_style_context().add_class('labelcolor')\n lbl_axisletter.get_style_context().add_class('size_big')\n hbox_up.pack_start(lbl_axisletter, False, False, 0)\n self.widgets[\"lbl_axisletter\"] = lbl_axisletter\n\n vbox_ref_type = Gtk.Box(homogeneous = False, spacing = 0)\n vbox_ref_type.set_orientation(Gtk.Orientation.VERTICAL)\n hbox_up.pack_start(vbox_ref_type, False, False, 0)\n # This label is needed to press the main index (rel,Abs;Dtg) to the upper part\n lbl_space = Gtk.Label(label = \"\")\n vbox_ref_type.pack_start(lbl_space, True, True, 0)\n\n lbl_sys_main = Gtk.Label(label = self.system)\n lbl_sys_main.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n lbl_sys_main.get_style_context().add_class('background')\n lbl_sys_main.get_style_context().add_class('labelcolor')\n lbl_sys_main.get_style_context().add_class(\"size_small\")\n vbox_ref_type.pack_start(lbl_sys_main, False, False, 0)\n self.widgets[\"lbl_sys_main\"] = lbl_sys_main\n\n main_dro = Gtk.Label(label = \"9999.999\")\n main_dro.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n main_dro.get_style_context().add_class('background')\n main_dro.get_style_context().add_class('labelcolor')\n main_dro.get_style_context().add_class(\"size_big\")\n main_dro.set_xalign(1.0)\n hbox_up.pack_start(main_dro, True, True, 0)\n self.widgets[\"main_dro\"] = main_dro\n\n hbox_down = Gtk.Box(homogeneous = True, spacing = 5)\n vbox_main.pack_start(hbox_down, False, False, 0)\n\n lbl_sys_left = Gtk.Label(label = \"Abs\")\n lbl_sys_left.set_xalign(0.0)\n lbl_sys_left.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n lbl_sys_left.get_style_context().add_class('background')\n lbl_sys_left.get_style_context().add_class('labelcolor')\n lbl_sys_left.get_style_context().add_class('size_small')\n hbox_down.pack_start(lbl_sys_left, True, True, 0)\n self.widgets[\"lbl_sys_left\"] = lbl_sys_left\n\n dro_left = Gtk.Label(label = \"-11.111\")\n dro_left.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n dro_left.get_style_context().add_class('background')\n dro_left.get_style_context().add_class('labelcolor')\n dro_left.get_style_context().add_class('size_small')\n dro_left.set_xalign(1.0)\n hbox_down.pack_start(dro_left, True, True, 0)\n self.widgets[\"dro_left\"] = dro_left\n\n lbl_sys_right = Gtk.Label(label = \"DTG\")\n lbl_sys_right.set_xalign(0.0)\n lbl_sys_right.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n lbl_sys_right.get_style_context().add_class('background')\n lbl_sys_right.get_style_context().add_class('labelcolor')\n lbl_sys_right.get_style_context().add_class('size_small')\n hbox_down.pack_start(lbl_sys_right, False, False, 0)\n self.widgets[\"lbl_sys_right\"] = lbl_sys_right\n\n dro_right = Gtk.Label(label = \"22.222\")\n dro_right.get_style_context().add_provider(self.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)\n dro_right.get_style_context().add_class('background')\n dro_right.get_style_context().add_class('labelcolor')\n dro_right.get_style_context().add_class('size_small')\n dro_right.set_xalign(1.0)\n hbox_down.pack_start(dro_right, True, True, 0)\n self.widgets[\"dro_right\"] = dro_right\n\n eventbox.connect(\"button_press_event\", self._on_eventbox_clicked)\n\n self.show_all()\n\n self.gstat.connect('not-all-homed', self._not_all_homed )\n self.gstat.connect('all-homed', self._all_homed )\n self.gstat.connect('homed', self._homed )\n self.gstat.connect('current-position', self._position)\n self.gstat.connect('user-system-changed', self._user_system_changed)\n self._set_labels()\n\n # This try is only needed because while working with glade\n # linuxcnc may not be working\n try:\n self.inifile = self.linuxcnc.ini(INIPATH)\n # check the INI file if UNITS are set to mm\"\n # first check the global settings\n units = self.inifile.find(\"TRAJ\", \"LINEAR_UNITS\")\n if units == None:\n # else then the X axis units\n units = self.inifile.find(\"AXIS_0\", \"UNITS\")\n except:\n units = \"inch\"\n\n if units == \"mm\" or units == \"metric\" or units == \"1.0\":\n self.machine_units = _MM\n else:\n self.machine_units = _INCH\n\n # if the eventbox has been clicked, we like to toggle the DRO's\n # or just emit a signal to allow GUI to do what ever they want with that\n # signal- gmoccapy uses this signal to open the touch off dialog\n def _on_eventbox_clicked(self, widget, event):\n if event.x <= self.widgets[\"lbl_axisletter\"].get_allocation().width + self.widgets[\"lbl_sys_main\"].get_allocation().width:\n self.emit('axis_clicked', self.widgets[\"lbl_axisletter\"].get_text().lower())\n #self.set_style(\"labelcolor\", \"#00FF00\")\n else:\n if not self.toggle_readout_enable:\n return\n self.toggle_readout()\n\n # Get propertys\n def do_get_property(self, property):\n name = property.name.replace('-', '_')\n if name in list(self.__gproperties.keys()):\n if name == 'auto_units': name = '_auto_units'\n return getattr(self, name)\n else:\n raise AttributeError('unknown property %s' % property.name)\n\n def convert_color(self, color):\n colortuple = ((int(color.red * 255.0), int(color.green * 255.0), int(color.blue * 255.0)))\n return ('#' + ''.join(f'{i:02X}' for i in colortuple))\n\n # Set propertys\n def do_set_property(self, property, value):\n try:\n name = property.name.replace('-', '_')\n if name in list(self.__gproperties.keys()):\n# setattr(self, name, value)\n# self.queue_draw()\n if name == 'mm_text_template':\n self.mm_text_template = value\n if name == 'imperial_text_template':\n self.imperial_text_template = value \n if name == \"homed_color\":\n self.homed_color = self.convert_color(value)\n if self.homed:\n self.set_style(\"labelcolor\", self.homed_color)\n else:\n self.set_style(\"labelcolor\", self.unhomed_color)\n if name == \"unhomed_color\":\n self.unhomed_color = self.convert_color(value)\n if self.homed:\n self.set_style(\"labelcolor\", self.homed_color)\n else:\n self.set_style(\"labelcolor\", self.unhomed_color)\n if name == \"abs_color\":\n self.abs_color = self.convert_color(value)\n self.toggle_readout(True)\n if name == \"rel_color\":\n self.rel_color = self.convert_color(value)\n self.toggle_readout(True)\n if name == \"dtg_color\":\n self.dtg_color = self.convert_color(value)\n self.toggle_readout(True)\n if name == \"auto_units\":\n self._auto_units = value\n self._set_labels()\n if name == \"joint_number\":\n self.axis_no = self.joint = value\n self.change_axisletter(_AXISLETTERS[self.axis_no])\n if name == \"font_size\":\n self.font_size = int(value)\n self.set_style(\"size\", self.font_size)\n if name == \"toggle_readout\":\n self.toggle_readout_enable = value\n if name == \"cycle_time\":\n self.cycle_time = value\n if name in ('metric_units', 'actual', 'diameter'):\n setattr(self, name, value)\n self.queue_draw()\n else:\n raise AttributeError('unknown property %s' % property.name)\n except:\n pass\n\n # get the actual coordinate system to display it on the DRO\n def _get_current_system(self):\n gcode = self.status.gcodes[1:]\n for code in gcode:\n if code >= 540 and code <= 590:\n return \"G%s\" % int((code / 10))\n elif code > 590 and code <= 593:\n return \"G%s\" % (code / 10.0)\n return \"Rel\"\n\n # Get the units used according to gcode\n def _get_current_units(self):\n self.status.poll()\n gcode = self.status.gcodes[1:]\n for code in gcode:\n if code >= 200 and code <= 210:\n return (code // 10)\n return False\n\n # update the labels\n def _set_labels(self):\n try:\n self.status.poll()\n except:\n pass\n if self._ORDER[0] == \"Rel\":\n self.widgets[\"lbl_sys_main\"].set_text(self._get_current_system())\n else:\n self.widgets[\"lbl_sys_main\"].set_text(self._ORDER[0])\n if self._ORDER[1] == \"Rel\":\n self.widgets[\"lbl_sys_left\"].set_text(self._get_current_system())\n else:\n self.widgets[\"lbl_sys_left\"].set_text(self._ORDER[1])\n if self._ORDER[2] == \"Rel\":\n self.widgets[\"lbl_sys_right\"].set_text(self._get_current_system())\n else:\n self.widgets[\"lbl_sys_right\"].set_text(self._ORDER[2])\n\n self.system = self._get_current_system()\n\n def set_style(self, property, Data):\n# self.css_text = \"\"\"\n# .background {background-color: black;}\n# .labelcolor {color: red;}\n# .size_big {font-size: 25px;font-weight: bold;}\n# .size_small {font-size: 10px;font-weight: bold;}\n# \"\"\"\n\n if property == \"background\":\n for widget in self.widgets:\n self.widgets[widget].get_style_context().remove_class('background')\n replacement_string = \".background {background-color: \" + Data + \";}\"\n self.css_text = re.sub(r'[.][b][a][c][k][g][r][o][u][n][d].*', replacement_string, self.css_text, re.IGNORECASE)\n\n elif property == \"labelcolor\":\n for widget in self.widgets:\n self.widgets[widget].get_style_context().remove_class('labelcolor')\n replacement_string = \".labelcolor {color: \" + Data + \";}\"\n self.css_text = re.sub(r'[.][l][a][b][e][l][c][o][l][o][r].*', replacement_string, self.css_text, re.IGNORECASE)\n\n elif property == \"size\":\n for widget in self.widgets:\n self.widgets[widget].get_style_context().remove_class('size_big')\n self.widgets[widget].get_style_context().remove_class('size_small')\n replacement_string = \".size_big {font-size: \" + str(Data) + \"px;font-weight: bold;}\"\n self.css_text = re.sub(r'[.][s][i][z][e][_][b][i][g].*', replacement_string, self.css_text, re.IGNORECASE)\n replacement_string = \".size_small {font-size: \" + str(int(Data / 2.5)) + \"px;font-weight: bold;}\"\n self.css_text = re.sub(r'[.][s][i][z][e][_][s][m][a][l][l].*', replacement_string, self.css_text, re.IGNORECASE)\n\n else:\n print(\"Got unknown property in <>\")\n return\n\n self.css.load_from_data(bytes(self.css_text, 'utf-8'))\n\n for widget in self.widgets:\n self.widgets[widget].get_style_context().add_class('background')\n self.widgets[widget].get_style_context().add_class('labelcolor')\n if widget in (\"lbl_axisletter\", \"main_dro\"):\n self.widgets[widget].get_style_context().add_class('size_big')\n else:\n self.widgets[widget].get_style_context().add_class('size_small')\n\n self.queue_draw()\n\n def _user_system_changed(self, object, system):\n self._set_labels()\n\n def _position(self, object, p, rel_p, dtg, joint_actual_position):\n # object = hal_glib Object\n # p = self.stat.actual_position\n # rel_p = relative position\n # dtg = distance to go\n # joint_actual_position = joint positions, not needed here\n\n try:\n dtg = dtg[self.axis_no]\n abs_pos = p[self.axis_no]\n rel_pos = rel_p[self.axis_no]\n except:\n return\n\n if (self._get_current_units() == 20 and self.metric_units) or (self._get_current_units() == 21 and not self.metric_units):\n if self._auto_units:\n self.metric_units = not self.metric_units\n self.emit(\"units_changed\", self.metric_units)\n\n if self.metric_units and self.machine_units == _INCH:\n if self.axis_no not in (3, 4, 5):\n abs_pos = abs_pos * 25.4\n rel_pos = rel_pos * 25.4\n dtg = dtg * 25.4\n\n if not self.metric_units and self.machine_units == _MM:\n if self.axis_no not in (3, 4, 5):\n abs_pos = abs_pos / 25.4\n rel_pos = rel_pos / 25.4\n dtg = dtg / 25.4\n\n if self._ORDER == [\"Rel\", \"Abs\", \"DTG\"]:\n main, left, right = rel_pos, abs_pos, dtg\n if self._ORDER == [\"DTG\", \"Rel\", \"Abs\"]:\n main, left, right = dtg, rel_pos, abs_pos\n if self._ORDER == [\"Abs\", \"DTG\", \"Rel\"]:\n main, left, right = abs_pos, dtg, rel_pos\n\n if self.metric_units:\n tmpl = lambda s: self.mm_text_template % s\n else:\n tmpl = lambda s: self.imperial_text_template % s\n\n if self.diameter:\n scale = 2.0\n else:\n scale = 1.0\n main_dro = tmpl(main * scale)\n left_dro = tmpl(left * scale)\n right_dro = tmpl(right * scale)\n self.widgets[\"main_dro\"].set_label(main_dro)\n self.widgets[\"dro_left\"].set_label(left_dro)\n self.widgets[\"dro_right\"].set_label(right_dro)\n self.dtg = dtg * scale\n self.abs_pos = abs_pos * scale\n self.rel_pos = rel_pos * scale\n\n def _not_all_homed(self, widget, data = None):\n if self.status.kinematics_type == linuxcnc.KINEMATICS_IDENTITY:\n self.status.poll()\n self.homed = self.status.homed[self.joint_no]\n else:\n self.homed = False\n if self.homed:\n self.set_style(\"labelcolor\", self.homed_color)\n else:\n self.set_style(\"labelcolor\", self.unhomed_color)\n\n def _all_homed(self, widget, data = None):\n if self.status.kinematics_type == linuxcnc.KINEMATICS_IDENTITY:\n return\n if not self.homed:\n self.homed = True\n self.set_style(\"labelcolor\", self.homed_color)\n\n def _homed(self, widget, data = None):\n if self.status.kinematics_type != linuxcnc.KINEMATICS_IDENTITY:\n return\n else:\n self.status.poll()\n self.homed = self.status.homed[self.joint_no]\n self.set_style(\"labelcolor\", self.homed_color)\n\n # sets the DRO explicitly to inch or mm\n # attentions auto_units also takes effect on that!\n def set_to_inch(self, state):\n '''\n sets the DRO to show imperial units\n\n Combi_DRO.set_to_inch(state)\n\n state = boolean (true or False)\n '''\n if state:\n self.metric_units = False\n else:\n self.metric_units = True\n\n # If auto_units is true, the DRO will change according to the\n # active gcode (G20 / G21)\n def set_auto_units(self, state):\n '''\n if True the DRO will change units according to active gcode (G20 / G21)\n\n Combi_DRO.set_auto_units(state)\n\n state = boolean (true or False)\n '''\n self._auto_units = state\n\n # Set the axis to diameter mode, the DRO value will be\n # multiplied by 2\n def set_to_diameter(self, state):\n '''\n if True the DRO will show the diameter not the radius, specially needed for lathes\n the DRO value will be multiplied by 2\n\n Combi_DRO.set_to_diameter(state)\n\n state = boolean (true or False)\n\n '''\n self.diameter = state\n\n # this will toggle the DRO around, mainly used to maintain all DRO\n # at the same state, because a click on one will only change that DRO\n # This can be used to change also the others\n def toggle_readout(self, Data = None):\n '''\n toggles the order of the DRO in the widget\n\n Combi_DRO.toggle_readout()\n\n '''\n if not Data:\n self._ORDER = [self._ORDER[2], self._ORDER[0], self._ORDER[1]]\n\n if self._ORDER[0] == \"Abs\":\n bg_color = self.abs_color\n elif self._ORDER[0] == \"DTG\":\n bg_color = self.dtg_color\n else:\n bg_color = self.rel_color\n\n self.set_style(\"background\", bg_color)\n self._set_labels()\n\n # if Data is True, we only update the colors of the background\n # so we won't emit a click event\n if Data:\n return\n\n self.emit(\"clicked\", self.joint_number, self._ORDER)\n\n # You can change the automatic given axisletter using this function\n # i.e. to use an axis as R or D insteadt of X on a lathe\n def change_axisletter(self, letter):\n '''\n changes the automatically given axis-letter\n very useful to change an lathe DRO from X to R or D\n\n Combi_DRO.change_axis-letter(letter)\n\n letter = string\n\n '''\n self.widgets[\"lbl_axisletter\"].set_text(letter)\n\n def set_joint_no(self, joint):\n '''\n changes the joint, not the joint number. This is handy for special\n cases, like Gantry configs, i.e. XYYZ, where joint 0 = X, joint 1 = Y1\n joint 2 = Y2 and joint 3 = Z, so the Z axis can be set to joint_number 2\n giving the axis letter Z and joint 3 being in this case the corresponding\n joint, joint 3 instead of 2\n '''\n self.joint_no = joint\n\n def set_axis(self, axis):\n '''\n changes the axis, not the joint number. This is handy for special\n cases, like Lathe configs, i.e. XZ, where joint 0 = X, joint 1 = Z\n so the Z axis must be set to joint_number 1 for homing, but we need\n the axis letter Z to give the correct position feedback\n '''\n self.axis_no = \"xyzabcuvws\".index(axis.lower())\n\n # returns the order of the DRO, mainly used to maintain them consistent\n # the order will also be transmitted with the clicked signal\n def get_order(self):\n '''\n returns the order of the DRO in the widget mainly used to maintain them consistent\n the order will also be transmitted with the clicked signal\n\n Combi_DRO.get_order()\n\n returns a list containing the order\n '''\n return self._ORDER\n\n # sets the order of the DRO, mainly used to maintain them consistent\n def set_order(self, order):\n '''\n sets the order of the DRO, mainly used to maintain them consistent\n\n Combi_DRO.set_order(order)\n\n order = list object, must be one of\n [\"Rel\", \"Abs\", \"DTG\"]\n [\"DTG\", \"Rel\", \"Abs\"]\n [\"Abs\", \"DTG\", \"Rel\"]\n '''\n self._ORDER = order\n self.toggle_readout(Data=True)\n\n # This will return the position information of all three DRO\n # it will be in the order Abs, Rel, DTG\n def get_position(self):\n '''\n returns the positions of the DRO\n\n Combi_DRO.get_position()\n\n returns the position of the DRO as a list of floats\n the order is independent of the order shown on the DRO\n and will be given as [Absolute , relative , DTG]\n\n Absolute = the machine coordinates, depends on the actual property\n will give actual or commanded position\n Relative = will be the coordinates of the actual coordinate system\n DTG = the distance to go, will mosltly be 0, as this function should not be used\n while the machine is moving, because of time delays\n '''\n return self.abs_pos, self.rel_pos, self.dtg\n\n# for testing without glade editor:\n# to show some behavior and setting options\ndef main():\n window = Gtk.Window(type = Gtk.WindowType.TOPLEVEL)\n\n vbox = Gtk.Box(homogeneous = False, spacing = 5)\n vbox.set_orientation(Gtk.Orientation.VERTICAL)\n MDRO_X = Combi_DRO(0)\n MDRO_Y = Combi_DRO(1)\n MDRO_Z = Combi_DRO(2)\n MDRO_C = Combi_DRO(5)\n\n vbox.add(MDRO_X)\n vbox.add(MDRO_Y)\n vbox.add(MDRO_Z)\n vbox.add(MDRO_C)\n window.add(vbox)\n\n window.connect(\"destroy\", Gtk.main_quit)\n MDRO_X.connect(\"clicked\", clicked)\n MDRO_Y.connect(\"clicked\", clicked)\n MDRO_Y.set_auto_units(False)\n MDRO_Y.set_to_inch(True)\n# MDRO_Y.set_to_diameter(True)\n# MDRO_Y.set_property('joint_number',0)\n# MDRO_Y.change_axisletter(\"D\")\n MDRO_Z.connect(\"clicked\", clicked)\n MDRO_C.connect(\"clicked\", clicked)\n MDRO_C.set_property('mm_text_template', '%10.2f')\n MDRO_C.set_property('imperial_text_template', '%10.3f')\n MDRO_C.set_property('toggle_readout', False)\n window.show_all()\n Gtk.main()\n\ndef clicked(self, axis_number, order):\n '''\n This signal will be emitted if the user clicked on the DRO\n\n axis_number = the joint number of the widget\n order = the actual order of the DRO in the widget\n '''\n print(\"Click received from \", axis_number)\n #print(\"Order = \", order)\n #print(self.get_position())\n# self.set_property(\"joint_number\", 0)\n # other_widget.set_order(order)\n # so they may be maintained consistent\n\nif __name__ == \"__main__\":\n main()\n"} {"id": "linuxcnc-source:lib/python/qtvcp/lib/gcode_utility/hole_circle.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/qtvcp/lib/gcode_utility/hole_circle.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/qtvcp/lib/gcode_utility/hole_circle.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "34edf98dc2655a1004ffece2a5e798c6cffea0a95936a9b59badabbd785811e7", "bytes": 13973, "tokens": 4858, "text": "#!/usr/bin/env python3\nimport sys\nimport os\nimport math\n\nimport tempfile\nimport atexit\nimport shutil\n\nfrom PyQt5 import QtGui, QtWidgets, uic\nfrom PyQt5.QtCore import QPoint, QPointF, QLine, QRect, QFile, Qt, QEvent, QRegExp\nfrom PyQt5.QtWidgets import QFileDialog, QMessageBox\nfrom PyQt5.QtGui import QPainter, QBrush, QPen, QColor\n\nfrom linuxcnc import OPERATOR_ERROR, NML_ERROR\nfrom qtvcp.core import Info, Status, Action\n\nINFO = Info()\nSTATUS = Status()\nACTION = Action()\n\nHERE = os.path.dirname(os.path.abspath(__file__))\nIMAGES = os.path.join(INFO.IMAGE_PATH, 'gcode_utility')\n\nclass Preview(QtWidgets.QWidget):\n def __init__(self):\n super(Preview, self).__init__()\n self.num_holes = 0\n self.first_angle = 0.0\n\n def paintEvent(self, event):\n painter = QPainter(self)\n painter.setBrush(QColor(200, 200, 200, 255))\n painter.drawRect(event.rect())\n self.draw_main_circle(event, painter)\n self.draw_crosshair(event, painter)\n self.draw_holes(event, painter)\n painter.end() \n\n def draw_main_circle(self, event, qp):\n size = self.size()\n w = size.width()/2\n h = size.height()/2\n center = QPointF(w, h)\n radius = min(w, h) - 35\n qp.setPen(QPen(Qt.black, 1))\n qp.drawEllipse(center, radius, radius)\n\n def draw_crosshair(self, event, qp):\n size = self.size()\n cx = int(size.width()/2)\n cy = int(size.height()/2)\n L = min(cx, cy) - 25\n qp.setPen(QPen(Qt.black, 1))\n p1 = QPoint(cx + L, cy)\n p2 = QPoint(cx, cy - L)\n p3 = QPoint(cx - L, cy)\n p4 = QPoint(cx, cy + L)\n qp.drawLine(p1, p3)\n qp.drawLine(p2, p4)\n br1 = QRect(cx + L, cy-6, 30, 12)\n br2 = QRect(cx-15, cy - L - 12, 30, 12)\n br3 = QRect(cx - L - 30, cy-6, 30, 12)\n br4 = QRect(cx-15, cy + L, 30, 12)\n qp.drawText(br1, Qt.AlignHCenter|Qt.AlignVCenter, \"0\")\n qp.drawText(br2, Qt.AlignHCenter|Qt.AlignVCenter, \"90\")\n qp.drawText(br3, Qt.AlignHCenter|Qt.AlignVCenter, \"180\")\n qp.drawText(br4, Qt.AlignHCenter|Qt.AlignVCenter, \"270\")\n\n def draw_holes(self, event, qp):\n size = self.size()\n w = size.width()\n h = size.height()\n center = QPointF(w/2, h/2)\n r = (min(w, h) - 70)/2\n qp.setPen(QPen(Qt.red, 2))\n for i in range(self.num_holes):\n if i ==1:\n qp.setPen(QPen(Qt.black, 2))\n theta = ((360.0/self.num_holes) * i) + self.first_angle\n x = r * math.cos(math.radians(theta))\n y = r * math.sin(math.radians(theta))\n x = round(x, 3)\n y = -round(y, 3) # need this to make it go CCW\n p = QPointF(x, y) + center\n qp.drawEllipse(p, 6, 6)\n\n def set_num_holes(self, num):\n self.num_holes = num\n\n def set_first_angle(self, angle):\n self.first_angle = angle\n\nclass Hole_Circle(QtWidgets.QWidget):\n def __init__(self, parent=None):\n super(Hole_Circle, self).__init__(parent)\n # Load the widgets UI file:\n self.filename = os.path.join(HERE, 'hole_circle.ui')\n try:\n self.instance = uic.loadUi(self.filename, self)\n except AttributeError as e:\n print(\"Error: \", e)\n self.preview = Preview()\n self.layout_preview.addWidget(self.preview)\n\n # set up Help messagebox\n help_file = open(os.path.join(HERE,\"hole_circle_help.txt\"), \"r\")\n help_text = help_file.read()\n self.mb = QMessageBox()\n self.mb.setIcon(QMessageBox.Information)\n self.mb.setWindowTitle(\"Hole Circle Help\")\n self.mb.setText(help_text)\n self.mb.setStandardButtons(QMessageBox.Ok)\n\n # Initial values\n self._tmp = None\n self.unit_code = \"G21\"\n self.rpm = 500\n self.num_holes = 4\n self.radius = 10.0\n self.first = 0.0\n self.safe_z = 1.0\n self.start = .5\n self.depth = 1.0\n self.drill_feed = 1.0\n self.units_text = ''\n\n self.units_changed()\n\n # set valid input formats for lineEdits\n\n self.lineEdit_spindle.setText(str(self.rpm))\n self.lineEdit_num_holes.setText(str(self.num_holes))\n self.lineEdit_radius.setText(str(self.radius))\n self.lineEdit_first.setText(str(self.first))\n self.lineEdit_safe_z.setText(str(self.safe_z))\n self.lineEdit_start_height.setText(str(self.start))\n self.lineEdit_depth.setText(str(self.depth))\n self.lineEdit_drill_feed.setText(str(self.drill_feed))\n self.lineEdit_comment.setText('Hole Circle Program')\n\n self.checked = QtGui.QPixmap(os.path.join(IMAGES, 'checked.png'))\n self.unchecked = QtGui.QPixmap(os.path.join(IMAGES,'unchecked.png'))\n\n self.valid = True\n self.units_changed()\n self.validate()\n\n # signal connections\n self.btn_validate.clicked.connect(self.validate)\n self.btn_create.clicked.connect(self.create_program)\n self.btn_send.clicked.connect(self.send_program)\n self.btn_mm.clicked.connect(self.units_changed)\n self.btn_inch.clicked.connect(self.units_changed)\n self.btn_help.clicked.connect(lambda obj: self.mb.show())\n\n def units_changed(self):\n if self.btn_inch.isChecked():\n unit = \"IMPERIAL\"\n self.unit_code = \"G20\"\n else:\n unit = \"METRIC\"\n self.unit_code = \"G21\"\n self.units_text = \"**NOTE - All units are in {}\".format(unit)\n self.set_validator()\n\n def set_validator(self):\n # set valid input formats for lineEdits\n if self.btn_inch.isChecked():\n valid_size = QtGui.QRegExpValidator(QRegExp(r'^((\\d+(\\.\\d{,4})?)|(\\.\\d{,4}))$'))\n valid_radius = QtGui.QRegExpValidator(QRegExp(r'^((\\d{1,3}(\\.\\d{1,4})?)|(\\.\\d{1,4}))$'))\n valid_feed = QtGui.QRegExpValidator(QRegExp('[0-9]{0,6}[.][0-9]{0,3}'))\n else:\n valid_size = QtGui.QRegExpValidator(QRegExp(r'^((\\d+(\\.\\d{,3})?)|(\\.\\d{,3}))$'))\n valid_radius = QtGui.QRegExpValidator(QRegExp(r'^((\\d{1,4}(\\.\\d{1,3})?)|(\\.\\d{1,3}))$'))\n valid_feed = QtGui.QRegExpValidator(QRegExp(r'\\d{0,5}[.]\\d{0,1}'))\n\n self.lineEdit_spindle.setValidator(QtGui.QRegExpValidator(QRegExp(r'\\d{0,5}')))\n self.lineEdit_num_holes.setValidator(QtGui.QDoubleValidator(0, 99, 0))\n self.lineEdit_radius.setValidator(valid_radius)\n self.lineEdit_first.setValidator(QtGui.QRegExpValidator(QRegExp(r'\\d{0,3}[.]\\d{0,2}')))\n self.lineEdit_safe_z.setValidator(valid_size)\n self.lineEdit_start_height.setValidator(valid_size)\n self.lineEdit_depth.setValidator(valid_size)\n self.lineEdit_drill_feed.setValidator(valid_feed)\n\n def clear_all(self):\n self.lbl_spindle_ok.setPixmap(self.unchecked)\n self.lbl_num_holes_ok.setPixmap(self.unchecked)\n self.lbl_radius_ok.setPixmap(self.unchecked)\n self.lbl_first_ok.setPixmap(self.unchecked)\n self.lbl_safe_z_ok.setPixmap(self.unchecked)\n self.lbl_start_height_ok.setPixmap(self.unchecked)\n self.lbl_depth_ok.setPixmap(self.unchecked)\n self.lbl_drill_feed_ok.setPixmap(self.unchecked)\n \n def validate(self):\n self.valid = True\n self.clear_all()\n try:\n self.rpm = int(self.lineEdit_spindle.text())\n if self.rpm > 0:\n self.lbl_spindle_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n\n try:\n self.num_holes = int(self.lineEdit_num_holes.text())\n if self.num_holes > 0:\n self.lbl_num_holes_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n\n try:\n self.radius = float(self.lineEdit_radius.text())\n if self.radius > 0.0:\n self.lbl_radius_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n\n try:\n self.first = float(self.lineEdit_first.text())\n if self.first < 360.0:\n self.lbl_first_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n\n try:\n self.safe_z = float(self.lineEdit_safe_z.text())\n if self.safe_z > 0.0:\n self.lbl_safe_z_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n\n try:\n self.start = float(self.lineEdit_start_height.text())\n if self.start > 0.0:\n self.lbl_start_height_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n\n try:\n self.depth = float(self.lineEdit_depth.text())\n if self.depth > 0.0:\n self.lbl_depth_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n\n try:\n self.drill_feed = float(self.lineEdit_drill_feed.text())\n if self.drill_feed > 0.0:\n self.lbl_drill_feed_ok.setPixmap(self.checked)\n else:\n self.valid = False\n except:\n self.valid = False\n \n if self.valid is True:\n self.preview.set_num_holes(self.num_holes)\n self.preview.set_first_angle(self.first)\n self.update()\n\n def create_program(self):\n self.validate()\n if self.valid is False:\n print(\"There are errors in input fields\")\n STATUS.emit('error', OPERATOR_ERROR, \"Hole Circle: There are errors in input fields\")\n return\n options = QFileDialog.Options()\n options |= QFileDialog.DontUseNativeDialog\n fileName, _ = QFileDialog.getSaveFileName(self,\"Save to file\",\"\",\"All Files (*);;ngc Files (*.ngc)\", options=options)\n if fileName:\n self.calculate_toolpath(fileName)\n else:\n print(\"Program creation aborted\")\n\n def send_program(self):\n self.validate()\n if self.valid is False:\n print(\"There are errors in input fields\")\n STATUS.emit('error', OPERATOR_ERROR, \"Hole Circle: There are errors in input fields\")\n return\n self._mktemp()\n if self._tmp:\n mp = os.path.join(self._tmp, os.path.basename('bhc.ngc'))\n self.calculate_toolpath(mp)\n ACTION.OPEN_PROGRAM(mp)\n else:\n print(\"send creation aborted\")\n\n def calculate_toolpath(self, fname):\n comment = self.lineEdit_comment.text()\n self.line_num = 5\n self.file = open(fname, 'w')\n # opening preamble\n self.file.write(\"%\\n\")\n self.file.write(\"({})\\n\".format(comment))\n self.file.write(\"({} Holes on {} Diameter)\\n\".format(self.num_holes,self.radius *2))\n self.file.write(\"({})\\n\".format(self.units_text))\n self.file.write(\"({})\\n\".format('XY origin at circle center'))\n self.file.write(\"({})\\n\".format('Z origin at top face of surface'))\n self.file.write(\"\\n\")\n self.next_line(\"{} G40 G49 G64 P0.03\".format(self.unit_code))\n self.next_line(\"G17\")\n self.next_line(\"G0 Z{}\".format(self.safe_z))\n self.next_line(\"G0 X0.0 Y0.0\")\n self.next_line(\"S{} M3\".format(self.rpm))\n # main section\n for i in range(self.num_holes):\n next_angle = ((360.0/self.num_holes) * i) + self.first\n next_angle = round(next_angle, 3)\n self.next_line(\"G0 @{} ^{}\".format(self.radius, next_angle))\n self.next_line(\"Z{}\".format(self.start))\n self.next_line(\"G1 Z-{} F{}\".format(self.depth, self.drill_feed))\n self.next_line(\"G0 Z{}\".format(self.safe_z))\n # closing section\n self.next_line(\"G0 x0.0 Y0.0\")\n self.next_line(\"M2\")\n self.file.write(\"%\\n\")\n self.file.close()\n\n def output_program(self, dummy):\n\n def next_line(text):\n sys.stdout.write(text + \"\\n\")\n\n self.validate()\n if self.valid is False:\n print(\"There are errors in input fields\")\n return\n\n comment = self.lineEdit_comment.text()\n # opening preamble\n sys.stdout.write(\"%\\n\")\n sys.stdout.write(\"({})\\n\".format(comment))\n next_line(\"{} G40 G49 G64 P0.03\".format(self.unit_code))\n next_line(\"G17\")\n next_line(\"G0 Z{}\".format(self.safe_z))\n next_line(\"G0 X0.0 Y0.0\")\n next_line(\"S{} M3\".format(self.rpm))\n # main section\n for i in range(self.num_holes):\n next_angle = ((360.0/self.num_holes) * i) + self.first\n next_angle = round(next_angle, 3)\n next_line(\"G0 @{} ^{}\".format(self.radius, next_angle))\n next_line(\"Z{}\".format(self.start))\n next_line(\"G1 Z-{} F{}\".format(self.depth, self.drill_feed))\n next_line(\"G0 Z{}\".format(self.safe_z))\n # closing section\n next_line(\"G0 x0.0 Y0.0\")\n next_line(\"M2\")\n sys.stdout.write(\"%\\n\")\n sys.exit(0)\n\n def _mktemp(self):\n if self._tmp:\n return\n self._tmp = tempfile.mkdtemp(prefix='emcBCD-', suffix='.d')\n atexit.register(lambda: shutil.rmtree(self._tmp))\n\n\n def btn_help_clicked(self, state):\n self.mb.show()\n\n def next_line(self, text):\n self.file.write(\"N{} \".format(self.line_num) + text + \"\\n\")\n self.line_num += 5\n\nif __name__ == \"__main__\":\n app = QtWidgets.QApplication(sys.argv)\n\n Hole_Circle.create_program = Hole_Circle.output_program\n w = Hole_Circle()\n\n w.show()\n sys.exit( app.exec_() )\n"} {"id": "linuxcnc-source:lib/python/qtvcp/lib/qtplasmac/conv_block.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/qtvcp/lib/qtplasmac/conv_block.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/qtvcp/lib/qtplasmac/conv_block.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "47d48529468ad2231c42bf90e78cc311830c625219ad8f4982e6562c2ffee0b6", "bytes": 9965, "tokens": 3899, "text": "'''\nconv_block.py\n\nCopyright (C) 2020, 2021, 2022 Phillip A Carter\nCopyright (C) 2020, 2021, 2022 Gregory D Carl\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program; if not, write to the Free Software Foundation, Inc.,\n51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n'''\n\nfrom PyQt5.QtCore import Qt, QCoreApplication\nfrom PyQt5.QtWidgets import QLabel, QMessageBox\nfrom qtvcp.core import Status\nfrom importlib import reload\nfrom plasmac import block as BLOCK\n\n_translate = QCoreApplication.translate\n\nSTATUS = Status()\n\ndef preview(P, W, Conv):\n if P.dialogError or not W.preview.isEnabled():\n return\n error = BLOCK.preview(Conv, P.fNgc, P.fTmp, \\\n W.cnEntry.text(), W.rnEntry.text(), W.coEntry.text(), W.roEntry.text(), \\\n W.oxEntry.text(), W.oyEntry.text(), W.aEntry.text(), W.scEntry.text(), \\\n W.rtEntry.text(), P.convBlock, P.convMirror, P.convFlip, \\\n P.convMirrorToggle, P.convFlipToggle, STATUS.stat.g5x_index, P.convUnits)\n if error:\n P.dialogError = True\n P.dialog_show_ok(QMessageBox.Warning, _translate('Conversational', 'Block Error'), error)\n else:\n W.conv_preview.load(P.fNgc)\n W.conv_preview.set_current_view()\n W.add.setEnabled(True)\n W.undo.setEnabled(True)\n Conv.conv_preview_button(P, W, True)\n\n W.add.setEnabled(True)\n P.convBlock[0] = True\n P.convMirrorToggle = False\n P.convFlipToggle = False\n\ndef mirror_shape(P, W, Conv):\n if P.convMirror == 1:\n P.convMirror = -1\n else:\n P.convMirror = 1\n P.convMirrorToggle = True\n preview(P, W, Conv)\n\ndef flip_shape(P, W, Conv):\n if P.convFlip == 1:\n P.convFlip = -1\n else:\n P.convFlip = 1\n P.convFlipToggle = True\n preview(P, W, Conv)\n\ndef undo_shape(P, W, Conv):\n P.convMirror = 1\n P.convMirrorToggle = False\n P.convFlip = 1\n P.convFlipToggle = False\n Conv.conv_undo_shape(P, W)\n\ndef get_parameters(P, W):\n P.wcs_rotation('get')\n inCode = open(P.fNgc, 'r')\n P.convBlock = [False, False]\n P.convUnits = [1, None]\n P.convMirror = 1\n P.convMirrorToggle = False\n P.convFlip = 1\n P.convFlipToggle = False\n for line in inCode:\n line = line.strip().lower()\n # maybe check here for old style rotate, scale, and array\n if line.startswith(';conversational block'):\n P.convBlock = [True, True]\n elif 'G21' in line.upper().replace(' ', '') and P.unitsPerMm != 1:\n P.convUnits = [25.4, 'G21']\n elif 'G20' in line.upper().replace(' ', '') and P.unitsPerMm == 1:\n P.convUnits = [0.03937, 'G20']\n elif 'm3' in line:\n break\n inCode.seek(0, 0)\n if P.convBlock[0]:\n for line in inCode:\n line = line.strip().lower()\n if line.startswith('#'):\n W.coEntry.setText('{:0.4f}'.format(float(line.split('=')[1].strip())))\n elif line.startswith('#'):\n W.roEntry.setText('{:0.4f}'.format(float(line.split('=')[1].strip())))\n elif line.startswith('#'):\n W.cnEntry.setText(line.split('=')[1].strip())\n elif line.startswith('#'):\n W.rnEntry.setText(line.split('=')[1].strip())\n elif line.startswith('#'):\n W.oxEntry.setText('{:0.4f}'.format(float(line.split('=')[1].strip())))\n elif line.startswith('#'):\n W.oyEntry.setText('{:0.4f}'.format(float(line.split('=')[1].strip())))\n elif line.startswith('#'):\n W.aEntry.setText(line.split('=')[1].strip())\n elif line.startswith('#'):\n W.scEntry.setText(line.split('=')[1].strip())\n elif line.startswith('#'):\n W.rtEntry.setText(line.split('=')[1].strip())\n elif line.startswith('#'):\n P.convMirror = int(line.split('=')[1].strip())\n elif line.startswith('#'):\n P.convFlip = int(line.split('=')[1].strip())\n elif 'm3' in line:\n break\n inCode.seek(0, 0)\n\ndef widgets(P, W, Conv):\n if P.developmentPin.get():\n reload(BLOCK)\n W.shLabel.setText(_translate('Conversational', 'SHAPE'))\n W.lDesc.setText(_translate('Conversational', 'CREATE ARRAY OF SHAPES'))\n #alignment and size\n rightAlign = ['cnLabel', 'cnEntry', 'coEntry', \\\n 'rnLabel', 'rnEntry', 'roEntry', \\\n 'oxLabel', 'oxEntry', 'oyEntry', \\\n 'scLabel', 'aEntry', 'scEntry', \\\n 'rtEntry']\n leftAlign = ['coLabel', 'roLabel', 'oyLabel', 'aLabel', 'rtLabel']\n centerAlign = ['lDesc', 'ccLabel', 'rrLabel', 'oLabel','shLabel','ptLabel']\n pButton = ['preview', 'add', 'undo', 'mirror', 'flip']\n for widget in rightAlign:\n W[widget].setAlignment(Qt.AlignRight | Qt.AlignVCenter)\n W[widget].setFixedWidth(80)\n W[widget].setFixedHeight(24)\n for widget in leftAlign:\n W[widget].setAlignment(Qt.AlignLeft | Qt.AlignVCenter)\n W[widget].setFixedWidth(80)\n W[widget].setFixedHeight(24)\n for widget in centerAlign:\n W[widget].setAlignment(Qt.AlignCenter | Qt.AlignVCenter)\n if widget == 'lDesc':\n W[widget].setFixedWidth(240)\n else:\n W[widget].setFixedWidth(80)\n W[widget].setFixedHeight(24)\n for widget in pButton:\n W[widget].setFixedWidth(80)\n W[widget].setFixedHeight(24)\n #starting parameters\n W.add.setEnabled(False)\n #connections\n W.preview.pressed.connect(lambda:preview(P, W, Conv))\n W.add.pressed.connect(lambda:Conv.conv_accept(P, W))\n W.undo.pressed.connect(lambda:undo_shape(P, W, Conv))\n W.mirror.clicked.connect(lambda:mirror_shape(P, W, Conv))\n W.flip.clicked.connect(lambda:flip_shape(P, W, Conv))\n entries = ['cnEntry', 'coEntry', 'rnEntry', 'roEntry', 'oxEntry',\n 'oyEntry', 'scEntry', 'aEntry', 'rtEntry']\n for entry in entries:\n W[entry].textChanged.connect(lambda:Conv.conv_entry_changed(P, W, W.sender()))\n W[entry].returnPressed.connect(lambda:preview(P, W, Conv))\n #add to layout\n if P.landscape:\n W.s0 = QLabel('')\n W.s0.setFixedHeight(51)\n W.entries.addWidget(W.s0, 0, 0)\n W.entries.addWidget(W.ccLabel, 1, 2)\n W.entries.addWidget(W.cnLabel, 1, 0)\n W.entries.addWidget(W.cnEntry, 1, 1)\n W.entries.addWidget(W.coEntry, 1, 3)\n W.entries.addWidget(W.coLabel, 1, 4)\n W.entries.addWidget(W.rrLabel, 3, 2)\n W.entries.addWidget(W.rnLabel, 3, 0)\n W.entries.addWidget(W.rnEntry, 3, 1)\n W.entries.addWidget(W.roEntry, 3, 3)\n W.entries.addWidget(W.roLabel, 3, 4)\n W.entries.addWidget(W.oLabel, 5, 2)\n W.entries.addWidget(W.oxLabel, 5, 0)\n W.entries.addWidget(W.oxEntry, 5, 1)\n W.entries.addWidget(W.oyEntry, 5, 3)\n W.entries.addWidget(W.oyLabel, 5, 4)\n W.entries.addWidget(W.ptLabel, 7, 2)\n W.entries.addWidget(W.aEntry, 7, 3)\n W.entries.addWidget(W.aLabel, 7, 4)\n W.entries.addWidget(W.scLabel, 9, 0)\n W.entries.addWidget(W.scEntry, 9, 1)\n W.entries.addWidget(W.shLabel, 9, 2)\n W.entries.addWidget(W.rtEntry, 9, 3)\n W.entries.addWidget(W.rtLabel, 9, 4)\n W.entries.addWidget(W.mirror, 11, 1)\n W.entries.addWidget(W.flip, 11, 3)\n for r in [2,4,6,8,10]:\n W['{}'.format(r)] = QLabel('')\n W['{}'.format(r)].setFixedHeight(24)\n W.entries.addWidget(W['{}'.format(r)], r, 0)\n W.entries.addWidget(W.preview, 12, 0)\n W.entries.addWidget(W.add, 12, 2)\n W.entries.addWidget(W.undo, 12, 4)\n W.entries.addWidget(W.lDesc, 13 , 1, 1, 3)\n else:\n W.entries.addWidget(W.ccLabel, 0, 2)\n W.entries.addWidget(W.cnLabel, 0, 0)\n W.entries.addWidget(W.cnEntry, 0, 1)\n W.entries.addWidget(W.coEntry, 0, 3)\n W.entries.addWidget(W.coLabel, 0, 4)\n W.entries.addWidget(W.rrLabel, 2, 2)\n W.entries.addWidget(W.rnLabel, 2, 0)\n W.entries.addWidget(W.rnEntry, 2, 1)\n W.entries.addWidget(W.roEntry, 2, 3)\n W.entries.addWidget(W.roLabel, 2, 4)\n W.entries.addWidget(W.oLabel, 4, 2)\n W.entries.addWidget(W.oxLabel, 4, 0)\n W.entries.addWidget(W.oxEntry, 4, 1)\n W.entries.addWidget(W.oyEntry, 4, 3)\n W.entries.addWidget(W.oyLabel, 4, 4)\n W.entries.addWidget(W.ptLabel, 6, 2)\n W.entries.addWidget(W.aEntry, 6, 3)\n W.entries.addWidget(W.aLabel, 6, 4)\n W.entries.addWidget(W.scLabel, 8, 0)\n W.entries.addWidget(W.scEntry, 8, 1)\n W.entries.addWidget(W.shLabel, 8, 2)\n W.entries.addWidget(W.rtEntry, 8, 3)\n W.entries.addWidget(W.rtLabel, 8, 4)\n W.entries.addWidget(W.mirror, 9, 1)\n W.entries.addWidget(W.flip, 9, 3)\n for r in [1,3,5,7]:\n W['{}'.format(r)] = QLabel('')\n W['{}'.format(r)].setFixedHeight(24)\n W.entries.addWidget(W['{}'.format(r)], r, 0)\n W.entries.addWidget(W.preview, 10, 0)\n W.entries.addWidget(W.add, 10, 2)\n W.entries.addWidget(W.undo, 10, 4)\n W.cnEntry.setFocus()\n P.convSettingsChanged = False\n get_parameters(P, W)\n"} {"id": "linuxcnc-source:lib/python/qtvcp/lib/qtplasmac/conv_triangle.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/qtvcp/lib/qtplasmac/conv_triangle.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/qtvcp/lib/qtplasmac/conv_triangle.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "d4e39934f8211df718b6a65d286852cee557e23a76584e8a7774a1e1df69c912", "bytes": 7703, "tokens": 3079, "text": "'''\nconv_triangle.py\n\nCopyright (C) 2020, 2021, 2022 Phillip A Carter\nCopyright (C) 2020, 2021, 2022 Gregory D Carl\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program; if not, write to the Free Software Foundation, Inc.,\n51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n'''\n\nfrom PyQt5.QtCore import Qt, QCoreApplication\nfrom PyQt5.QtWidgets import QMessageBox\nfrom importlib import reload\nfrom plasmac import triangle as TRIANGLE\n\n_translate = QCoreApplication.translate\n\ndef preview(P, W, Conv):\n if P.dialogError:\n return\n if not W.xsEntry.text():\n W.xsEntry.setText('{:0.3f}'.format(P.xOrigin))\n if not W.ysEntry.text():\n W.ysEntry.setText('{:0.3f}'.format(P.yOrigin))\n error = TRIANGLE.preview(Conv, P.fTmp, P.fNgc, P.fNgcBkp, \\\n int(W.conv_material.currentText().split(':')[0]), \\\n W.conv_material.currentText().split(':')[1].strip(), \\\n P.preAmble, P.postAmble, \\\n W.liEntry.text(), W.loEntry.text(), \\\n W.xsEntry.text(), W.ysEntry.text(), \\\n W.kerf_width.value(), P.intExt, \\\n W.AaEntry.text(), W.BaEntry.text(), W.CaEntry.text(), \\\n W.AlEntry.text(), W.BlEntry.text(), W.ClEntry.text(), \\\n W.aEntry.text())\n if error:\n P.dialogError = True\n P.dialog_show_ok(QMessageBox.Warning, _translate('Conversational', 'Triangle Error'), error)\n else:\n W.conv_preview.load(P.fNgc)\n W.conv_preview.set_current_view()\n W.add.setEnabled(True)\n W.undo.setEnabled(True)\n Conv.conv_preview_button(P, W, True)\n\ndef auto_preview(P, W, Conv, button=False):\n if button == 'intext':\n if not W.intExt.isChecked():\n return\n Conv.conv_auto_preview_button(P, W, button)\n elif button == 'center':\n if not W.centLeft.isChecked():\n return\n Conv.conv_auto_preview_button(P, W, button)\n if W.main_tab_widget.currentIndex() == 1 and \\\n ((W.AaEntry.text() and W.BaEntry.text() and W.CaEntry.text() and \\\n (W.AlEntry.text() or W.BlEntry.text() or W.ClEntry.text())) or \\\n (W.AaEntry.text() and W.BlEntry.text() and W.ClEntry.text()) or \\\n (W.AlEntry.text() and W.BaEntry.text() and W.ClEntry.text()) or \\\n (W.AlEntry.text() and W.BlEntry.text() and W.CaEntry.text()) or \\\n (W.AlEntry.text() and W.BlEntry.text() and W.ClEntry.text())):\n preview(P, W, Conv)\n\ndef entry_changed(P, W, Conv, widget):\n Conv.conv_entry_changed(P, W, widget)\n\ndef widgets(P, W, Conv):\n if P.developmentPin.get():\n reload(TRIANGLE)\n W.lDesc.setText(_translate('Conversational', 'CREATING TRIANGLE'))\n W.iLabel.setPixmap(P.conv_triangle_l)\n #alignment and size\n rightAlign = ['ctLabel', 'xsLabel', 'xsEntry', 'ysLabel', 'ysEntry', \\\n 'liLabel', 'liEntry', 'loLabel', 'loEntry', 'AaLabel', \\\n 'AaEntry', 'BaLabel', 'BaEntry', 'CaLabel', 'CaEntry', \\\n 'AlLabel', 'AlEntry', 'BlLabel', 'BlEntry', 'ClLabel', \\\n 'ClEntry', 'aLabel', 'aEntry']\n centerAlign = ['lDesc']\n rButton = ['intExt']\n pButton = ['preview', 'add', 'undo']\n for widget in rightAlign:\n W[widget].setAlignment(Qt.AlignRight | Qt.AlignVCenter)\n W[widget].setFixedWidth(80)\n W[widget].setFixedHeight(24)\n for widget in centerAlign:\n W[widget].setAlignment(Qt.AlignCenter | Qt.AlignBottom)\n W[widget].setFixedWidth(240)\n W[widget].setFixedHeight(24)\n for widget in rButton:\n W[widget].setFixedWidth(80)\n W[widget].setFixedHeight(24)\n for widget in pButton:\n W[widget].setFixedWidth(80)\n W[widget].setFixedHeight(24)\n #connections\n W.conv_material.currentTextChanged.connect(lambda:auto_preview(P, W, Conv))\n W.intExt.toggled.connect(lambda:auto_preview(P, W, Conv, 'intext'))\n W.preview.pressed.connect(lambda:preview(P, W, Conv))\n W.add.pressed.connect(lambda:Conv.conv_add_shape_to_file(P, W))\n W.undo.pressed.connect(lambda:Conv.conv_undo_shape(P, W))\n entries = ['xsEntry', 'ysEntry', 'liEntry', 'loEntry', 'AaEntry', 'BaEntry', \\\n 'CaEntry', 'AlEntry', 'BlEntry', 'ClEntry', 'aEntry']\n for entry in entries:\n W[entry].textChanged.connect(lambda:entry_changed(P, W, Conv, W.sender()))\n W[entry].returnPressed.connect(lambda:preview(P, W, Conv))\n #add to layout\n if P.landscape:\n W.entries.addWidget(W.ctLabel, 0, 0)\n W.entries.addWidget(W.intExt, 0, 1)\n W.entries.addWidget(W.xsLabel, 1, 0)\n W.entries.addWidget(W.xsEntry, 1, 1)\n W.entries.addWidget(W.ysLabel, 2, 0)\n W.entries.addWidget(W.ysEntry, 2, 1)\n W.entries.addWidget(W.liLabel, 3, 0)\n W.entries.addWidget(W.liEntry, 3, 1)\n W.entries.addWidget(W.loLabel, 4, 0)\n W.entries.addWidget(W.loEntry, 4, 1)\n W.entries.addWidget(W.AaLabel, 5, 0)\n W.entries.addWidget(W.AaEntry, 5, 1)\n W.entries.addWidget(W.BaLabel, 6, 0)\n W.entries.addWidget(W.BaEntry, 6, 1)\n W.entries.addWidget(W.CaLabel, 7, 0)\n W.entries.addWidget(W.CaEntry, 7, 1)\n W.entries.addWidget(W.AlLabel, 8, 0)\n W.entries.addWidget(W.AlEntry, 8, 1)\n W.entries.addWidget(W.BlLabel, 9, 0)\n W.entries.addWidget(W.BlEntry, 9, 1)\n W.entries.addWidget(W.ClLabel, 10, 0)\n W.entries.addWidget(W.ClEntry, 10, 1)\n W.entries.addWidget(W.aLabel, 11, 0)\n W.entries.addWidget(W.aEntry, 11, 1)\n W.entries.addWidget(W.preview, 12, 0)\n W.entries.addWidget(W.add, 12, 2)\n W.entries.addWidget(W.undo, 12, 4)\n W.entries.addWidget(W.lDesc, 13 , 1, 1, 3)\n W.entries.addWidget(W.iLabel, 0 , 2, 7, 3)\n else:\n W.entries.addWidget(W.conv_material, 0, 0, 1, 5)\n W.entries.addWidget(W.ctLabel, 1, 0)\n W.entries.addWidget(W.intExt, 1, 1)\n W.entries.addWidget(W.xsLabel, 2, 0)\n W.entries.addWidget(W.xsEntry, 2, 1)\n W.entries.addWidget(W.ysLabel, 2, 2)\n W.entries.addWidget(W.ysEntry, 2, 3)\n W.entries.addWidget(W.liLabel, 3, 0)\n W.entries.addWidget(W.liEntry, 3, 1)\n W.entries.addWidget(W.loLabel, 3, 2)\n W.entries.addWidget(W.loEntry, 3, 3)\n W.entries.addWidget(W.AaLabel, 4, 0)\n W.entries.addWidget(W.AaEntry, 4, 1)\n W.entries.addWidget(W.BaLabel, 4, 2)\n W.entries.addWidget(W.BaEntry, 4, 3)\n W.entries.addWidget(W.CaLabel, 5, 0)\n W.entries.addWidget(W.CaEntry, 5, 1)\n W.entries.addWidget(W.AlLabel, 6, 0)\n W.entries.addWidget(W.AlEntry, 6, 1)\n W.entries.addWidget(W.BlLabel, 6, 2)\n W.entries.addWidget(W.BlEntry, 6, 3)\n W.entries.addWidget(W.ClLabel, 7, 0)\n W.entries.addWidget(W.ClEntry, 7, 1)\n W.entries.addWidget(W.aLabel, 8, 0)\n W.entries.addWidget(W.aEntry, 8, 1)\n W.entries.addWidget(W.preview, 9, 0)\n W.entries.addWidget(W.add, 9, 2)\n W.entries.addWidget(W.undo, 9, 4)\n W.entries.addWidget(W.lDesc, 10 , 1, 1, 3)\n W.entries.addWidget(W.iLabel, 0 , 5, 7, 3)\n W.AaEntry.setFocus()\n P.convSettingsChanged = False\n"} {"id": "linuxcnc-source:lib/python/qtvcp/lib/ripper/gcode_ripper.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/qtvcp/lib/ripper/gcode_ripper.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/qtvcp/lib/ripper/gcode_ripper.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "e9cc1234f78d84ceaad4fdd0ea0d4b70b70c0e9adc9c427a92bbe5e9d2ba4276", "bytes": 293624, "tokens": 90119, "text": "#!/usr/bin/python3\n\"\"\"\n g-code_ripper G-Code-Ripper\n \n Copyright (C) <2013-2021> \n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n\n Version 0.01 Initial code\n\n Version 0.02 - Added feed rate scaling\n - Eliminated read abort on N codes (the N code line numbers are simply ignored now)\n\n Version 0.03 - Added ability to map X or Y axis moves to A or B rotary axis for cutting on a cylindrical surface.\n - Added more plot view orientation options\n\n Version 0.04 - Fixed bug relating to arcs without explicit g-codes (G2,G3) on each line\n - Added ability to have zero decimal places on feed rates\n \n Version 0.05 - Added \"Export\" to the g-code operations. Now g-code tool path data can be exported as DXF\n or CSV (Comma Separated Values) formatted files. With or without rapid motions.\n\n Version 0.06 - Fixed code to again automatically convert arcs to lines when raping code (auto conversion was broken in V0.5)\n - Fixed evaluation of equations using exponents \"**\"\n - Added Auto Probe to g-code operations\n \n Version 0.07 - Fixed bug in \"Auto Probe\" that caused an error when the Z offset is set to zero.\n - Modified code to make it compatible with Python 2.5\n\n Version 0.08 - Fixed bug in g-code wrapping resulting in mapping failure resulting from to zero length tool path.\n - Added logic for dealing with ambiguous start positions (when the tool position is not set by G0 commands before a G1, G2 or G3 command)\n - Added a warning pop-up message when assumptions are made about the tool starting position.\n - Fixed automatic conversion from arcs to lines when required by conversion type selected.\n\n Version 0.09 - Increased default decimal places to 1 for the feed rate. The adjusted feed rates for\n g-code mapped to a cylinder were being rounded to the nearest integer resulting in\n unpredictable cutting speeds.\n - Added the ability to save and read probe data files for auto-probing.\n\n Version 0.10 - Updated to be compatible with Python 3.x\n\n Version 0.11 - Fixed a minor bug that cause a failed file read in rare cases (tries to calculate square root of negative number)\n\n Version 0.12 - Updated the probe data file reading routine to be less sensitive to file formatting\n - Fixed error in probe Z offsets when using an external probe data file\n\n Version 0.13 - Changed \"Probe & Cut\" to add the \"Probe Z Safe\" value to the height of the rapid moves ensuring the tool does not crash\n - Fixed a bug in the conversion of arcs to lines when the arc spanned more than one Z value.\n \n Version 0.14 - Added dialog that allows users to skip over errors when reading g-code files\n - Fixed bug that prevented the feed rate to return to the input value after a rapid move in a split file until a G1 command was issued\n - Fixed bug that resulted in the feed rate being scaled at the z axis scale value\n - Fixed variable handling for some cases\n \n Version 0.16 - Added support for MACH4 auto-probing\n - Added pass through for G43 values\n - Fixed bug in splitting code\n \n Version 0.17 - Fixed low travel speed problem with rotary conversion\n - Updated icon\n \n Version 0.18 - Changed how height of rapid moves is calculated in adjusted g-code. No longer adds Z offset value to the rapid height.\n - Fixed problem that made the rapid height to high in adjusted g-code because the calculated maximum probe value would never go below zero.\n - Added option for selecting if all points are probed or just required points\n - Added option for selecting if probe data is saved when running probe and cut operation\n - G-code ripper no longer takes into account the rapid moved when determining the design size\n - Changed so G-Code Ripper does not try to load a file on startup.\n\n Version 0.19 - Changed autoprobe safe height calculation with MACH3/4 for \"Probe and Cut\" Mach was unable to perform the calculated height like LinuxCNC.\n\n Version 0.20 - Fixed problem that occurred when the Z position was not set by a rapid move before and X,Y move when probing.\n (It now uses the first Z position in the g-code for the z-safe for probe moves before a z position is specified.)\n\n Version 0.21 - Added option to disable the g-code path display (might speed things up for large g-code files\n - Fixed handling of G43 commands with G0 moves mixed in on the same line (who writes g-code like that anyway...)\n - Bounding box now displays when in auto-probe mode \n\n Version 0.22 - Added support for DDCS probing to file\n - Added pass through for G53 commands\n - Changed icon behavior\n - fixed problem with comments with parentheses inside parentheses\n - Fixed a small problem with Python 3.x\n\n\"\"\"\nversion = '0.22'\n\nimport sys\nVERSION = sys.version_info[0]\n\nif VERSION == 3:\n from tkinter import *\n from tkinter.filedialog import *\n import tkinter.messagebox\nelse:\n from Tkinter import *\n from tkFileDialog import *\n import tkMessageBox\n\nif VERSION < 3 and sys.version_info[1] < 6:\n def next(item):\n return item.next()\n\ntry:\n import psyco\n psyco.full()\n sys.stdout.write(\"(Psyco loaded)\\n\")\nexcept:\n pass\n \nfrom math import *\nimport os\nimport re\nimport binascii\nimport getopt\nimport webbrowser\nimport struct\n\n#import gcode_ripper_lib\n\nZero = 0.0000001\nSTOP_CALC = 0\n\n#Setting QUIET to True will stop almost all console messages\nQUIET = False\nDEBUG = False\n\n################################################################################\n# Function for outputting messages to different locations #\n# depending on what options are enabled #\n################################################################################\ndef fmessage(text,newline=True):\n global QUIET\n if (not QUIET):\n if newline==True:\n try:\n sys.stdout.write(text)\n sys.stdout.write(\"\\n\")\n except:\n pass\n else:\n try:\n sys.stdout.write(text)\n except:\n pass\n\n################################################################################\n# Debug Message Box #\n################################################################################\ndef debug_message(message):\n global DEBUG\n title = \"Debug Message\"\n if DEBUG:\n if VERSION == 3:\n tkinter.messagebox.showinfo(title,message)\n else:\n tkMessageBox.showinfo(title,message)\n pass\n \ndef message_box(title,message):\n if VERSION == 3:\n tkinter.messagebox.showinfo(title,message)\n else:\n tkMessageBox.showinfo(title,message)\n pass\n \ndef message_ask_ok_cancel(title, mess):\n if VERSION == 3:\n result=tkinter.messagebox.askokcancel(title, mess)\n else:\n result=tkMessageBox.askokcancel(title, mess)\n return result\n\n\ndef error_message(message):\n error_report = Toplevel(width=525,height=60)\n error_report.title(\"G-Code Ripper: G-Code Reading Errors\")\n error_report.iconname(\"G-Code Errors\")\n error_report.grab_set()\n return_value = StringVar()\n return_value.set(\"abort\")\n\n def Stop_Click(event):\n return_value.set(\"abort\")\n error_report.destroy()\n \n def Ignore_Click(event):\n return_value.set(\"ignore\")\n error_report.destroy()\n\n #Text Box\n Error_Frame = Frame(error_report)\n scrollbar = Scrollbar(Error_Frame, orient=VERTICAL)\n Error_Text = Text(Error_Frame, width=\"80\", height=\"20\",yscrollcommand=scrollbar.set,bg='white')\n for line in message:\n Error_Text.insert(END,line+\"\\n\")\n scrollbar.config(command=Error_Text.yview)\n scrollbar.pack(side=RIGHT,fill=Y)\n #End Text Box\n\n Button_Frame = Frame(error_report)\n stop_button = Button(Button_Frame,text=\"Abort G-Code Reading\")\n stop_button.bind(\"\", Stop_Click)\n ignore_button = Button(Button_Frame,text=\"Ignore Errors\")\n ignore_button.bind(\"\", Ignore_Click)\n stop_button.pack(side=RIGHT,fill=X)\n ignore_button.pack(side=LEFT,fill=X)\n\n Error_Text.pack(side=LEFT,fill=BOTH,expand=1)\n Button_Frame.pack(side=BOTTOM)\n Error_Frame.pack(side=LEFT,fill=BOTH,expand=1)\n \n root.wait_window(error_report)\n return return_value.get()\n\n#Define cmp_new, cmp replacement for Python 3 compatibility\ndef cmp_new(A,B):\n if A==B:\n return False\n else:\n return True\n \n############################################################################\n# routine takes an x and a y coords and does a coordinate transformation #\n# to a new coordinate system at angle from the initial coordinate system #\n# Returns new x,y tuple #\n############################################################################\ndef Transform(x,y,angle):\n newx = x * cos(angle) - y * sin(angle)\n newy = x * sin(angle) + y * cos(angle)\n return newx,newy\n\n############################################################################\n# routine takes an sin and cos and returns the angle (between 0 and 360) #\n############################################################################\ndef Get_Angle(y,x):\n angle = 90.0-degrees(atan2(x,y))\n if angle < 0:\n angle = 360 + angle\n return angle\n \n################################################################################\nclass Line:\n def __init__(self, coords):\n self.xstart, self.ystart, self.xend, self.yend = coords\n self.xmax = max(self.xstart, self.xend)\n self.ymax = max(self.ystart, self.yend)\n self.ymin = min(self.ystart, self.yend)\n\n def __repr__(self):\n return \"Line([%s, %s, %s, %s])\" % (self.xstart, self.ystart, self.xend, self.yend)\n\n################################################################################\nclass Application(Frame):\n def __init__(self, master):\n Frame.__init__(self, master)\n self.w = 780\n self.h = 490\n frame = Frame(master, width= self.w, height=self.h)\n self.master = master\n self.x = -1\n self.y = -1\n #self.g_rip = gcode_ripper_lib.G_Code_Rip()\n self.g_rip = G_Code_Rip()\n self.createWidgets()\n \n def createWidgets(self):\n self.initComplete = 0\n self.master.bind(\"\", self.Master_Configure)\n self.master.bind('', self.bindConfigure)\n #self.master.bind('', self.KEY_ESC)\n self.master.bind('', self.KEY_F1)\n self.master.bind('', self.KEY_F2)\n self.master.bind('', self.KEY_F5) #self.Recalculate_Click)\n self.master.bind('', self.KEY_ZOOM_IN) # Page Up\n self.master.bind('', self.KEY_ZOOM_OUT) # Page Down\n self.master.bind('', self.KEY_CTRL_G)\n \n self.show_axis = BooleanVar() \n self.show_box = BooleanVar()\n self.show_path = BooleanVar()\n \n self.rotateb = BooleanVar()\n self.plot_view = StringVar() \n \n self.arc2line = BooleanVar()\n self.var_dis = BooleanVar()\n self.WriteAll = BooleanVar()\n self.NoComments = BooleanVar()\n \n self.SCALEXY = StringVar()\n self.SCALEZ = StringVar()\n self.ROTATE = StringVar()\n self.SCALEF = StringVar()\n\n self.gcode_op = StringVar()\n \n self.SPLITA = StringVar()\n self.SPLITX = StringVar()\n self.SPLITY = StringVar()\n self.ZSAFE = StringVar()\n\n self.WRAP_DIA = StringVar()\n self.WRAP_TYPE = StringVar()\n self.WRAP_FSCALE= StringVar()\n\n self.EXP_TYPE = StringVar()\n self.Exp_Rapids = BooleanVar()\n\n self.origin = StringVar()\n self.units = StringVar()\n self.segarc = StringVar()\n self.accuracy = StringVar()\n self.funits = StringVar()\n self.FEED = StringVar()\n \n self.gpre = StringVar()\n self.gpost = StringVar()\n\n self.DPlaces_L = StringVar()\n self.DPlaces_R = StringVar()\n self.DPlaces_F = StringVar()\n\n\n self.sr_tool_dia= StringVar()\n self.sr_step = StringVar()\n self.sr_minx = StringVar()\n self.sr_maxx = StringVar()\n self.sr_zsafe = StringVar()\n self.sr_feed = StringVar()\n self.sr_remove = StringVar()\n self.sr_plungef = StringVar()\n self.SRmin_label= StringVar()\n self.SRmax_label= StringVar()\n self.sr_climb = BooleanVar()\n self.Wrap_Rev_Rot = BooleanVar()\n\n self.probe_feed = StringVar()\n self.probe_depth = StringVar()\n self.probe_safe = StringVar()\n self.probe_nX = StringVar()\n self.probe_nY = StringVar()\n #self.probe_xPartitionLength = StringVar()\n #self.probe_yPartitionLength = StringVar()\n \n self.probe_istep = StringVar()\n self.probe_offsetX = StringVar()\n self.probe_offsetY = StringVar()\n self.probe_offsetZ = StringVar()\n self.probe_precodes= StringVar()\n self.probe_pcodes = StringVar()\n self.probe_soft = StringVar()\n self.probe_points = StringVar()\n self.savepts = BooleanVar()\n\n self.current_input_file = StringVar()\n \n ###########################################################################\n # INITIALIZE VARIABLES #\n # if you want to change a default setting this is the place to do it #\n ###########################################################################\n self.show_axis.set(1)\n self.show_box.set(1)\n self.show_path.set(1)\n self.rotateb.set(0)\n self.arc2line.set(0)\n self.var_dis.set(1)\n\n self.plot_view.set(\"XY\") \n self.SCALEXY.set(\"100\")\n self.SCALEZ.set(\"100\")\n self.SCALEF.set(\"100\")\n\n self.gcode_op.set(\"split\")\n self.SPLITA.set(\"0.0\")\n self.SPLITX.set(\"0.0\")\n self.SPLITY.set(\"0.0\")\n self.ZSAFE.set(\"0.25\") \n self.ROTATE.set(\"0.0\")\n\n\n self.WRAP_DIA.set(\"10.0\")\n self.WRAP_TYPE.set(\"Y2A\") # Options are: \"Y2A\",\"X2B\",\"Y2B\",\"X2A\"\n self.WRAP_FSCALE.set(\"Scale-Rotary\") # Options are: \"Scale-Rotary\", \"None\"\n \n self.EXP_TYPE.set(\"DXF\")\n self.Exp_Rapids.set(1)\n\n\n self.origin.set(\"Default\") # Options are \"Default\",\n # \"Top-Left\", \"Top-Center\", \"Top-Right\",\n # \"Mid-Left\", \"Mid-Center\", \"Mid-Right\",\n # \"Bot-Left\", \"Bot-Center\", \"Bot-Right\" \n \n self.units.set(\"in\") # Options are \"in\" and \"mm\"\n self.FEED.set(\"5.0\")\n\n self.segarc.set(\"5.0\")\n self.accuracy.set(\"0.001\")\n\n self.DPlaces_L.set(\"4\")\n self.DPlaces_R.set(\"3\")\n self.DPlaces_F.set(\"2\")\n self.WriteAll.set(0)\n self.NoComments.set(0)\n\n\n self.sr_tool_dia.set(\"0.25\")\n self.sr_step.set(\"25\")\n self.sr_minx.set(\"0\")\n self.sr_maxx.set(\"3\")\n self.sr_zsafe.set(\".5\")\n self.sr_remove.set(\"-0.05\")\n self.sr_feed.set(\"10\")\n self.sr_plungef.set(\"5\")\n self.sr_climb.set(0)\n self.Wrap_Rev_Rot.set(0)\n\n\n self.probe_feed.set(\"5\")\n self.probe_depth.set(\"-.5\")\n self.probe_safe.set(\".25\")\n self.probe_nX.set(\"3\")\n self.probe_nY.set(\"3\")\n self.probe_istep.set(\"4\")\n self.probe_offsetX.set(\"0.0\")\n self.probe_offsetY.set(\"0.0\")\n self.probe_offsetZ.set(\"0.0\")\n self.probe_precodes.set(\"(G Code)\")\n self.probe_pcodes.set(\"(G Code)\")\n self.probe_soft.set(\"LinuxCNC\") # \"LinuxCNC\", \"MACH3\", \"MACH4\" or \"DDCS\"\n self.probe_points.set(\"All\") #\"All\". \"Required\"\n self.savepts.set(1)\n\n self.segID = []\n self.gcode = []\n self.coords = []\n self.probe_data = []\n \n self.MAXX = 0\n self.MINX = 0\n self.MAXY = 0\n self.MINY = 0\n self.MAXZ = 0\n self.MINZ = 0\n self.HOME_DIR = os.path.expanduser(\"~\")\n self.NGC_OUTPUT = (self.HOME_DIR+\"/None\")\n self.NGC_INPUT = (self.HOME_DIR+\"/None\")\n self.PROBE_INPUT = (self.HOME_DIR+\"/None\")\n self.current_input_file.set(\" \")\n \n # PAN and ZOOM STUFF\n self.panx = 0\n self.panx = 0\n self.lastx = 0\n self.lasty = 0\n \n # Derived variables\n \n if self.units.get() == 'in':\n self.funits.set('in/min')\n else:\n self.units.set('mm')\n self.funits.set('mm/min')\n \n ##########################################################################\n # G-Code Default Preamble #\n ##########################################################################\n self.gpre.set(\"(G-Code Preamble)\")\n ##########################################################################\n # G-Code Default Postamble #\n ##########################################################################\n self.gpost.set(\"(G-Code Postamble)\")\n \n ##########################################################################\n ### END INITIALIZING VARIABLES ###\n ##########################################################################\n self.config_file = \"g-code-ripper_config.ngc\"\n home_config1 = self.HOME_DIR + \"/\" + self.config_file\n config_file2 = \".gcoderipperrc\"\n home_config2 = self.HOME_DIR + \"/\" + config_file2\n if ( os.path.isfile(self.config_file) ):\n self.Open_Config_File(self.config_file)\n elif ( os.path.isfile(home_config1) ):\n self.Open_Config_File(home_config1)\n elif ( os.path.isfile(home_config2) ):\n self.Open_Config_File(home_config2)\n\n opts, args = None, None\n try:\n opts, args = getopt.getopt(sys.argv[1:], \"hg:c:d:\",[\"help\", \"gcode_file=\",\"config_file=\",\"defdir=\"])\n except:\n fmessage('Unable interpret command line options')\n sys.exit()\n for option, value in opts:\n if option in ('-h','--help'):\n fmessage(' ')\n fmessage('Usage: python g-code-ripper.py [-g file | -d directory ]')\n fmessage('-c : config file to read (also --config_file)')\n fmessage('-g : gcode file to read (also --gcode_file)')\n fmessage('-d : default directory (also --defdir)')\n fmessage('-h : print this help (also --help)\\n')\n sys.exit()\n if option in ('-g','--gcode_file'):\n self.Open_G_Code_File(value,Refresh=False)\n self.NGC_INPUT = value\n if option in ('-c','--config_file'):\n self.Open_Config_File(value)\n if option in ('-d','--defdir'):\n self.HOME_DIR = value\n if str.find(self.NGC_OUTPUT,'/None') != -1:\n self.NGC_OUTPUT = (self.HOME_DIR+\"/None\")\n if str.find(self.NGC_INPUT,'/None') != -1:\n self.NGC_INPUT = (self.HOME_DIR+\"/None\")\n \n ##########################################################################\n\n # make a Status Bar\n self.statusMessage = StringVar()\n self.statusMessage.set(\"\")\n self.statusbar = Label(self.master, textvariable=self.statusMessage, \\\n bd=1, relief=SUNKEN , height=1)\n self.statusbar.pack(anchor=SW, fill=X, side=BOTTOM)\n self.statusMessage.set(\"Welcome to G-Code-Ripper\")\n\n # Buttons\n self.Recalculate = Button(self.master,text=\"Recalculate\")\n self.Recalculate.bind(\"\", self.Recalculate_Click)\n\n self.WriteBaseButton = Button(self.master,text=\"Save G-Code File - Base\",\n command=self.menu_File_Save_G_Code_Base)\n \n self.WriteRightButton = Button(self.master,text=\"Save G-Code File - White\",\n command=self.menu_File_Save_G_Code_Right)\n self.WriteLeftButton = Button(self.master,text=\"Save G-Code File - Black\",\n command=self.menu_File_Save_G_Code_Left)\n\n # Canvas\n lbframe = Frame( self.master )\n self.PreviewCanvas_frame = lbframe\n self.PreviewCanvas = Canvas(lbframe, width=self.w-525, \\\n height=self.h-200, background=\"grey75\")\n self.PreviewCanvas.pack(side=LEFT, fill=BOTH, expand=1)\n self.PreviewCanvas_frame.place(x=230, y=10)\n \n self.PreviewCanvas.bind(\"\" , self._mouseZoomIn)\n self.PreviewCanvas.bind(\"\" , self._mouseZoomOut)\n self.PreviewCanvas.bind(\"<2>\" , self.mousePanStart)\n self.PreviewCanvas.bind(\"\", self.mousePan)\n self.PreviewCanvas.bind(\"<1>\" , self.mouseZoomStart)\n self.PreviewCanvas.bind(\"\", self.mouseZoom)\n self.PreviewCanvas.bind(\"<3>\" , self.mousePanStart)\n self.PreviewCanvas.bind(\"\", self.mousePan)\n\n # Left Column #\n #----------------------\n self.Label_Gcode_Operations = Label(self.master,text=\"G-Code Base Operations:\", anchor=W)\n \n self.Label_GscaleXY = Label(self.master,text=\"Scale XY\", anchor=CENTER)\n self.Label_GscaleXY_u = Label(self.master,text=\"%\", anchor=W)\n self.Entry_GscaleXY = Entry(self.master,width=\"15\")\n self.Entry_GscaleXY.configure(textvariable=self.SCALEXY)\n self.Entry_GscaleXY.bind('', self.Recalculate_Click)\n self.SCALEXY.trace_variable(\"w\", self.Entry_GscaleXY_Callback)\n self.NormalColor = self.Entry_GscaleXY.cget('bg')\n\n\n self.Label_GscaleZ = Label(self.master,text=\"Scale Z\", anchor=CENTER)\n self.Label_GscaleZ_u = Label(self.master,text=\"%\", anchor=W)\n self.Entry_GscaleZ = Entry(self.master,width=\"15\")\n self.Entry_GscaleZ.configure(textvariable=self.SCALEZ)\n self.Entry_GscaleZ.bind('', self.Recalculate_Click)\n self.SCALEZ.trace_variable(\"w\", self.Entry_GscaleZ_Callback)\n self.NormalColor = self.Entry_GscaleZ.cget('bg')\n\n self.Label_GscaleF = Label(self.master,text=\"Scale Feed\", anchor=CENTER)\n self.Label_GscaleF_u = Label(self.master,text=\"%\", anchor=W)\n self.Entry_GscaleF = Entry(self.master,width=\"15\")\n self.Entry_GscaleF.configure(textvariable=self.SCALEF)\n self.Entry_GscaleF.bind('', self.Recalculate_Click)\n self.SCALEF.trace_variable(\"w\", self.Entry_GscaleF_Callback)\n self.NormalColor = self.Entry_GscaleF.cget('bg')\n \n self.Label_Rotate = Label(self.master,text=\"Rotate\")\n self.Label_Rotate_u = Label(self.master,text=\"deg\", anchor=W)\n self.Entry_Rotate = Entry(self.master,width=\"15\")\n self.Entry_Rotate.configure(textvariable=self.ROTATE)\n self.Entry_Rotate.bind('', self.Recalculate_Click)\n self.ROTATE.trace_variable(\"w\", self.Entry_Rotate_Callback)\n\n self.Label_Origin = Label(self.master,text=\"Origin\", anchor=CENTER )\n self.Origin_OptionMenu = OptionMenu(root, self.origin,\n \"Top-Left\",\n \"Top-Center\",\n \"Top-Right\",\n \"Mid-Left\",\n \"Mid-Center\",\n \"Mid-Right\",\n \"Bot-Left\",\n \"Bot-Center\",\n \"Bot-Right\",\n \"Default\", command=self.Recalculate_RQD_Click)\n #----------------------\n self.Label_view_opt = Label(self.master,text=\"View Plane:\", anchor=W)\n self.Radio_View_XY = Radiobutton(self.master,text=\"XY\", value=\"XY\",\n width=\"100\", anchor=W)\n self.Radio_View_XY.configure(variable=self.plot_view)\n self.Radio_View_XZ = Radiobutton(self.master,text=\"XZ\", value=\"XZ\",\n width=\"100\", anchor=W)\n self.Radio_View_XZ.configure(variable=self.plot_view)\n self.Radio_View_YZ = Radiobutton(self.master,text=\"YZ\", value=\"YZ\",\n width=\"100\", anchor=W)\n self.Radio_View_YZ.configure(variable=self.plot_view)\n self.Radio_View_ISO1 = Radiobutton(self.master,text=\"ISO1\", value=\"ISO1\",\n width=\"100\", anchor=W)\n self.Radio_View_ISO1.configure(variable=self.plot_view)\n self.Radio_View_ISO2 = Radiobutton(self.master,text=\"ISO2\", value=\"ISO2\",\n width=\"100\", anchor=W)\n self.Radio_View_ISO2.configure(variable=self.plot_view)\n self.Radio_View_ISO3 = Radiobutton(self.master,text=\"ISO3\", value=\"ISO3\",\n width=\"100\", anchor=W)\n self.Radio_View_ISO3.configure(variable=self.plot_view)\n self.plot_view.trace_variable(\"w\", self.menu_View_Refresh_Callback)\n\n\n #-----------------------\n self.Label_code_ops = Label(self.master,text=\"G-Code Operations:\", anchor=W)\n self.Radio_Gcode_None = Radiobutton(self.master,text=\"None\", value=\"none\",\n width=\"100\", anchor=W)\n self.Radio_Gcode_None.configure(variable=self.gcode_op )\n\n self.Radio_Gcode_Split = Radiobutton(self.master,text=\"Split\", value=\"split\",\n width=\"100\", anchor=W)\n self.Radio_Gcode_Split.configure(variable=self.gcode_op )\n \n self.Radio_Gcode_Wrap = Radiobutton(self.master,text=\"Wrap\", value=\"wrap\",\n width=\"100\", anchor=W)\n self.Radio_Gcode_Wrap.configure(variable=self.gcode_op )\n\n self.Radio_Gcode_Export = Radiobutton(self.master,text=\"Export (DXF, CSV)\", value=\"export\",\n width=\"100\", anchor=W)\n self.Radio_Gcode_Export.configure(variable=self.gcode_op )\n\n self.Radio_Gcode_Probe = Radiobutton(self.master,text=\"Auto Probe\", value=\"probe\",\n width=\"100\", anchor=W)\n self.Radio_Gcode_Probe.configure(variable=self.gcode_op )\n \n self.gcode_op.trace_variable(\"w\", self.Entry_recalc_var_Callback)\n\n \n # End Left Column #\n self.separator1 = Frame(height=2, bd=1, relief=SUNKEN)\n self.separator2 = Frame(height=2, bd=1, relief=SUNKEN)\n self.separator3 = Frame(height=2, bd=1, relief=SUNKEN)\n self.separator4 = Frame(height=2, bd=1, relief=SUNKEN)\n self.separator5 = Frame(height=2, bd=1, relief=SUNKEN)\n self.separator6 = Frame(height=2, bd=1, relief=SUNKEN)\n self.separator7 = Frame(height=2, bd=1, relief=SUNKEN)\n \n # Right Column #\n\n ### SPLIT ###\n self.Label_Gcode_Split_Properties = Label(self.master,text=\"G-Code Split Properties:\",\\\n anchor=W)\n \n self.Label_SplitX = Label(self.master,text=\"Split X Position\", anchor=CENTER )\n self.Label_SplitX_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_SplitX = Entry(self.master,width=\"15\")\n self.Entry_SplitX.configure(textvariable=self.SPLITX)\n self.Entry_SplitX.bind('', self.Recalculate_Click)\n self.SPLITX.trace_variable(\"w\", self.Entry_SplitX_Callback)\n\n self.Label_SplitY = Label(self.master,text=\"Split Y Position\", anchor=CENTER )\n self.Label_SplitY_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_SplitY = Entry(self.master,width=\"15\")\n self.Entry_SplitY.configure(textvariable=self.SPLITY)\n self.Entry_SplitY.bind('', self.Recalculate_Click)\n self.SPLITY.trace_variable(\"w\", self.Entry_SplitY_Callback)\n \n self.Label_SplitA = Label(self.master,text=\"Split Angle\", anchor=CENTER )\n self.Label_SplitA_u = Label(self.master,text=\"deg\", anchor=W)\n self.Entry_SplitA = Entry(self.master,width=\"15\")\n self.Entry_SplitA.configure(textvariable=self.SPLITA)\n self.Entry_SplitA.bind('', self.Recalculate_Click)\n self.SPLITA.trace_variable(\"w\", self.Entry_SplitA_Callback)\n\n self.Label_rotateb = Label(self.master,text=\"Rotate Black\")\n self.Checkbutton_rotateb = Checkbutton(self.master,text=\" \", anchor=W) \n self.Checkbutton_rotateb.configure(variable=self.rotateb)\n self.rotateb.trace_variable(\"w\", self.Entry_recalc_var_Callback)\n\n self.Label_gcode_opt = Label(self.master,text=\"G-Code Properties:\", anchor=W)\n \n self.Label_Feed = Label(self.master,text=\"Plunge Feed\")\n self.Label_Feed_u = Label(self.master,textvariable=self.funits, anchor=W)\n self.Entry_Feed = Entry(self.master,width=\"15\")\n self.Entry_Feed.configure(textvariable=self.FEED)\n self.Entry_Feed.bind('', self.Recalculate_Click)\n self.FEED.trace_variable(\"w\", self.Entry_Feed_Callback)\n\n self.Label_Zsafe = Label(self.master,text=\"Z Safe\")\n self.Label_Zsafe_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_Zsafe = Entry(self.master,width=\"15\")\n self.Entry_Zsafe.configure(textvariable=self.ZSAFE)\n self.Entry_Zsafe.bind('', self.Recalculate_Click)\n self.ZSAFE.trace_variable(\"w\", self.Entry_Zsafe_Callback)\n\n ### WRAP ###\n self.Label_Gcode_Wrap_Properties = Label(self.master,text=\"G-Code Wrap Properties:\",\\\n anchor=W)\n \n self.Label_Wrap_DIA = Label(self.master,text=\"Wrap Diameter\", anchor=CENTER )\n self.Label_Wrap_DIA_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_Wrap_DIA = Entry(self.master,width=\"15\")\n self.Entry_Wrap_DIA.configure(textvariable=self.WRAP_DIA)\n self.Entry_Wrap_DIA.bind('', self.Recalculate_Click)\n self.WRAP_DIA.trace_variable(\"w\", self.Entry_Wrap_DIA_Callback)\n\n self.Label_Radio_Wrap = Label(self.master,text=\"Axis Wrap Type:\", anchor=W)\n self.Radio_Wrap_Y2A = Radiobutton(self.master,text=\"Y-axis to A-axis\", value=\"Y2A\",\n width=\"100\", anchor=W)\n self.Radio_Wrap_Y2A.configure(variable=self.WRAP_TYPE ) \n self.Radio_Wrap_X2B = Radiobutton(self.master,text=\"X-axis to B-axis\", value=\"X2B\",\n width=\"100\", anchor=W)\n self.Radio_Wrap_X2B.configure(variable=self.WRAP_TYPE )\n self.Radio_Wrap_Y2B = Radiobutton(self.master,text=\"Y-axis to B-axis\", value=\"Y2B\",\n width=\"100\", anchor=W)\n self.Radio_Wrap_Y2B.configure(variable=self.WRAP_TYPE )\n self.Radio_Wrap_X2A = Radiobutton(self.master,text=\"X-axis to A-axis\", value=\"X2A\",\n width=\"100\", anchor=W)\n self.Radio_Wrap_X2A.configure(variable=self.WRAP_TYPE )\n self.WRAP_TYPE.trace_variable(\"w\", self.Entry_recalc_var_Callback)\n \n self.Label_WRAP_FSCALE = Label(self.master,text=\"Feed Adjust:\", anchor=W)\n self.WRAP_FSCALE_OptionMenu = OptionMenu(root, self.WRAP_FSCALE, \"Scale-Rotary\", \"None\")\n \n self.Label_WRAP_REV_ROT = Label(self.master,text=\"Reverse Rotary Axis\", anchor=W)\n self.Checkbutton_WRAP_REV_ROT = Checkbutton(self.master,text=\"\", anchor=W)\n self.Checkbutton_WRAP_REV_ROT.configure(variable=self.Wrap_Rev_Rot)\n\n self.WriteWrapButton = Button(self.master,text=\"Save G-Code File - Wrap\",\n command=self.menu_File_Save_G_Code_Wrap)\n \n self.WriteRoundButton = Button(self.master,text=\"Stock Rounding\",\n command=self.STOCK_Round_Window)\n\n ## Define \"Export\" mode input fields here\n self.Label_Gcode_Export_Properties = Label(self.master,text=\"Export Properties:\",\\\n anchor=W)\n\n self.Label_Radio_Export = Label(self.master,text=\"File Type:\", anchor=W)\n self.Radio_Export_DXF = Radiobutton(self.master,text=\"DXF\", value=\"DXF\",\n width=\"100\", anchor=W)\n self.Radio_Export_DXF.configure(variable=self.EXP_TYPE )\n \n self.Radio_Export_CSV = Radiobutton(self.master,text=\"CSV (text)\", value=\"CSV\",\n width=\"100\", anchor=W)\n self.Radio_Export_CSV.configure(variable=self.EXP_TYPE )\n self.WRAP_TYPE.trace_variable(\"w\", self.Entry_recalc_var_Callback)\n\n\n self.Label_EXP_RAPIDS = Label(self.master,text=\"Include Rapid Moves\", anchor=W)\n self.Checkbutton_EXP_RAPIDS = Checkbutton(self.master,text=\"\", anchor=W)\n self.Checkbutton_EXP_RAPIDS.configure(variable=self.Exp_Rapids)\n\n \n self.WriteExportButton = Button(self.master,text=\"Export File\",\n command=self.menu_File_Save_Export_Write)\n\n ### PROBE ###\n self.Label_Gcode_Probe_Properties = Label(self.master,text=\"Auto-Probe Properties:\",\\\n anchor=W)\n\n self.Label_ProbeOffsetX = Label(self.master,text=\"Probe X Offset\", anchor=CENTER )\n self.Label_ProbeOffsetX_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_ProbeOffsetX = Entry(self.master,width=\"15\")\n self.Entry_ProbeOffsetX.configure(textvariable=self.probe_offsetX)\n self.Entry_ProbeOffsetX.bind('', self.Recalculate_Click)\n self.probe_offsetX.trace_variable(\"w\", self.Entry_ProbeOffsetX_Callback)\n\n self.Label_ProbeOffsetY = Label(self.master,text=\"Probe Y Offset\", anchor=CENTER )\n self.Label_ProbeOffsetY_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_ProbeOffsetY = Entry(self.master,width=\"15\")\n self.Entry_ProbeOffsetY.configure(textvariable=self.probe_offsetY)\n self.Entry_ProbeOffsetY.bind('', self.Recalculate_Click)\n self.probe_offsetY.trace_variable(\"w\", self.Entry_ProbeOffsetY_Callback)\n\n self.Label_ProbeOffsetZ = Label(self.master,text=\"Probe Z Offset\", anchor=CENTER )\n self.Label_ProbeOffsetZ_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_ProbeOffsetZ = Entry(self.master,width=\"15\")\n self.Entry_ProbeOffsetZ.configure(textvariable=self.probe_offsetZ)\n self.Entry_ProbeOffsetZ.bind('', self.Recalculate_Click)\n self.probe_offsetZ.trace_variable(\"w\", self.Entry_ProbeOffsetZ_Callback)\n \n self.Label_ProbeSafe = Label(self.master,text=\"Probe Z Safe\")\n self.Label_ProbeSafe_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_ProbeSafe = Entry(self.master,width=\"15\")\n self.Entry_ProbeSafe.configure(textvariable=self.probe_safe)\n self.probe_safe.trace_variable(\"w\", self.Entry_ProbeSafe_Callback)\n\n self.Label_ProbeDepth = Label(self.master,text=\"Probe Depth\")\n self.Label_ProbeDepth_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_ProbeDepth = Entry(self.master,width=\"15\")\n self.Entry_ProbeDepth.configure(textvariable=self.probe_depth)\n self.Entry_ProbeDepth.bind('', self.Recalculate_Click)\n self.probe_depth.trace_variable(\"w\", self.Entry_ProbeDepth_Callback)\n\n self.Label_ProbeFeed = Label(self.master,text=\"Probe Feed\")\n self.Label_ProbeFeed_u = Label(self.master,textvariable=self.funits, anchor=W)\n self.Entry_ProbeFeed = Entry(self.master,width=\"15\")\n self.Entry_ProbeFeed.configure(textvariable=self.probe_feed)\n self.probe_feed.trace_variable(\"w\", self.Entry_ProbeFeed_Callback)\n \n self.Label_Probe_Num_X = Label(self.master,text=\"X Points\")\n self.Entry_Probe_Num_X = Entry(self.master,width=\"15\")\n self.Entry_Probe_Num_X.configure(textvariable=self.probe_nX)\n self.Entry_Probe_Num_X.bind('', self.Recalculate_Click)\n self.probe_nX.trace_variable(\"w\", self.Entry_probe_nX_Callback)\n\n self.Label_Probe_Num_Y = Label(self.master,text=\"Y Points\")\n self.Entry_Probe_Num_Y = Entry(self.master,width=\"15\")\n self.Entry_Probe_Num_Y.configure(textvariable=self.probe_nY)\n self.Entry_Probe_Num_Y.bind('', self.Recalculate_Click)\n self.probe_nY.trace_variable(\"w\", self.Entry_probe_nY_Callback)\n\n# self.Label_ProbeInterpSpace = Label(self.master,text=\"Interp. Steps\")\n# self.Entry_ProbeInterpSpace = Entry(self.master,width=\"15\")\n# self.Entry_ProbeInterpSpace.configure(textvariable=self.probe_istep)\n# self.probe_istep.trace_variable(\"w\", self.Entry_ProbeIStep_Callback)\n\n self.Label_ProbePreCodes = Label(self.master,text=\"Pre Probe\")\n self.Entry_ProbePreCodes = Entry(self.master,width=\"15\")\n self.Entry_ProbePreCodes.configure(textvariable=self.probe_precodes)\n\n self.Label_ProbePauseCodes = Label(self.master,text=\"Post Probe\")\n self.Label_ProbePauseCodes_u = Label(self.master,textvariable=self.units, anchor=W)\n self.Entry_ProbePauseCodes = Entry(self.master,width=\"15\")\n self.Entry_ProbePauseCodes.configure(textvariable=self.probe_pcodes)\n\n self.Label_ProbeSoft = Label(self.master,text=\"Controller:\", anchor=W)\n self.ProbeSoft_OptionMenu = OptionMenu(root, self.probe_soft, \"LinuxCNC\", \"MACH3\", \"MACH4\", \"DDCS\")\n\n self.Label_ProbePoints = Label(self.master,text=\"Probe Points:\", anchor=W)\n self.ProbePoints_OptionMenu = OptionMenu(root, self.probe_points, \"All\", \"Required\")\n \n self.Label_SavePoints = Label(self.master,text=\"Save Probe Data\")\n self.Checkbutton_SavePoints = Checkbutton(self.master,text=\" \", anchor=W) \n self.Checkbutton_SavePoints.configure(variable=self.savepts)\n\n \n self.WriteProbeOnlyButton = Button(self.master,text=\"Save G-Code File - Probe Only\",\n command=self.menu_File_Save_G_Code_ProbeOnly)\n \n self.ReadProbeButton = Button(self.master,text=\"Read Probe Data File\",\n command=self.menu_File_Read_Probe_data)\n\n self.ClearProbeButton = Button(self.master,text=\"Clear Probe Data\",\n command=self.menu_Clear_Probe_data)\n \n self.WriteAdjustedButton = Button(self.master,text=\"Save G-Code File - Adjusted\",\n command=self.menu_File_Save_G_Code_Adjusted)\n\n self.WriteProbeButton = Button(self.master,text=\"Save G-Code File - Probe & Cut\",\n command=self.menu_File_Save_G_Code_Probe_n_Cut)\n \n ############\n\n # End Right Column #\n\n #GEN Setting Window Entry initialization\n self.Entry_ArcAngle = Entry()\n self.Entry_Accuracy = Entry()\n self.Entry_DPlaces_L = Entry()\n self.Entry_DPlaces_R = Entry()\n self.Entry_DPlaces_F = Entry()\n \n\n # Make Menu Bar\n self.menuBar = Menu(self.master, relief = \"raised\", bd=2)\n \n self.top_File = Menu(self.menuBar, tearoff=0)\n self.top_File.add(\"command\", label = \"Open G-Code File\", \\\n command = self.menu_File_Open_G_Code_File)\n self.top_File.add(\"command\", label = \"Save G-Code File - Base\", \\\n command = self.menu_File_Save_G_Code_Base)\n #self.top_File.add(\"command\", label = \"Save G-Code File - Black\", \\\n # command = self.menu_File_Save_G_Code_Left)\n #self.top_File.add(\"command\", label = \"Save G-Code File - White\", \\\n # command = self.menu_File_Save_G_Code_Right)\n\n self.top_File.add(\"command\", label = \"Exit\", command = self.menu_File_Quit)\n self.menuBar.add(\"cascade\", label=\"File\", menu=self.top_File)\n\n self.top_Edit = Menu(self.menuBar, tearoff=0)\n self.top_Edit.add(\"command\", label = \"Copy G-Code Data to Clipboard - Base\", \\\n command = self.menu_CopyClipboard_GCode_Base)\n #self.top_Edit.add(\"command\", label = \"Copy G-Code Data to Clipboard - Black\", \\\n # command = self.menu_CopyClipboard_GCode_Left)\n #self.top_Edit.add(\"command\", label = \"Copy G-Code Data to Clipboard - White\", \\\n # command = self.menu_CopyClipboard_GCode_Right)\n \n self.menuBar.add(\"cascade\", label=\"Edit\", menu=self.top_Edit)\n\n self.top_View = Menu(self.menuBar, tearoff=0)\n self.top_View.add(\"command\", label = \"Recalculate\", command = self.menu_View_Recalculate)\n self.top_View.add_separator() \n\n self.top_View.add(\"command\", label = \"Zoom In \", command = self.menu_View_Zoom_in)\n self.top_View.add(\"command\", label = \"Zoom Out \", command = self.menu_View_Zoom_out)\n self.top_View.add(\"command\", label = \"Zoom Fit \", command = self.menu_View_Refresh)\n\n self.top_View.add_separator()\n \n self.top_View.add_checkbutton(label = \"Show Origin Axis\", variable=self.show_axis , \\\n command= self.menu_View_Refresh)\n self.top_View.add_checkbutton(label = \"Show Bounding Box\", variable=self.show_box , \\\n command= self.menu_View_Refresh)\n self.top_View.add_checkbutton(label = \"Plot G-code Path\", variable=self.show_path , \\\n command= self.menu_View_Refresh)\n self.menuBar.add(\"cascade\", label=\"View\", menu=self.top_View)\n\n self.top_Settings = Menu(self.menuBar, tearoff=0)\n self.top_Settings.add(\"command\", label = \"General Settings\", \\\n command = self.GEN_Settings_Window)\n \n self.menuBar.add(\"cascade\", label=\"Settings\", menu=self.top_Settings)\n\n self.top_Help = Menu(self.menuBar, tearoff=0)\n self.top_Help.add(\"command\", label = \"About\", command = self.menu_Help_About)\n self.top_Help.add(\"command\", label = \"Help (Web Page)\", command = self.menu_Help_Web)\n self.menuBar.add(\"cascade\", label=\"Help\", menu=self.top_Help)\n\n self.master.config(menu=self.menuBar)\n\n ## Load g-code file \n #self.Open_G_Code_File(self.NGC_INPUT,Refresh=False)\n \n \n \n################################################################################\n def entry_set(self, val2, calc_flag=0, new=0):\n if calc_flag == 0 and new==0:\n try:\n self.statusbar.configure( bg = 'yellow' )\n val2.configure( bg = 'yellow' )\n self.statusMessage.set(\" Recalculation required.\")\n except:\n pass\n elif calc_flag == 3:\n try:\n val2.configure( bg = 'red' )\n self.statusbar.configure( bg = 'red' )\n self.statusMessage.set(\" Value should be a number. \")\n except:\n pass\n elif calc_flag == 2:\n try:\n self.statusbar.configure( bg = 'red' )\n val2.configure( bg = 'red' )\n #self.statusMessage.set(message)\n except:\n pass\n elif (calc_flag == 0 or calc_flag == 1) and new==1 :\n try:\n self.statusbar.configure( bg = 'white' )\n self.statusMessage.set(\" \")\n val2.configure( bg = 'white' )\n except:\n pass\n elif (calc_flag == 1) and new==0 :\n try:\n self.statusbar.configure( bg = 'white' )\n self.statusMessage.set(\" \")\n val2.configure( bg = 'white' )\n except:\n pass\n\n \n elif (calc_flag == 0 or calc_flag == 1) and new==2:\n return 0\n return 1\n\n\n ################################################################################\n def Write_Config_File(self, event):\n config = []\n config.append('( Configuration File for G-Code Ripper-'+version+'.py widget )')\n config.append('( by Scorch - 2013-2021 )')\n config.append(\"(=========================================================)\")\n # BOOL\n config.append('(g-code_ripper_set show_axis %s )' %( int(self.show_axis.get()) ))\n config.append('(g-code_ripper_set show_box %s )' %( int(self.show_box.get()) ))\n config.append('(g-code_ripper_set show_path %s )' %( int(self.show_path.get()) ))\n config.append('(g-code_ripper_set rotateb %s )' %( int(self.rotateb.get()) ))\n config.append('(g-code_ripper_set arc2line %s )' %( int(self.arc2line.get()) ))\n config.append('(g-code_ripper_set var_dis %s )' %( int(self.var_dis.get()) ))\n config.append('(g-code_ripper_set WriteAll %s )' %( int(self.WriteAll.get()) ))\n config.append('(g-code_ripper_set NoComments %s )' %( int(self.NoComments.get()) ))\n config.append('(g-code_ripper_set Exp_Rapids %s )' %( int(self.Exp_Rapids.get()) ))\n config.append('(g-code_ripper_set savepts %s )' %( int(self.savepts.get()) ))\n \n # STRING.get()\n config.append('(g-code_ripper_set units %s )' %( self.units.get() ))\n config.append('(g-code_ripper_set SCALEXY %s )' %( self.SCALEXY.get() ))\n config.append('(g-code_ripper_set SCALEZ %s )' %( self.SCALEZ.get() ))\n config.append('(g-code_ripper_set SCALEF %s )' %( self.SCALEF.get() ))\n config.append('(g-code_ripper_set ROTATE %s )' %( self.ROTATE.get() ))\n config.append('(g-code_ripper_set SPLITA %s )' %( self.SPLITA.get() ))\n config.append('(g-code_ripper_set SPLITX %s )' %( self.SPLITX.get() ))\n config.append('(g-code_ripper_set SPLITY %s )' %( self.SPLITY.get() ))\n config.append('(g-code_ripper_set ZSAFE %s )' %( self.ZSAFE.get() ))\n config.append('(g-code_ripper_set origin %s )' %( self.origin.get() ))\n config.append('(g-code_ripper_set segarc %s )' %( self.segarc.get() ))\n config.append('(g-code_ripper_set accuracy %s )' %( self.accuracy.get() ))\n config.append('(g-code_ripper_set FEED %s )' %( self.FEED.get() ))\n config.append('(g-code_ripper_set GCODE_OP %s )' %( self.gcode_op.get() ))\n config.append('(g-code_ripper_set WRAP_DIA %s )' %( self.WRAP_DIA.get() ))\n config.append('(g-code_ripper_set WRAP_TYPE %s )' %( self.WRAP_TYPE.get()))\n config.append('(g-code_ripper_set WRAP_FSCALE %s )' %( self.WRAP_FSCALE.get()))\n config.append('(g-code_ripper_set EXP_TYPE %s )' %( self.EXP_TYPE.get()))\n \n config.append('(g-code_ripper_set DPlaces_L %s )' %( self.DPlaces_L.get() ))\n config.append('(g-code_ripper_set DPlaces_R %s )' %( self.DPlaces_R.get() ))\n config.append('(g-code_ripper_set DPlaces_F %s )' %( self.DPlaces_F.get() ))\n\n config.append('(g-code_ripper_set sr_tool_dia %s )' %( self.sr_tool_dia.get() ))\n config.append('(g-code_ripper_set sr_step %s )' %( self.sr_step.get() ))\n config.append('(g-code_ripper_set sr_minx %s )' %( self.sr_minx.get() ))\n config.append('(g-code_ripper_set sr_maxx %s )' %( self.sr_maxx.get() ))\n config.append('(g-code_ripper_set sr_zsafe %s )' %( self.sr_zsafe.get() ))\n config.append('(g-code_ripper_set sr_remove %s )' %( self.sr_remove.get() ))\n config.append('(g-code_ripper_set sr_feed %s )' %( self.sr_feed.get() ))\n config.append('(g-code_ripper_set sr_plungef %s )' %( self.sr_plungef.get() ))\n config.append('(g-code_ripper_set sr_climb %s )' %( int(self.sr_climb.get()) ))\n config.append('(g-code_ripper_set Wrap_Rev_Rot %s )' %( int(self.Wrap_Rev_Rot.get()) ))\n\n config.append('(g-code_ripper_set probe_feed %s )' %( self.probe_feed.get() ))\n config.append('(g-code_ripper_set probe_depth %s )' %( self.probe_depth.get() ))\n config.append('(g-code_ripper_set probe_safe %s )' %( self.probe_safe.get() ))\n config.append('(g-code_ripper_set probe_nX %s )' %( self.probe_nX.get() ))\n config.append('(g-code_ripper_set probe_nY %s )' %( self.probe_nY.get() ))\n config.append('(g-code_ripper_set probe_istep %s )' %( self.probe_istep.get() ))\n config.append('(g-code_ripper_set probe_offsetX %s )' %( self.probe_offsetX.get() ))\n config.append('(g-code_ripper_set probe_offsetY %s )' %( self.probe_offsetY.get() ))\n config.append('(g-code_ripper_set probe_offsetZ %s )' %( self.probe_offsetZ.get() ))\n config.append('(g-code_ripper_set probe_precodes \\042%s\\042 )' %( self.probe_precodes.get() ))\n config.append('(g-code_ripper_set probe_pcodes \\042%s\\042 )' %( self.probe_pcodes.get() ))\n config.append('(g-code_ripper_set probe_soft %s )' %( self.probe_soft.get() ))\n config.append('(g-code_ripper_set probe_points %s )' %( self.probe_points.get() ))\n\n config.append('(g-code_ripper_set gpre \\042%s\\042 )' %( self.gpre.get() ))\n config.append('(g-code_ripper_set gpost \\042%s\\042 )' %( self.gpost.get()))\n config.append('(g-code_ripper_set NGC_INPUT \\042%s\\042 )' %( self.NGC_INPUT ))\n config.append('(g-code_ripper_set NGC_OUTPUT \\042%s\\042 )' %( self.NGC_OUTPUT ))\n config.append(\"(=========================================================)\")\n \n configname_full = os.path.expanduser(\"~\")+\"/\"+self.config_file\n\n current_name = event.widget.winfo_parent()\n win_id = event.widget.nametowidget(current_name)\n \n if ( os.path.isfile(configname_full) ):\n try:\n win_id.withdraw()\n except:\n pass\n \n if not message_ask_ok_cancel(\"Replace\", \"Replace Exiting Configuration File?\\n\"+configname_full):\n try:\n win_id.deiconify()\n except:\n pass\n return \n try:\n fout = open(configname_full,'w')\n except:\n self.statusMessage.set(\"Unable to open file for writing: %s\" %(configname_full))\n self.statusbar.configure( bg = 'red' )\n return\n for line in config:\n try:\n fout.write(line+'\\n')\n except:\n fout.write('(skipping line)\\n')\n fout.close\n\n try:\n win_id.withdraw()\n win_id.deiconify()\n except:\n pass\n ################################################################################\n def Open_Config_File(self, filename):\n \n try:\n fin = open(filename,'r')\n except:\n fmessage(\"Unable to open file: %s\" %(filename))\n return\n \n text_codes=[]\n ident = \"g-code_ripper_set\"\n for line in fin:\n if ident in line:\n # BOOL\n if \"show_axis\" in line:\n self.show_axis.set(line[line.find(\"show_axis\"):].split()[1])\n if \"show_box\" in line:\n self.show_box.set(line[line.find(\"show_box\"):].split()[1])\n if \"show_path\" in line:\n self.show_path.set(line[line.find(\"show_path\"):].split()[1])\n if \"rotateb\" in line:\n self.rotateb.set(line[line.find(\"rotateb\"):].split()[1])\n if \"arc2line\" in line:\n self.arc2line.set(line[line.find(\"arc2line\"):].split()[1])\n if \"var_dis\" in line: \n self.var_dis.set(line[line.find(\"var_dis\"):].split()[1])\n if \"WriteAll\" in line: \n self.WriteAll.set(line[line.find(\"WriteAll\"):].split()[1])\n if \"NoComments\" in line: \n self.NoComments.set(line[line.find(\"NoComments\"):].split()[1])\n if \"Exp_Rapids\" in line: \n self.Exp_Rapids.set(line[line.find(\"Exp_Rapids\"):].split()[1])\n if \"savepts\" in line: \n self.savepts.set(line[line.find(\"savepts\"):].split()[1])\n\n\n elif \"units\" in line:\n self.units.set(line[line.find(\"units\"):].split()[1]) \n elif \"SCALEXY\" in line:\n self.SCALEXY.set(line[line.find(\"SCALEXY\"):].split()[1]) \n elif \"SCALEZ\" in line:\n self.SCALEZ.set(line[line.find(\"SCALEZ\"):].split()[1]) \n elif \"SCALEF\" in line:\n self.SCALEF.set(line[line.find(\"SCALEF\"):].split()[1])\n elif \"ROTATE\" in line:\n self.ROTATE.set(line[line.find(\"ROTATE\"):].split()[1])\n elif \"SPLITA\" in line:\n self.SPLITA.set(line[line.find(\"SPLITA\"):].split()[1])\n elif \"SPLITX\" in line:\n self.SPLITX.set(line[line.find(\"SPLITX\"):].split()[1])\n elif \"SPLITY\" in line:\n self.SPLITY.set(line[line.find(\"SPLITY\"):].split()[1])\n elif \"ZSAFE\" in line:\n self.ZSAFE.set(line[line.find(\"ZSAFE\"):].split()[1])\n elif \"origin\" in line:\n self.origin.set(line[line.find(\"origin\"):].split()[1])\n elif \"segarc\" in line:\n self.segarc.set(line[line.find(\"segarc\"):].split()[1])\n elif \"accuracy\" in line:\n self.accuracy.set(line[line.find(\"accuracy\"):].split()[1])\n elif \"FEED\" in line:\n self.FEED.set(line[line.find(\"FEED\"):].split()[1])\n elif \"GCODE_OP\" in line:\n self.gcode_op.set(line[line.find(\"GCODE_OP\"):].split()[1])\n elif \"WRAP_DIA\" in line:\n self.WRAP_DIA.set(line[line.find(\"WRAP_DIA\"):].split()[1])\n elif \"WRAP_TYPE\" in line:\n self.WRAP_TYPE.set(line[line.find(\"WRAP_TYPE\"):].split()[1])\n elif \"WRAP_FSCALE\" in line:\n self.WRAP_FSCALE.set(line[line.find(\"WRAP_FSCALE\"):].split()[1])\n elif \"EXP_TYPE\" in line:\n self.EXP_TYPE.set(line[line.find(\"EXP_TYPE\"):].split()[1])\n\n elif \"sr_tool_dia\" in line:\n self.sr_tool_dia.set(line[line.find(\"sr_tool_dia\"):].split()[1])\n elif \"sr_step\" in line:\n self.sr_step.set(line[line.find(\"sr_step\"):].split()[1])\n elif \"sr_minx\" in line:\n self.sr_minx.set(line[line.find(\"sr_minx\"):].split()[1])\n elif \"sr_maxx\" in line:\n self.sr_maxx.set(line[line.find(\"sr_maxx\"):].split()[1])\n elif \"sr_zsafe\" in line:\n self.sr_zsafe.set(line[line.find(\"sr_zsafe\"):].split()[1])\n elif \"sr_remove\" in line:\n self.sr_remove.set(line[line.find(\"sr_remove\"):].split()[1])\n elif \"sr_feed\" in line:\n self.sr_feed.set(line[line.find(\"sr_feed\"):].split()[1])\n elif \"sr_plungef\" in line:\n self.sr_plungef.set(line[line.find(\"sr_plungef\"):].split()[1])\n elif \"sr_climb\" in line:\n self.sr_climb.set(line[line.find(\"sr_climb\"):].split()[1])\n elif \"Wrap_Rev_Rot\" in line:\n self.Wrap_Rev_Rot.set(line[line.find(\"Wrap_Rev_Rot\"):].split()[1])\n\n elif \"DPlaces_L\" in line:\n self.DPlaces_L.set(line[line.find(\"DPlaces_L\"):].split()[1])\n elif \"DPlaces_R\" in line:\n self.DPlaces_R.set(line[line.find(\"DPlaces_R\"):].split()[1])\n elif \"DPlaces_F\" in line:\n self.DPlaces_F.set(line[line.find(\"DPlaces_F\"):].split()[1])\n\n elif \"probe_feed\" in line:\n self.probe_feed.set(line[line.find(\"probe_feed\"):].split()[1])\n elif \"probe_depth\" in line:\n self.probe_depth.set(line[line.find(\"probe_depth\"):].split()[1])\n elif \"probe_safe\" in line:\n self.probe_safe.set(line[line.find(\"probe_safe\"):].split()[1])\n elif \"probe_nX\" in line:\n self.probe_nX.set(line[line.find(\"probe_nX\"):].split()[1])\n elif \"probe_nY\" in line:\n self.probe_nY.set(line[line.find(\"probe_nY\"):].split()[1])\n elif \"probe_istep\" in line:\n self.probe_istep.set(line[line.find(\"probe_istep\"):].split()[1])\n elif \"probe_offsetX\" in line:\n self.probe_offsetX.set(line[line.find(\"probe_offsetX\"):].split()[1])\n elif \"probe_offsetY\" in line:\n self.probe_offsetY.set(line[line.find(\"probe_offsetY\"):].split()[1])\n elif \"probe_offsetZ\" in line:\n self.probe_offsetZ.set(line[line.find(\"probe_offsetZ\"):].split()[1])\n elif \"probe_precodes\" in line:\n self.probe_precodes.set(line[line.find(\"probe_precodes\"):].split(\"\\042\")[1])\n elif \"probe_pcodes\" in line:\n self.probe_pcodes.set(line[line.find(\"probe_pcodes\"):].split(\"\\042\")[1])\n elif \"probe_soft\" in line:\n self.probe_soft.set(line[line.find(\"probe_soft\"):].split()[1])\n elif \"probe_points\" in line:\n self.probe_points.set(line[line.find(\"probe_points\"):].split()[1])\n\n \n elif \"gpre\" in line:\n self.gpre.set(line[line.find(\"gpre\"):].split(\"\\042\")[1])\n elif \"gpost\" in line:\n self.gpost.set(line[line.find(\"gpost\"):].split(\"\\042\")[1])\n elif \"NGC_INPUT\" in line:\n self.NGC_INPUT=(line[line.find(\"NGC_INPUT\"):].split(\"\\042\")[1]) \n elif \"NGC_OUTPUT\" in line:\n self.NGC_OUTPUT=(line[line.find(\"NGC_OUTPUT\"):].split(\"\\042\")[1]) \n fin.close()\n \n if self.units.get() == 'in':\n self.funits.set('in/min')\n else:\n self.units.set('mm')\n self.funits.set('mm/min')\n\n if self.initComplete == 1:\n self.menu_Mode_Change()\n self.NGC_FILE = filename\n\n\n ################################################################################\n def File_Read_Probe_data(self, filename):\n try:\n fin = open(filename,'r')\n except:\n fmessage(\"Unable to open file: %s\" %(filename))\n return \n input_probe_data = []\n line_number = 0\n for line in fin:\n line_number = line_number+1\n if len(line.split(\"#\")) > 1:\n line = line.split(\"#\")[0]\n if len(line.split(\"//\")) > 1:\n line = line.split(\"//\")[0]\n \n delimiter = \"\"\n if len(line.split(\",\")) > 1:\n delimiter = \",\"\n elif len(line.split(\"\\t\")) > 1:\n line = line.replace(\"\\t\",\" \")\n delimiter = \" \"\n elif len(line.split(\" \")) > 1:\n delimiter = \" \"\n \n try:\n values_text = line.split(delimiter)\n values_text = list(filter(None, values_text)) #remove blank values\n except:\n values_text = \"\"\n \n if len(values_text) == 0:\n continue\n \n data_line = []\n if (len(values_text)<3):\n fmessage(\"Error reading probe data file: %s\" %(filename))\n fmessage(\"Less than three coordinates found for probe point.\")\n fmessage(\"Input line #%d: %s\" %(line_number,line))\n continue\n #return\n for cnt in range(0,3):\n try:\n value_text_mod= re.sub('[ XYZxyzABCabc]', '', values_text[cnt])\n data_line.append(float(value_text_mod))\n #data_line.append(float(values_text[cnt]))\n except:\n fmessage(\"Error reading probe data file: %s\" %(filename))\n fmessage(\"Could not convert input text to number value\")\n fmessage(\"Line #%d: Input text: %s\" %(line_number,values_text[cnt]))\n #print value_text_mod\n return\n input_probe_data.append(data_line)\n fin.close()\n\n if input_probe_data == []:\n fmessage(\"No probe data found in probe data file: %s\" %(filename))\n return\n \n len_probe_data = len(input_probe_data)\n probe_data_sortX = sorted(input_probe_data, key=lambda XYZ: XYZ[0])\n probe_data_sortY = sorted(input_probe_data, key=lambda XYZ: XYZ[1])\n\n #Find minimum and maximum X and Y probe values \n probe_minx = probe_data_sortX[0][0]\n probe_maxx = probe_data_sortX[len_probe_data-1][0]\n probe_miny = probe_data_sortY[0][1]\n probe_maxy = probe_data_sortY[len_probe_data-1][1]\n \n\n #Set arbitrary maximum number of divisions to prevent superfine mesh\n Nmax = 100 \n\n # Find the smallest Step in X direction\n Xsize=probe_maxx-probe_minx\n min_grid_size_x = Xsize/Nmax\n Xcurrent = probe_data_sortX[0][0]\n min_delta_x = probe_maxx-probe_minx\n for XYZ in probe_data_sortX:\n delta = XYZ[0]-Xcurrent\n if delta > min_grid_size_x and delta < min_delta_x:\n min_delta_x = delta\n \n # Find the smallest Step in Y direction\n Ysize=probe_maxy-probe_miny\n min_grid_size_y = Ysize/Nmax\n Ycurrent = probe_data_sortY[0][1]\n min_delta_y = probe_maxy-probe_miny\n for XYZ in probe_data_sortY:\n delta = XYZ[1]-Ycurrent\n if delta > min_grid_size_y and delta < min_delta_y:\n min_delta_y = delta\n \n # Set up a new uniform grid based on the probe points read in from file\n nX = int(1+round(Xsize/min_delta_x))\n nY = int(1+round(Ysize/min_delta_y)) \n self.probe_nX.set(nX)\n self.probe_nY.set(nY)\n\n large_dist_squared = Xsize*Xsize + Ysize*Ysize\n self.probe_data = []\n for Y in range(0,nY):\n for X in range(0,nX):\n Xpos = probe_minx + X*min_delta_x\n Ypos = probe_miny + Y*min_delta_y\n \n min_dsquared = large_dist_squared\n for probxy in input_probe_data:\n dx = Xpos-probxy[0]\n dy = Ypos-probxy[1]\n dsquared = dx*dx+dy*dy\n if dsquared < min_dsquared:\n min_dsquared = dsquared\n Zpos = probxy[2]\n self.probe_data.append([Xpos,Ypos,Zpos])\n \n self.DoIt()\n self.menu_View_Refresh()\n\n \n ################################################################################\n def WriteGCode(self,side=\"base\",Rstock=0.0,Wrap=\"XYZ\"):\n global Zero\n self.gcode=[]\n\n if side == \"round\":\n self.gcode = self.g_rip.generate_round_gcode(\n Lmin = float(self.sr_minx.get()),\n Lmax = float(self.sr_maxx.get()),\n cut_depth = float(self.sr_remove.get()),\n tool_dia = float(self.sr_tool_dia.get()),\n step_over = float(self.sr_step.get()),\n feed = float(self.sr_feed.get()),\n plunge_feed=float(self.sr_plungef.get()),\n z_safe=float(self.sr_zsafe.get()),\n no_variables=bool(self.var_dis.get()),\n Rstock=Rstock,\n Wrap=Wrap,\n preamble=self.gpre.get(),\n postamble=self.gpost.get(),\n PLACES_L=int(self.DPlaces_L.get()),\n PLACES_R=int(self.DPlaces_R.get()),\n PLACES_F=int(self.DPlaces_F.get()), \n climb_mill=bool(self.sr_climb.get()),\n Reverse_Rotary = bool(self.Wrap_Rev_Rot.get()),\n FSCALE=self.WRAP_FSCALE.get() )\n return\n ####\n \n elif side == \"base\":\n data = self.g_rip.scaled_trans\n gen_rapids = False\n ####\n elif side == \"left\":\n data = self.g_rip.left_side\n gen_rapids = True\n ####\n elif side == \"right\":\n data = self.g_rip.right_side\n gen_rapids = True\n\n\n if (side == \"probe_n_cut\") or (side == \"probe_only\") or (side ==\"probe_adjusted\"):\n gcode1 = []\n gcode2 = []\n #data = self.g_rip.probe_gcode\n if (side == \"probe_n_cut\") or (side == \"probe_only\"):\n if (side == \"probe_only\"):\n close_file=True\n else:\n close_file=False\n gcode1 = self.g_rip.generate_probing_gcode(self.g_rip.probe_coords,\n float(self.probe_safe.get()),\n float(self.probe_feed.get()),\n float(self.probe_depth.get()),\n pre_codes=self.probe_precodes.get(),\n pause_codes=self.probe_pcodes.get(),\n probe_offsetX=float(self.probe_offsetX.get()),\n probe_offsetY=float(self.probe_offsetY.get()),\n probe_offsetZ=float(self.probe_offsetZ.get()),\n probe_soft=self.probe_soft.get(),\n close_file = close_file,\n postamble=self.gpost.get(),\n savepts=self.savepts.get(),\n allpoints = self.probe_points.get()==\"All\")\n\n if (side == \"probe_n_cut\") or (side == \"probe_adjusted\"):\n gcode2 = self.g_rip.generategcode_probe(self.g_rip.probe_gcode,\n z_safe=float(self.ZSAFE.get()),\n plunge_feed=float(self.FEED.get()),\n no_variables=bool(self.var_dis.get()),\n Rstock=Rstock,\n Wrap=Wrap,\n preamble=self.gpre.get(),\n postamble=self.gpost.get(),\n PLACES_L=int(self.DPlaces_L.get()),\n PLACES_R=int(self.DPlaces_R.get()),\n PLACES_F=int(self.DPlaces_F.get()),\n WriteAll=bool(self.WriteAll.get()),\n FSCALE=self.WRAP_FSCALE.get(),\n Reverse_Rotary = bool(self.Wrap_Rev_Rot.get()),\n NoComments=bool(self.NoComments.get()),\n probe_data = self.probe_data,\n probe_offsetZ=float(self.probe_offsetZ.get()),\n probe_safe =float(self.probe_safe.get()) )\n self.gcode = gcode1 + gcode2\n \n else:\n self.gcode = self.g_rip.generategcode(data,\n z_safe=float(self.ZSAFE.get()),\n plunge_feed=float(self.FEED.get()),\n no_variables=bool(self.var_dis.get()),\n Rstock=Rstock,\n Wrap=Wrap,\n preamble=self.gpre.get(),\n postamble=self.gpost.get(),\n gen_rapids = gen_rapids,\n PLACES_L=int(self.DPlaces_L.get()),\n PLACES_R=int(self.DPlaces_R.get()),\n PLACES_F=int(self.DPlaces_F.get()),\n WriteAll=bool(self.WriteAll.get()),\n FSCALE=self.WRAP_FSCALE.get(),\n Reverse_Rotary = bool(self.Wrap_Rev_Rot.get()),\n NoComments=bool(self.NoComments.get()) )\n\n ################################################################################\n def WriteExportCode(self,filetype=\"DXF\",Rapids=True):\n global Zero\n self.gcode=[]\n \n if filetype == \"DXF\":\n data = self.g_rip.scaled_trans\n self.gcode = self.g_rip.generate_dxf_write_gcode(data,Rapids)\n elif filetype == \"CSV\":\n data = self.g_rip.scaled_trans\n self.gcode = self.g_rip.generate_csv_write_gcode(data,Rapids)\n return\n\n \n\n def menu_CopyClipboard_GCode_Base(self): \n self.CopyClipboard_GCode(\"base\")\n def menu_CopyClipboard_GCode_Left(self): \n self.CopyClipboard_GCode(\"left\")\n def menu_CopyClipboard_GCode_Right(self): \n self.CopyClipboard_GCode(\"right\")\n \n def CopyClipboard_GCode(self,side=\"base\"): \n self.clipboard_clear()\n if (self.Check_All_Variables() > 0):\n return\n self.WriteGCode(side)\n for line in self.gcode:\n self.clipboard_append(line+'\\n')\n\n def Quit_Click(self, event): \n self.statusMessage.set(\"Exiting!\")\n root.destroy()\n\n def ZOOM_ITEMS(self,x0,y0,z_factor):\n all = self.PreviewCanvas.find_all()\n for i in all:\n self.PreviewCanvas.scale(i, x0, y0, z_factor, z_factor)\n w=self.PreviewCanvas.itemcget(i,\"width\")\n self.PreviewCanvas.itemconfig(i, width=float(w)*z_factor)\n self.PreviewCanvas.update_idletasks()\n\n def ZOOM(self,z_inc):\n all = self.PreviewCanvas.find_all()\n x = int(self.PreviewCanvas.cget(\"width\" ))/2.0\n y = int(self.PreviewCanvas.cget(\"height\"))/2.0\n for i in all:\n self.PreviewCanvas.scale(i, x, y, z_inc, z_inc)\n w=self.PreviewCanvas.itemcget(i,\"width\")\n self.PreviewCanvas.itemconfig(i, width=float(w)*z_inc)\n self.PreviewCanvas.update_idletasks()\n\n def menu_View_Zoom_in(self):\n x = int(self.PreviewCanvas.cget(\"width\" ))/2.0\n y = int(self.PreviewCanvas.cget(\"height\"))/2.0\n self.ZOOM_ITEMS(x, y, 2.0)\n \n def menu_View_Zoom_out(self):\n x = int(self.PreviewCanvas.cget(\"width\" ))/2.0\n y = int(self.PreviewCanvas.cget(\"height\"))/2.0\n self.ZOOM_ITEMS(x, y, 0.5)\n\n def _mouseZoomIn(self,event):\n self.ZOOM_ITEMS(event.x, event.y, 1.25)\n \n def _mouseZoomOut(self,event):\n self.ZOOM_ITEMS(event.x, event.y, 0.75)\n\n def mouseZoomStart(self,event):\n self.zoomx0 = event.x\n self.zoomy = event.y\n self.zoomy0 = event.y\n\n def mouseZoom(self,event):\n dy = event.y-self.zoomy\n if dy < 0.0:\n self.ZOOM_ITEMS(self.zoomx0, self.zoomy0, 1.15)\n else:\n self.ZOOM_ITEMS(self.zoomx0, self.zoomy0, 0.85)\n self.lasty = self.lasty + dy\n self.zoomy = event.y\n\n def mousePanStart(self,event):\n self.panx = event.x\n self.pany = event.y\n\n def mousePan(self,event):\n all = self.PreviewCanvas.find_all()\n dx = event.x-self.panx\n dy = event.y-self.pany\n for i in all:\n self.PreviewCanvas.move(i, dx, dy)\n self.lastx = self.lastx + dx\n self.lasty = self.lasty + dy\n self.panx = event.x\n self.pany = event.y\n\n def Recalculate_Click(self, event):\n self.DoIt()\n\n def Settings_ReLoad_Click(self, event, arg1=\"\", arg2=\"\"):\n current_name = event.widget.winfo_parent()\n win_id = event.widget.nametowidget(current_name)\n self.Open_G_Code_File(self.NGC_INPUT,Refresh=True)\n try:\n win_id.withdraw()\n win_id.deiconify()\n except:\n pass\n \n ######################\n def Close_Current_Window_Click(self,event):\n current_name = event.widget.winfo_parent()\n win_id = event.widget.nametowidget(current_name)\n win_id.destroy()\n\n \n def Stop_Click(self, event):\n global STOP_CALC\n STOP_CALC=1\n\n # Left Column #\n #############################\n def Entry_GscaleXY_Check(self):\n try:\n value = float(self.SCALEXY.get())\n if value <= 0.0:\n self.statusMessage.set(\" Scale should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_GscaleXY_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_GscaleXY, self.Entry_GscaleXY_Check() )\n #############################\n def Entry_GscaleZ_Check(self):\n try:\n value = float(self.SCALEZ.get())\n if value <= 0.0:\n self.statusMessage.set(\" Scale should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_GscaleZ_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_GscaleZ, self.Entry_GscaleZ_Check() )\n #############################\n def Entry_GscaleF_Check(self):\n try:\n value = float(self.SCALEF.get())\n if value <= 0.0:\n self.statusMessage.set(\" Scale should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_GscaleF_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_GscaleF, self.Entry_GscaleF_Check() )\n ############################# \n def Entry_Rotate_Check(self):\n try:\n value = float(self.ROTATE.get())\n if value < -360.0 or value > 360.0:\n self.statusMessage.set(\" Angle should be between -360 and 360 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_Rotate_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_Rotate, self.Entry_Rotate_Check() ) \n ############################# \n def Entry_SplitA_Check(self):\n try:\n value = float(self.SPLITA.get())\n if value < -360.0 or value > 360.0:\n self.statusMessage.set(\" Angle should be between -360 and 360 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_SplitA_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SplitA, self.Entry_SplitA_Check() )\n ############################# \n def Entry_SplitX_Check(self):\n try:\n value = float(self.SPLITX.get())\n #if value < 0.0:\n # self.statusMessage.set(\" Radius should be greater than or equal to 0 \")\n # return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_SplitX_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SplitX, self.Entry_SplitX_Check() )\n\n ############################# \n def Entry_SplitY_Check(self):\n try:\n value = float(self.SPLITY.get())\n #if value < 0.0:\n # self.statusMessage.set(\" Radius should be greater than or equal to 0 \")\n # return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_SplitY_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SplitY, self.Entry_SplitY_Check() )\n \n # End Left Column #\n\n # Right Column #\n #############################\n def Entry_Feed_Check(self):\n try:\n value = float(self.FEED.get())\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number changes do not require recalc \n def Entry_Feed_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_Feed,self.Entry_Feed_Check())\n #############################\n def Entry_Zsafe_Check(self):\n try:\n value = float(self.ZSAFE.get())\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number changes do not require recalc \n def Entry_Zsafe_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_Zsafe,self.Entry_Zsafe_Check())\n\n\n ############################# \n def Entry_Wrap_DIA_Check(self):\n try:\n value = float(self.WRAP_DIA.get())\n if value < 0.0:\n self.statusMessage.set(\" Radius should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_Wrap_DIA_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_Wrap_DIA,self.Entry_Wrap_DIA_Check() )\n\n ############################# \n def Entry_probe_nX_Check(self):\n try:\n value = float(self.probe_nX.get())\n if value < 2.0:\n self.statusMessage.set(\" Value should be greater than or equal to 2\")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_probe_nX_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_Probe_Num_X,self.Entry_probe_nX_Check() )\n \n ############################# \n def Entry_probe_nY_Check(self):\n try:\n value = float(self.probe_nY.get())\n if value < 2.0:\n self.statusMessage.set(\" Value should be greater than or equal to 2\")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_probe_nY_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_Probe_Num_Y,self.Entry_probe_nY_Check() )\n \n ############################# \n def Entry_ProbeDepth_Check(self):\n try:\n value = float(self.probe_depth.get())\n if value > 0.0:\n self.statusMessage.set(\" Value should be less than or equal to 0.0\")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number\n def Entry_ProbeDepth_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ProbeDepth,self.Entry_ProbeDepth_Check() )\n\n #############################\n def Entry_ProbeOffsetX_Check(self):\n try:\n value = float(self.probe_offsetX.get())\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number changes do not require recalc \n def Entry_ProbeOffsetX_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ProbeOffsetX,self.Entry_ProbeOffsetX_Check())\n #############################\n def Entry_ProbeOffsetY_Check(self):\n try:\n value = float(self.probe_offsetY.get())\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number changes do not require recalc \n def Entry_ProbeOffsetY_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ProbeOffsetY,self.Entry_ProbeOffsetY_Check())\n #############################\n def Entry_ProbeOffsetZ_Check(self):\n try:\n value = float(self.probe_offsetZ.get())\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number changes do not require recalc \n def Entry_ProbeOffsetZ_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ProbeOffsetZ,self.Entry_ProbeOffsetZ_Check())\n\n\n \n #############################\n def Entry_ProbeSafe_Check(self):\n try:\n value = float(self.probe_safe.get())\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number changes do not require recalc \n def Entry_ProbeSafe_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ProbeSafe,self.Entry_ProbeSafe_Check())\n #############################\n def Entry_ProbeFeed_Check(self):\n try:\n value = float(self.probe_feed.get())\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number changes do not require recalc \n def Entry_ProbeFeed_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ProbeFeed,self.Entry_ProbeFeed_Check())\n #############################\n def Entry_ProbeIStep_Check(self):\n try:\n value = float(self.probe_istep.get())\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number changes do not require recalc \n def Entry_ProbeIStep_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ProbeInterpSpace,self.Entry_ProbeIStep_Check())\n #############################\n \n\n #############################\n # End Right Column #\n #############################\n \n ######################################\n # Settings Window Call Backs #\n ######################################\n #############################\n def Entry_ArcAngle_Check(self):\n try:\n value = float(self.segarc.get())\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_ArcAngle_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_ArcAngle,self.Entry_ArcAngle_Check())\n #############################\n def Entry_Accuracy_Check(self):\n try:\n value = float(self.accuracy.get())\n if value < 0.0:\n self.statusMessage.set(\" Accuracy should be greater than or equal to 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_Accuracy_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_Accuracy,self.Entry_Accuracy_Check())\n #############################\n def Entry_DPlaces_L_Check(self):\n try:\n value = int(self.DPlaces_L.get())\n if value < 1:\n self.statusMessage.set(\" Decimal places should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number \n def Entry_DPlaces_L_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_DPlaces_L,self.Entry_DPlaces_L_Check())\n #############################\n def Entry_DPlaces_R_Check(self):\n try:\n value = int(self.DPlaces_R.get())\n if value < 1:\n self.statusMessage.set(\" Decimal places should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number \n def Entry_DPlaces_R_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_DPlaces_R,self.Entry_DPlaces_R_Check())\n #############################\n def Entry_DPlaces_F_Check(self):\n try:\n value = int(self.DPlaces_F.get())\n if value < 0:\n self.statusMessage.set(\" Decimal places should be greater than or equal to 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 1 # Value is a valid number \n def Entry_DPlaces_F_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_DPlaces_F,self.Entry_DPlaces_F_Check())\n #############################\n\n\n ######################################\n # ROUNDING Window callbacks #\n ######################################\n #############################\n def Entry_SR_Tool_DIA_Check(self):\n try:\n value = float(self.sr_tool_dia.get())\n if value <= 0.0:\n self.statusMessage.set(\" Tool diameter should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_Tool_DIA_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_Tool_DIA,self.Entry_SR_Tool_DIA_Check(),1)\n\n \n #############################\n \n #############################\n def Entry_SR_Step_Check(self):\n try:\n value = float(self.sr_step.get())\n if value <= 0.0:\n self.statusMessage.set(\" Step over should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_Step_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_Step,self.Entry_SR_Step_Check(),1)\n #############################\n\n #############################\n def Entry_SR_Remove_Check(self):\n try:\n value = float(self.sr_remove.get())\n if value > 0.0:\n self.statusMessage.set(\" Stock to remove should be less than or equal to 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_Remove_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_Remove,self.Entry_SR_Remove_Check(),1)\n #############################\n\n #############################\n def Entry_SR_MIN_X_Check(self):\n try:\n value = float(self.sr_minx.get())\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_MIN_X_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_MIN_X,self.Entry_SR_MIN_X_Check(),1)\n #############################\n\n #############################\n def Entry_SR_MAX_X_Check(self):\n try:\n value = float(self.sr_maxx.get())\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_MAX_X_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_MAX_X,self.Entry_SR_MAX_X_Check(),1)\n #############################\n\n #############################\n def Entry_SR_ZSafe_Check(self):\n try:\n value = float(self.sr_zsafe.get())\n if value <= 0.0:\n self.statusMessage.set(\" Z safe should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_ZSafe_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_ZSafe,self.Entry_SR_ZSafe_Check(),1)\n \n #############################\n\n #############################\n def Entry_SR_Feed_Check(self):\n try:\n value = float(self.sr_feed.get())\n if value <= 0.0:\n self.statusMessage.set(\" Feed should be greater than 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_Feed_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_Feed,self.Entry_SR_Feed_Check(),1)\n #############################\n\n #############################\n def Entry_SR_PlungeFeed_Check(self):\n try:\n value = float(self.sr_plungef.get())\n if value < 0.0:\n self.statusMessage.set(\" Plunge feed should be greater than or equal to 0 \")\n return 2 # Value is invalid number\n except:\n return 3 # Value not a number\n return 0 # Value is a valid number \n def Entry_SR_PlungeFeed_Callback(self, varName, index, mode):\n self.entry_set(self.Entry_SR_PlungeFeed,self.Entry_SR_PlungeFeed_Check(),1)\n #############################\n\n\n ##########################################################################\n ##########################################################################\n def Check_All_Variables(self):\n MAIN_error_cnt= \\\n self.entry_set(self.Entry_GscaleXY, self.Entry_GscaleXY_Check() ,2) +\\\n self.entry_set(self.Entry_GscaleZ, self.Entry_GscaleZ_Check() ,2) +\\\n self.entry_set(self.Entry_GscaleF, self.Entry_GscaleF_Check() ,2) +\\\n self.entry_set(self.Entry_Rotate, self.Entry_Rotate_Check() ,2) +\\\n self.entry_set(self.Entry_SplitX, self.Entry_SplitX_Check() ,2) +\\\n self.entry_set(self.Entry_SplitY, self.Entry_SplitY_Check() ,2) +\\\n self.entry_set(self.Entry_SplitA, self.Entry_SplitA_Check() ,2) +\\\n self.entry_set(self.Entry_Feed, self.Entry_Feed_Check() ,2) +\\\n self.entry_set(self.Entry_Zsafe, self.Entry_Zsafe_Check() ,2) +\\\n self.entry_set(self.Entry_Wrap_DIA, self.Entry_Wrap_DIA_Check() ,2) +\\\n self.entry_set(self.Entry_Probe_Num_X,self.Entry_probe_nX_Check() ,2) +\\\n self.entry_set(self.Entry_Probe_Num_Y,self.Entry_probe_nY_Check() ,2) +\\\n self.entry_set(self.Entry_ProbeDepth, self.Entry_ProbeDepth_Check(),2)\n\n \n GEN_error_cnt= \\\n self.entry_set(self.Entry_Accuracy,self.Entry_Accuracy_Check() ,2) +\\\n self.entry_set(self.Entry_ArcAngle,self.Entry_ArcAngle_Check() ,2) +\\\n self.entry_set(self.Entry_DPlaces_L,self.Entry_DPlaces_L_Check(),2) +\\\n self.entry_set(self.Entry_DPlaces_R,self.Entry_DPlaces_R_Check(),2) +\\\n self.entry_set(self.Entry_DPlaces_F,self.Entry_DPlaces_F_Check(),2)\n\n try:\n SR_error_cnt= \\\n self.entry_set(self.Entry_SR_Tool_DIA,self.Entry_SR_Tool_DIA_Check() ,2) +\\\n self.entry_set(self.Entry_SR_Step,self.Entry_SR_Step_Check() ,2) +\\\n self.entry_set(self.Entry_SR_Remove,self.Entry_SR_Remove_Check() ,2) +\\\n self.entry_set(self.Entry_SR_MIN_X,self.Entry_SR_MIN_X_Check() ,2) +\\\n self.entry_set(self.Entry_SR_MAX_X,self.Entry_SR_MAX_X_Check() ,2) +\\\n self.entry_set(self.Entry_SR_ZSafe,self.Entry_SR_ZSafe_Check() ,2) +\\\n self.entry_set(self.Entry_SR_Feed,self.Entry_SR_Feed_Check() ,2) +\\\n self.entry_set(self.Entry_SR_PlungeFeed,self.Entry_SR_PlungeFeed_Check() ,2)\n except:\n SR_error_cnt = 0\n ERROR_cnt = MAIN_error_cnt + GEN_error_cnt + SR_error_cnt\n\n if (ERROR_cnt > 0):\n self.statusbar.configure( bg = 'red' )\n if (GEN_error_cnt > 0):\n self.statusMessage.set(\\\n \" Entry Error Detected: Check Entry Values in General Settings Window \")\n if (MAIN_error_cnt > 0):\n self.statusMessage.set(\\\n \" Entry Error Detected: Check Entry Values in Main Window \")\n if (SR_error_cnt > 0):\n self.statusMessage.set(\\\n \" Entry Error Detected: Check Entry Values in Stock Rounding Window (in Wrap mode) \")\n \n return ERROR_cnt \n\n ##########################################################################\n ##########################################################################\n\n\n def Entry_recalc_var_Callback(self, varName, index, mode):\n\n self.menu_Mode_Change()\n\n def Entry_units_var_Callback(self, varName, index, mode):\n if self.units.get() == 'in':\n self.funits.set('in/min')\n self.accuracy.set(\"0.001\")\n else:\n self.funits.set('mm/min')\n self.accuracy.set(\"0.025\")\n self.Open_G_Code_File(self.NGC_INPUT,Refresh=True)\n \n def menu_File_Open_G_Code_File(self):\n init_dir = os.path.dirname(self.NGC_INPUT)\n if ( not os.path.isdir(init_dir) ):\n init_dir = self.HOME_DIR\n fileselect = askopenfilename(filetypes=[(\"G-code Files\",\"*.ngc\"),\\\n (\"All Files\",\"*\")],\\\n initialdir=init_dir)\n if fileselect != '' and fileselect != ():\n self.Open_G_Code_File(fileselect,Refresh=True)\n self.NGC_INPUT = fileselect\n \n def Open_G_Code_File(self,filename,Refresh=True):\n try:\n self.entry_set(self.Entry_ArcAngle,self.Entry_ArcAngle_Check(),1)\n self.entry_set(self.Entry_Accuracy,self.Entry_Accuracy_Check(),1)\n except:\n pass\n if self.gcode_op.get() == \"wrap\":\n Arc2Line = True\n elif self.gcode_op.get() == \"export\":\n Arc2Line = True\n elif self.gcode_op.get() == \"probe\":\n Arc2Line = True\n else:\n Arc2Line = self.arc2line.get()\n \n fileName, fileExtension = os.path.splitext(filename)\n init_file=os.path.basename(fileName)\n if init_file != \"None\":\n MSG = self.g_rip.Read_G_Code(filename,\n XYarc2line = Arc2Line,\n arc_angle=float(self.segarc.get()),\n units=self.units.get(),\n Accuracy=float(self.accuracy.get()) )\n if MSG != []:\n if error_message(MSG) == \"ignore\":\n pass\n else:\n self.g_rip = G_Code_Rip()\n \n if Refresh==True:\n self.DoIt()\n \n def menu_File_Save_G_Code_Base(self,junk=\"\"):\n self.File_Save_G_Code_File(\"base\")\n\n def menu_File_Save_G_Code_Left(self,junk=\"\"):\n self.File_Save_G_Code_File(\"left\")\n \n def menu_File_Save_G_Code_Right(self,junk=\"\"):\n self.File_Save_G_Code_File(\"right\")\n\n def menu_File_Save_G_Code_Wrap(self,junk=\"\"):\n Rstock = float(self.WRAP_DIA.get())/2.0\n Wrap = self.WRAP_TYPE.get()\n self.File_Save_G_Code_File(\"base\",Rstock=Rstock,Wrap=Wrap)\n\n def menu_File_Save_Export_Write(self,junk=\"\"):\n Type = self.EXP_TYPE.get()\n Rapids = self.Exp_Rapids.get()\n self.File_Save_Export_File(Type,Rapids)\n\n def menu_File_Save_G_Code_round(self,junk=\"\"):\n Rstock = float(self.WRAP_DIA.get())/2.0\n Wrap = self.WRAP_TYPE.get()\n self.File_Save_G_Code_File(\"round\",Rstock=Rstock,Wrap=Wrap)\n\n\n def menu_File_Save_G_Code_Probe_n_Cut(self,junk=\"\"):\n self.File_Save_G_Code_File(\"probe_n_cut\")\n\n def menu_File_Save_G_Code_Adjusted(self,junk=\"\"):\n self.File_Save_G_Code_File(\"probe_adjusted\")\n\n def menu_File_Save_G_Code_ProbeOnly(self,junk=\"\"):\n self.File_Save_G_Code_File(\"probe_only\")\n\n def menu_File_Read_Probe_data(self,junk=\"\"):\n init_dir = os.path.dirname(self.PROBE_INPUT)\n if ( not os.path.isdir(init_dir) ):\n init_dir = os.path.dirname(self.NGC_INPUT)\n if ( not os.path.isdir(init_dir) ):\n init_dir = self.HOME_DIR\n fileselect = askopenfilename(filetypes=[(\"Probe Data Files\",\"*.txt\"),\\\n (\"All Files\",\"*\")],\\\n initialdir=init_dir)\n if fileselect != '' and fileselect != ():\n self.PROBE_INPUT = fileselect\n self.File_Read_Probe_data(fileselect)\n\n\n def menu_Clear_Probe_data(self,junk=\"\"):\n #print \"clear probe data\"\n self.probe_data = []\n self.DoIt()\n self.menu_View_Refresh()\n\n \n def File_Save_G_Code_File(self,side=\"base\",Rstock=0.0,Wrap=\"XYZ\"):\n if (self.Check_All_Variables() > 0):\n return\n \n self.WriteGCode(side=side,Rstock=Rstock,Wrap=Wrap)\n \n init_dir = os.path.dirname(self.NGC_OUTPUT)\n if ( not os.path.isdir(init_dir) ):\n init_dir = self.HOME_DIR\n\n fileName, fileExtension = os.path.splitext(self.NGC_INPUT)\n init_file=os.path.basename(fileName)\n \n if side == \"base\":\n if Wrap == \"XYZ\":\n init_file = init_file + \"_mod\"\n else:\n init_file = init_file + \"_wrap\"\n elif side == \"left\":\n init_file = init_file + \"_split_black\"\n elif side == \"right\":\n init_file = init_file + \"_split_white\"\n elif side == \"round\":\n init_file = init_file + \"_round\"\n elif side == \"export\":\n init_file = init_file + \"_dxf_write\"\n elif side == \"probe_n_cut\":\n init_file = init_file + \"_probe_n_cut\"\n elif side == \"probe_only\":\n init_file = init_file + \"_probe_only\"\n elif side == \"probe_adjusted\":\n init_file = init_file + \"_adjusted\"\n\n \n filename = asksaveasfilename(defaultextension='.ngc', \\\n filetypes=[(\"EMC2 Files\",\"*.ngc\"),(\"All Files\",\"*\")],\\\n initialdir=init_dir,\\\n initialfile= init_file )\n\n if filename != '' and filename != (): \n try:\n fout = open(filename,'w')\n except:\n self.statusMessage.set(\"Unable to open file for writing: %s\" %(filename))\n self.statusbar.configure( bg = 'red' )\n return\n for line in self.gcode:\n try:\n fout.write(line+'\\n')\n except:\n fout.write('(skipping line)\\n')\n fout.close\n self.NGC_OUTPUT=filename\n self.statusMessage.set(\"File Saved: %s\" %(filename))\n self.statusbar.configure( bg = 'white' )\n\n\n def File_Save_Export_File(self,filetype=\"DXF\",Rapids=True ):\n if (self.Check_All_Variables() > 0):\n return\n self.WriteExportCode(filetype,Rapids)\n \n init_dir = os.path.dirname(self.NGC_OUTPUT)\n if ( not os.path.isdir(init_dir) ):\n init_dir = self.HOME_DIR\n\n fileName, fileExtension = os.path.splitext(self.NGC_INPUT)\n init_file=os.path.basename(fileName)\n \n if filetype == \"DXF\":\n init_file = init_file\n def_ext = '.dxf'\n fts=[(\"DXF Files\",\"*.dxf\"),(\"All Files\",\"*\")]\n elif filetype == \"CSV\":\n init_file = init_file\n def_ext = '.csv'\n fts=[(\"DXF Files\",\"*.csv\"),(\"All Files\",\"*\")]\n \n filename = asksaveasfilename(defaultextension=def_ext, \\\n filetypes=fts,\\\n initialdir=init_dir,\\\n initialfile= init_file )\n\n if filename != '' and filename != (): \n try:\n fout = open(filename,'w')\n except:\n self.statusMessage.set(\"Unable to open file for writing: %s\" %(filename))\n self.statusbar.configure( bg = 'red' )\n return\n for line in self.gcode:\n try:\n fout.write(line+'\\n')\n except:\n fout.write('(skipping line)\\n')\n fout.close\n self.NGC_OUTPUT=filename\n self.statusMessage.set(\"File Saved: %s\" %(filename))\n self.statusbar.configure( bg = 'white' )\n\n\n def menu_File_Quit(self):\n if message_ask_ok_cancel(\"Exit\", \"Exiting G-Code-Ripper....\"):\n self.Quit_Click(None)\n \n def menu_View_Refresh_Callback(self, varName, index, mode):\n self.menu_View_Refresh()\n\n def menu_View_Refresh(self):\n dummy_event = Event()\n dummy_event.widget=self.master\n self.Master_Configure(dummy_event,1) \n\n def menu_Mode_Change(self):\n dummy_event = Event()\n dummy_event.widget=self.master\n self.Open_G_Code_File(self.NGC_INPUT,Refresh=True) #V0.8 needed so auto arc2line is active during reading\n self.Master_Configure(dummy_event,1,Plot_Flag=False)\n self.DoIt()\n\n def menu_View_Recalculate(self):\n self.DoIt()\n \n def menu_Help_About(self):\n about = \"G-Code-Ripper V%s by Scorch.\\n\" %(version)\n about = about + \"\\163\\143\\157\\162\\143\\150\\100\\163\\143\\157\\162\"\n about = about + \"\\143\\150\\167\\157\\162\\153\\163\\056\\143\\157\\155\\n\"\n about = about + \"http://www.scorchworks.com/\"\n message_box(\"About G-Code-Ripper\",about)\n\n\n def menu_Help_About(self):\n application=\"G-Code Ripper\"\n about = \"%s Version %s\\n\\n\" %(application,version)\n about = about + \"By Scorch.\\n\"\n about = about + \"\\163\\143\\157\\162\\143\\150\\100\\163\\143\\157\\162\"\n about = about + \"\\143\\150\\167\\157\\162\\153\\163\\056\\143\\157\\155\\n\"\n about = about + \"https://www.scorchworks.com/\\n\\n\"\n try:\n python_version = \"%d.%d.%d\" %(sys.version_info.major,sys.version_info.minor,sys.version_info.micro)\n except:\n python_version = \"\"\n about = about + \"Python \"+python_version+\" (%d bit)\" %(struct.calcsize(\"P\") * 8)\n message_box(\"About %s\" %(application),about)\n\n def menu_Help_Web(self):\n webbrowser.open_new(r\"http://www.scorchworks.com/Gcoderipper/g_code_ripper_doc.html\")\n\n def KEY_F1(self, event):\n self.menu_Help_About()\n\n def KEY_F2(self, event):\n self.GEN_Settings_Window()\n\n def KEY_F5(self, event):\n #self.Recalculate_Click()\n self.menu_View_Refresh()\n\n def KEY_ZOOM_IN(self, event):\n self.menu_View_Zoom_in()\n\n def KEY_ZOOM_OUT(self, event):\n self.menu_View_Zoom_out()\n\n def KEY_CTRL_G(self, event):\n self.menu_CopyClipboard_GCode_Base()\n\n \n def bindConfigure(self, event):\n if not self.initComplete:\n self.initComplete = 1\n self.DoIt()\n\n def Master_Configure(self, event, update=0, Plot_Flag=True):\n if event.widget != self.master:\n return\n \n x = int(self.master.winfo_x())\n y = int(self.master.winfo_y())\n w = int(self.master.winfo_width())\n h = int(self.master.winfo_height())\n if (self.x, self.y) == (-1,-1):\n self.x, self.y = x,y\n if abs(self.w-w)>10 or abs(self.h-h)>10 or update==1:\n ###################################################\n # Form changed Size (resized) adjust as required #\n ###################################################\n self.w=w\n self.h=h\n #canvas\n \n # Left Column #\n w_label=90\n w_entry=60\n w_units=35\n\n x_label_L=10\n x_entry_L=x_label_L+w_label+10 \n x_units_L=x_entry_L+w_entry+5\n\n Yloc=6\n self.Label_Gcode_Operations.place(x=x_label_L, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Label_GscaleXY.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Label_GscaleXY_u.place(x=x_units_L, y=Yloc, width=w_units, height=21)\n self.Entry_GscaleXY.place(x=x_entry_L, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_GscaleZ.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Label_GscaleZ_u.place(x=x_units_L, y=Yloc, width=w_units, height=21)\n self.Entry_GscaleZ.place(x=x_entry_L, y=Yloc, width=w_entry, height=23)\n \n Yloc=Yloc+24\n self.Label_GscaleF.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Label_GscaleF_u.place(x=x_units_L, y=Yloc, width=w_units, height=21)\n self.Entry_GscaleF.place(x=x_entry_L, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_Rotate.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Label_Rotate_u.place(x=x_units_L, y=Yloc, width=w_units, height=21)\n self.Entry_Rotate.place(x=x_entry_L, y=Yloc, width=w_entry, height=23) \n\n Yloc=Yloc+24\n self.Label_Origin.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Origin_OptionMenu.place(x=x_entry_L, y=Yloc, width=w_entry+40, height=23)\n\n Yloc=Yloc+24*2\n self.WriteBaseButton.place(x=12, y=Yloc, width=95*2, height=30)\n\n #_______________\n Yloc=Yloc+24+12\n self.separator1.place(x=x_label_L, y=Yloc,width=w_label+75+40, height=2)\n Yloc=Yloc+6\n self.Label_view_opt.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n\n Yloc=Yloc+24\n self.Radio_View_XY.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Radio_View_ISO1.place(x=x_entry_L, y=Yloc, width=w_label, height=21)\n\n Yloc=Yloc+24\n self.Radio_View_XZ.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Radio_View_ISO2.place(x=x_entry_L, y=Yloc, width=w_label, height=21)\n\n Yloc=Yloc+24\n self.Radio_View_YZ.place(x=x_label_L, y=Yloc, width=w_label, height=21)\n self.Radio_View_ISO3.place(x=x_entry_L, y=Yloc, width=w_label, height=21)\n \n #_______________\n Yloc=Yloc+24+12\n self.separator2.place(x=x_label_L, y=Yloc,width=w_label+75+40, height=2)\n Yloc=Yloc+6\n\n self.Label_code_ops.place(x=x_label_L, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Radio_Gcode_None.place(x=x_label_L, y=Yloc, width=150, height=23)\n Yloc=Yloc+24\n self.Radio_Gcode_Split.place(x=x_label_L, y=Yloc, width=150, height=23)\n Yloc=Yloc+24\n self.Radio_Gcode_Wrap.place(x=x_label_L, y=Yloc, width=150, height=23)\n Yloc=Yloc+24\n self.Radio_Gcode_Export.place(x=x_label_L, y=Yloc, width=150, height=23)\n Yloc=Yloc+24\n self.Radio_Gcode_Probe.place(x=x_label_L, y=Yloc, width=150, height=23)\n \n # End Left Column #\n\n # Start Right Column\n w_label=90\n w_entry=60\n w_units=35\n \n x_label_R=self.w - 220\n x_entry_R=x_label_R+w_label+10 \n x_units_R=x_entry_R+w_entry+5\n\n ## SPLIT ##\n self.Label_Gcode_Split_Properties.place_forget()\n self.Label_SplitX.place_forget()\n self.Label_SplitX_u.place_forget()\n self.Entry_SplitX.place_forget()\n self.Label_SplitY.place_forget()\n self.Label_SplitY_u.place_forget()\n self.Entry_SplitY.place_forget()\n self.Label_SplitA.place_forget()\n self.Label_SplitA_u.place_forget()\n self.Entry_SplitA.place_forget()\n self.Label_rotateb.place_forget()\n self.Checkbutton_rotateb.place_forget()\n self.WriteLeftButton.place_forget()\n self.WriteRightButton.place_forget()\n\n self.separator3.place_forget()\n \n self.Label_gcode_opt.place_forget()\n self.Entry_Feed.place_forget()\n self.Label_Feed.place_forget()\n self.Label_Feed_u.place_forget()\n self.Entry_Zsafe.place_forget()\n self.Label_Zsafe.place_forget()\n self.Label_Zsafe_u.place_forget()\n self.separator4.place_forget()\n\n ## WRAP ##\n self.Label_Gcode_Wrap_Properties.place_forget()\n self.Label_Wrap_DIA.place_forget()\n self.Entry_Wrap_DIA.place_forget()\n self.Label_Wrap_DIA_u.place_forget()\n self.Label_Radio_Wrap.place_forget()\n self.Radio_Wrap_Y2A.place_forget()\n self.Radio_Wrap_X2B.place_forget()\n self.Radio_Wrap_Y2B.place_forget()\n self.Radio_Wrap_X2A.place_forget()\n self.WriteWrapButton.place_forget()\n self.WriteRoundButton.place_forget()\n self.Label_WRAP_FSCALE.place_forget()\n self.WRAP_FSCALE_OptionMenu.place_forget()\n self.Label_WRAP_REV_ROT.place_forget()\n self.Checkbutton_WRAP_REV_ROT.place_forget()\n\n ## Export ##\n self.Label_Gcode_Export_Properties.place_forget()\n self.Label_Radio_Export.place_forget()\n self.Radio_Export_DXF.place_forget()\n self.Radio_Export_CSV.place_forget()\n self.Label_EXP_RAPIDS.place_forget()\n self.Checkbutton_EXP_RAPIDS.place_forget()\n self.WriteExportButton.place_forget()\n\n\n ## PROBE ##\n self.Label_Gcode_Probe_Properties.place_forget()\n self.Label_ProbeOffsetX.place_forget()\n self.Label_ProbeOffsetX_u.place_forget()\n self.Entry_ProbeOffsetX.place_forget()\n self.Label_ProbeOffsetY.place_forget()\n self.Label_ProbeOffsetY_u.place_forget()\n self.Entry_ProbeOffsetY.place_forget()\n self.Label_ProbeOffsetZ.place_forget()\n self.Label_ProbeOffsetZ_u.place_forget()\n self.Entry_ProbeOffsetZ.place_forget()\n self.Label_ProbeSafe.place_forget()\n self.Label_ProbeSafe_u.place_forget()\n self.Entry_ProbeSafe.place_forget()\n self.Label_ProbeDepth.place_forget()\n self.Label_ProbeDepth_u.place_forget()\n self.Entry_ProbeDepth.place_forget()\n self.Label_ProbeFeed.place_forget()\n self.Label_ProbeFeed_u.place_forget()\n self.Entry_ProbeFeed.place_forget()\n self.Label_Probe_Num_X.place_forget()\n self.Entry_Probe_Num_X.place_forget()\n self.Label_Probe_Num_Y.place_forget()\n self.Entry_Probe_Num_Y.place_forget()\n #self.Label_ProbeInterpSpace.place_forget()\n #self.Entry_ProbeInterpSpace.place_forget()\n self.Label_ProbePreCodes.place_forget()\n self.Entry_ProbePreCodes.place_forget()\n self.Label_ProbePauseCodes.place_forget()\n self.Entry_ProbePauseCodes.place_forget()\n self.Label_ProbeSoft.place_forget()\n self.ProbeSoft_OptionMenu.place_forget()\n self.Label_ProbePoints.place_forget()\n self.ProbePoints_OptionMenu.place_forget()\n self.Label_SavePoints.place_forget()\n self.Checkbutton_SavePoints.place_forget()\n \n self.WriteProbeOnlyButton.place_forget()\n self.ReadProbeButton.place_forget()\n self.ClearProbeButton.place_forget()\n self.WriteAdjustedButton.place_forget()\n self.WriteProbeButton.place_forget()\n \n\n # Buttons/Canvas.\n Ybut=self.h-60\n self.Recalculate.place(x=12, y=Ybut, width=95, height=30)\n self.PreviewCanvas.configure( width = self.w-455, height = self.h-50 )\n self.PreviewCanvas_frame.place(x=220, y=10)\n\n # Menu Items\n #self.top_File.entryconfig(2,state=\"disabled\")\n #self.top_File.entryconfig(3,state=\"disabled\")\n #self.top_Edit.entryconfig(1,state=\"disabled\")\n #self.top_Edit.entryconfig(2,state=\"disabled\")\n\n\n #### MODE SPECIFIC ITEMS ####\n Yloc=6\n if self.gcode_op.get() == \"split\":\n #self.top_File.entryconfig(2,state=\"normal\")\n #self.top_File.entryconfig(3,state=\"normal\")\n #self.top_Edit.entryconfig(1,state=\"normal\")\n #self.top_Edit.entryconfig(2,state=\"normal\")\n \n ###########\n ###########\n self.Label_Gcode_Split_Properties.place(x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n \n self.Label_SplitX.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_SplitX_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_SplitX.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_SplitY.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_SplitY_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_SplitY.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_SplitA.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_SplitA_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_SplitA.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_rotateb.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Checkbutton_rotateb.place(x=x_entry_R, y=Yloc, width=w_entry+40, height=23)\n\n Yloc=Yloc+24*2\n self.WriteLeftButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n\n Yloc=Yloc+24+7\n self.WriteRightButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n \n Yloc=Yloc+24+12\n self.separator3.place(x=x_label_R, y=Yloc,width=w_label+75+40, height=2)\n ###########\n ###########\n \n Yloc=Yloc+6\n self.Label_gcode_opt.place(x=x_label_R, y=Yloc, width=w_label*2, height=21)\n \n Yloc=Yloc+24\n self.Entry_Feed.place( x=x_entry_R, y=Yloc, width=w_entry, height=23)\n self.Label_Feed.place( x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_Feed_u.place(x=x_units_R, y=Yloc, width=w_units+15, height=21)\n \n Yloc=Yloc+24\n self.Entry_Zsafe.place( x=x_entry_R, y=Yloc, width=w_entry, height=23)\n self.Label_Zsafe.place( x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_Zsafe_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n\n Yloc=Yloc+24+12\n self.separator4.place(x=x_label_R, y=Yloc,width=w_label+75+40, height=2)\n Yloc=Yloc+6\n\n\n elif self.gcode_op.get() == \"wrap\":\n self.Label_Gcode_Wrap_Properties.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Label_Wrap_DIA.place( x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_Wrap_DIA_u.place(x=x_units_R, y=Yloc, width=w_units+15, height=21)\n self.Entry_Wrap_DIA.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n \n Yloc=Yloc+24\n self.Label_Radio_Wrap.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Radio_Wrap_Y2A.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Radio_Wrap_X2B.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Radio_Wrap_Y2B.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Radio_Wrap_X2A.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Label_WRAP_FSCALE.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.WRAP_FSCALE_OptionMenu.place(x=x_entry_R-20, y=Yloc, width=w_entry+50, height=23)\n\n Yloc=Yloc+24\n self.Label_WRAP_REV_ROT.place(x=x_label_R, y=Yloc, width=w_label+30, height=21)\n self.Checkbutton_WRAP_REV_ROT.place(x=x_entry_R+30, y=Yloc, width=75, height=23)\n \n Yloc=Yloc+24+7\n self.WriteWrapButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n\n Yloc=Yloc+24+7\n self.WriteRoundButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n\n elif self.gcode_op.get() == \"export\":\n self.Label_Gcode_Export_Properties.place(x=x_label_R, y=Yloc, width=w_label*2, height=21)\n\n Yloc=Yloc+24\n self.Label_EXP_RAPIDS.place(x=x_label_R, y=Yloc, width=w_label+30, height=21)\n self.Checkbutton_EXP_RAPIDS.place(x=x_entry_R+30, y=Yloc, width=75, height=23)\n \n Yloc=Yloc+24\n self.Label_Radio_Export.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Radio_Export_DXF.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n Yloc=Yloc+24\n self.Radio_Export_CSV.place( x=x_label_R, y=Yloc, width=w_label*2, height=21)\n \n Yloc=Yloc+24+7\n self.WriteExportButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n\n\n elif self.gcode_op.get() == \"probe\":\n self.Label_Gcode_Probe_Properties.place(x=x_label_R, y=Yloc, width=w_label*2, height=21)\n\n Yloc=Yloc+24\n self.Label_ProbeOffsetX.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_ProbeOffsetX_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_ProbeOffsetX.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_ProbeOffsetY.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_ProbeOffsetY_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_ProbeOffsetY.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_ProbeOffsetZ.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_ProbeOffsetZ_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_ProbeOffsetZ.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n \n Yloc=Yloc+24\n self.Label_ProbeSafe.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_ProbeSafe_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_ProbeSafe.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_ProbeDepth.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_ProbeDepth_u.place(x=x_units_R, y=Yloc, width=w_units, height=21)\n self.Entry_ProbeDepth.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_ProbeFeed.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Label_ProbeFeed_u.place(x=x_units_R, y=Yloc, width=w_units+15, height=21)\n self.Entry_ProbeFeed.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_Probe_Num_X.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Entry_Probe_Num_X.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_Probe_Num_Y.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Entry_Probe_Num_Y.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n #Yloc=Yloc+24\n #self.Label_ProbeInterpSpace.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n #self.Entry_ProbeInterpSpace.place(x=x_entry_R, y=Yloc, width=w_entry, height=23)\n\n Yloc=Yloc+24\n self.Label_ProbePreCodes.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Entry_ProbePreCodes.place(x=x_entry_R, y=Yloc, width=w_entry+50, height=23)\n \n Yloc=Yloc+24\n self.Label_ProbePauseCodes.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Entry_ProbePauseCodes.place(x=x_entry_R, y=Yloc, width=w_entry+50, height=23)\n\n Yloc=Yloc+24\n self.Label_ProbePoints.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.ProbePoints_OptionMenu.place(x=x_entry_R, y=Yloc, width=w_entry+50, height=23)\n\n Yloc=Yloc+24\n self.Label_SavePoints.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.Checkbutton_SavePoints.place(x=x_entry_R, y=Yloc, width=w_entry+50, height=23)\n \n Yloc=Yloc+24\n self.Label_ProbeSoft.place(x=x_label_R, y=Yloc, width=w_label, height=21)\n self.ProbeSoft_OptionMenu.place(x=x_entry_R, y=Yloc, width=w_entry+50, height=23)\n\n Yloc=Yloc+24+7\n self.ReadProbeButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n Yloc=Yloc+24+7\n self.ClearProbeButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n Yloc=Yloc+24+7\n self.WriteAdjustedButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n \n Yloc=Yloc+24+7\n self.WriteProbeOnlyButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n Yloc=Yloc+24+7\n self.WriteProbeButton.place(x=x_label_R, y=Yloc, width=95*2, height=30)\n\n\n if (self.probe_data == []):\n self.Label_ProbeSafe.configure(state=\"normal\")\n self.Label_ProbeSafe_u.configure(state=\"normal\")\n self.Entry_ProbeSafe.configure(state=\"normal\")\n self.Label_ProbeDepth.configure(state=\"normal\")\n self.Label_ProbeDepth_u.configure(state=\"normal\")\n self.Entry_ProbeDepth.configure(state=\"normal\")\n self.Label_ProbeFeed.configure(state=\"normal\")\n self.Label_ProbeFeed_u.configure(state=\"normal\")\n self.Entry_ProbeFeed.configure(state=\"normal\")\n self.Label_Probe_Num_X.configure(state=\"normal\")\n self.Entry_Probe_Num_X.configure(state=\"normal\")\n self.Label_Probe_Num_Y.configure(state=\"normal\")\n self.Entry_Probe_Num_Y.configure(state=\"normal\")\n self.Label_ProbePreCodes.configure(state=\"normal\")\n self.Entry_ProbePreCodes.configure(state=\"normal\")\n self.Label_ProbePauseCodes.configure(state=\"normal\")\n self.Label_ProbePauseCodes_u.configure(state=\"normal\")\n self.Entry_ProbePauseCodes.configure(state=\"normal\")\n self.Label_SavePoints.configure(state=\"normal\")\n self.Checkbutton_SavePoints.configure(state=\"normal\")\n self.Label_ProbePoints.configure(state=\"normal\")\n self.ProbePoints_OptionMenu.configure(state=\"normal\")\n\n self.WriteProbeOnlyButton.configure(state=\"normal\")\n self.WriteProbeButton.configure(state=\"normal\")\n self.WriteAdjustedButton.configure(state=\"disabled\")\n self.ClearProbeButton.configure(state=\"disabled\")\n \n else:\n self.Label_ProbeSafe.configure(state=\"disabled\")\n self.Label_ProbeSafe_u.configure(state=\"disabled\")\n self.Entry_ProbeSafe.configure(state=\"disabled\")\n self.Label_ProbeDepth.configure(state=\"disabled\")\n self.Label_ProbeDepth_u.configure(state=\"disabled\")\n self.Entry_ProbeDepth.configure(state=\"disabled\")\n self.Label_ProbeFeed.configure(state=\"disabled\")\n self.Label_ProbeFeed_u.configure(state=\"disabled\")\n self.Entry_ProbeFeed.configure(state=\"disabled\")\n self.Label_Probe_Num_X.configure(state=\"disabled\")\n self.Entry_Probe_Num_X.configure(state=\"disabled\")\n self.Label_Probe_Num_Y.configure(state=\"disabled\")\n self.Entry_Probe_Num_Y.configure(state=\"disabled\")\n self.Label_ProbePreCodes.configure(state=\"disabled\")\n self.Entry_ProbePreCodes.configure(state=\"disabled\")\n self.Label_ProbePauseCodes.configure(state=\"disabled\")\n self.Label_ProbePauseCodes_u.configure(state=\"disabled\")\n self.Entry_ProbePauseCodes.configure(state=\"disabled\")\n self.Label_SavePoints.configure(state=\"disabled\")\n self.Checkbutton_SavePoints.configure(state=\"disabled\")\n self.Label_ProbePoints.configure(state=\"disabled\")\n self.ProbePoints_OptionMenu.configure(state=\"disabled\")\n\n self.WriteProbeOnlyButton.configure(state=\"disabled\")\n self.WriteProbeButton.configure(state=\"disabled\")\n self.WriteAdjustedButton.configure(state=\"normal\")\n self.ClearProbeButton.configure(state=\"normal\")\n self.Label_ProbeSafe.configure(state=\"normal\")\n ###########################################################\n if Plot_Flag:\n self.Plot_Data()\n\n def ISO_COORDS(self,X,Y,Z,VIEW=\"XY\"):\n\n if VIEW == \"XY\":\n return X,Y\n\n elif VIEW == \"XZ\":\n return X,Z\n\n elif VIEW == \"YZ\":\n return Y,Z\n \n elif VIEW == \"ISO1\":\n s60 = 0.866025404 #sin(radians(60))\n c60 = 0.5 #cos(radians(60))\n Xout = X*s60 + Y*s60\n Yout = -X*c60 + Y*c60 + Z\n return Xout,Yout\n\n elif VIEW == \"ISO2\":\n s60 = 0.866025404 #sin(radians(60))\n c60 = 0.5 #cos(radians(60))\n Xout = X*s60 - Y*s60\n Yout = X*c60 + Y*c60 + Z\n return Xout,Yout\n\n elif VIEW == \"ISO3\":\n s60 = 0.866025404 #sin(radians(60))\n c60 = 0.5 #cos(radians(60))\n Xout = -X*s60 - Y*s60\n Yout = X*c60 - Y*c60 + Z\n return Xout,Yout\n\n\n def Plot_Line_ISO(self,XX1,YY1,ZZ1,XX2,YY2,ZZ2,midx,midy,cszw,cszh,PlotScale,col,radius=0,dash=False):\n \n #if (isinstance(XX1, complex)): XX1=0 #V0.8\n #if (isinstance(YY1, complex)): YY1=0 #V0.8\n #if (isinstance(ZZ1, complex)): ZZ1=0 #V0.8\n #if (isinstance(XX2, complex)): XX2=0 #V0.8\n #if (isinstance(YY2, complex)): YY2=0 #V0.8\n #if (isinstance(ZZ2, complex)): ZZ2=0 #V0.8\n \n #if (isinstance(XX1, complex)): XX1=XX2 #V0.8\n #if (isinstance(YY1, complex)): YY1=YY2 #V0.8\n #if (isinstance(ZZ1, complex)): ZZ1=ZZ2 #V0.8\n \n VIEW = self.plot_view.get()\n XX1,YY1 = self.ISO_COORDS(XX1,YY1,ZZ1,VIEW=VIEW)\n XX2,YY2 = self.ISO_COORDS(XX2,YY2,ZZ2,VIEW=VIEW)\n\n #print midx, midy, XX1, XX2, YY1, YY2\n x1 = cszw/2 + (XX1-midx) / PlotScale\n x2 = cszw/2 + (XX2-midx) / PlotScale\n y1 = cszh/2 - (YY1-midy) / PlotScale\n y2 = cszh/2 - (YY2-midy) / PlotScale\n if radius==0:\n thick=0\n else:\n thick = radius*2 / PlotScale\n if not dash:\n self.segID.append( self.PreviewCanvas.create_line(x1,y1,x2,y2,fill = col, capstyle=\"round\", width=thick, arrow=\"none\"))\n else:\n self.segID.append( self.PreviewCanvas.create_line(x1,y1,x2,y2,fill = col, capstyle=\"round\", width=thick, dash=(4,4)))\n \n ###############################################################################################\n def Plot_Arc(self,dir,XX1,YY1,ZZ1, XX2,YY2,ZZ2, xxc,yyc,midx,midy,cszw,cszh,PlotScale,col,radius=0):\n global Zero\n if radius==0:\n thick=0\n else:\n thick = radius*2 / PlotScale\n\n if dir==3:\n xa = XX1\n ya = YY1\n za = ZZ1 #\n xb = XX2\n yb = YY2\n zb = ZZ2 #\n else:\n xa = XX2\n ya = YY2\n za = ZZ2 #\n xb = XX1 \n yb = YY1\n zb = ZZ1 #\n \n Lx1 = xa-xxc\n Ly1 = ya-yyc\n L1 = sqrt( Lx1**2 + Ly1**2 )\n s1 = Ly1/L1\n c1 = Lx1/L1\n A1 = Get_Angle(s1,c1)\n\n Lx2 = xb-xxc\n Ly2 = yb-yyc\n L2 = sqrt( Lx2**2 + Ly2**2 )\n Tx2,Ty2 = Transform(Lx2,Ly2,radians(-A1))\n\n s2 = Ty2/L2\n c2 = Tx2/L2\n A2 = Get_Angle(s2,c2)\n \n start_angle = A1\n extent_angle = A2\n\n if abs(extent_angle) < Zero:\n A2=360.0\n extent_angle=360.0\n ##########################################\n ### Plot arcs in canvas AS LINES ###\n ##########################################\n data = self.g_rip.arc2lines([XX1,YY1,ZZ1], [XX2,YY2,ZZ2], [xxc,yyc], dir, plane=\"17\")\n for line in data:\n XY=line\n self.Plot_Line_ISO(XY[0],XY[1],XY[2],XY[3],XY[4],XY[5],midx,midy,cszw,cszh,PlotScale,col,radius=0,dash=False)\n\n## step=10\n## at=step\n## my_range=[]\n## while at < A2:\n## my_range.append(at)\n## at = at+step\n## my_range.append(A2)\n##\n## XXa = xa\n## YYa = ya\n## ZZa = za #ZZ1\n## #ZZb = zb #ZZ2\n## dZ = zb-za #ZZ2-ZZ1\n## for at in my_range:\n## print A2,\" \",at, at/A2\n## ZZb = ZZa + at/A2*dZ \n## xt,yt = Transform(L1,0,radians(A1+at))\n## XXb = xxc + xt\n## YYb = yyc + yt\n##\n## self.Plot_Line_ISO(XXa,YYa,ZZa,XXb,YYb,ZZb,midx,midy,cszw,cszh,PlotScale,col,radius=0,dash=False)\n##\n## XXa=XXb\n## YYa=YYb\n## ZZa=ZZb\n\n \n ###############################################################################################\n def Plot_Circ(self,XX1,YY1,midx,midy,cszw,cszh,PlotScale,color,Rad,fill):\n dd=Rad\n ZZ1 = 0\n VIEW = self.plot_view.get()\n XXX1,YYY1 = self.ISO_COORDS(XX1,YY1,ZZ1,VIEW=VIEW)\n \n x1 = cszw/2 + (XXX1-dd-midx) / PlotScale\n x2 = cszw/2 + (XXX1+dd-midx) / PlotScale\n y1 = cszh/2 - (YYY1-dd-midy) / PlotScale\n y2 = cszh/2 - (YYY1+dd-midy) / PlotScale\n if fill ==0:\n self.segID.append( self.PreviewCanvas.create_oval(x1,y1,x2,y2, outline=color, fill=None, width=1 ))\n else:\n self.segID.append( self.PreviewCanvas.create_oval(x1,y1,x2,y2, outline=color, fill=color, width=0 ))\n\n def Recalculate_RQD_Nocalc(self, event):\n self.statusbar.configure( bg = 'yellow' )\n self.statusMessage.set(\" Recalculation required.\")\n\n def Recalculate_RQD_Click(self, event):\n self.statusbar.configure( bg = 'yellow' )\n self.statusMessage.set(\" Recalculation required.\")\n self.DoIt()\n\n def Recalc_RQD(self):\n self.statusbar.configure( bg = 'yellow' )\n self.statusMessage.set(\" Recalculation required.\")\n\n ##########################################\n # CANVAS PLOTTING STUFF #\n ##########################################\n def Plot_Data(self):\n self.master.update_idletasks()\n # erase old segs/display objects\n self.PreviewCanvas.delete(ALL)\n self.segID = []\n\n cszw = int(self.PreviewCanvas.cget(\"width\"))\n cszh = int(self.PreviewCanvas.cget(\"height\"))\n buff=10\n\n maxx = self.MAXX\n minx = self.MINX\n maxy = self.MAXY\n miny = self.MINY\n maxz = self.MAXZ\n minz = self.MINZ\n\n VIEW = self.plot_view.get()\n\n if VIEW == \"XY\":\n maxH = maxx\n minH = minx\n maxV = maxy\n minV = miny\n\n elif VIEW == \"XZ\":\n maxH = maxx\n minH = minx\n maxV = maxz\n minV = minz\n\n elif VIEW == \"YZ\":\n maxH = maxy\n minH = miny\n maxV = maxz\n minV = minz\n \n elif VIEW == \"ISO1\":\n maxH, junk = self.ISO_COORDS(maxx,maxy,0.0 ,VIEW=VIEW)\n minH, junk = self.ISO_COORDS(minx,miny,0.0 ,VIEW=VIEW)\n junk, maxV = self.ISO_COORDS(minx,maxy,maxz,VIEW=VIEW)\n junk, minV = self.ISO_COORDS(maxx,miny,minz,VIEW=VIEW)\n\n elif VIEW == \"ISO2\":\n maxH, junk = self.ISO_COORDS(maxx,miny,0.0 ,VIEW=VIEW)\n minH, junk = self.ISO_COORDS(minx,maxy,0.0 ,VIEW=VIEW)\n junk, maxV = self.ISO_COORDS(maxx,maxy,maxz,VIEW=VIEW)\n junk, minV = self.ISO_COORDS(minx,miny,minz,VIEW=VIEW)\n\n elif VIEW == \"ISO3\":\n maxH, junk = self.ISO_COORDS(minx,miny,0.0 ,VIEW=VIEW)\n minH, junk = self.ISO_COORDS(maxx,maxy,0.0 ,VIEW=VIEW)\n junk, maxV = self.ISO_COORDS(maxx,miny,maxz,VIEW=VIEW)\n junk, minV = self.ISO_COORDS(minx,maxy,minz,VIEW=VIEW)\n\n PlotScale = max((maxH-minH)/(cszw-buff), (maxV-minV)/(cszh-buff))\n midH = (maxH+minH)/2\n midV = (maxV+minV)/2\n\n if PlotScale <= 0:\n PlotScale=1.0\n\n Wrap = self.WRAP_TYPE.get()\n\n #if ( self.show_box.get() == True ) and ( VIEW == \"XY\" ) and ( (self.gcode_op.get()==\"none\") or (self.gcode_op.get()==\"split\") ):\n if ( self.show_box.get() == True ) and ( VIEW == \"XY\" ) and (self.gcode_op.get()!=\"wrap\"):\n x_lft = cszw/2 + (minH-midH) / PlotScale\n x_rgt = cszw/2 + (maxH-midH) / PlotScale\n y_bot = cszh/2 + (maxV-midV) / PlotScale\n y_top = cszh/2 + (minV-midV) / PlotScale\n self.segID.append( self.PreviewCanvas.create_rectangle(\n x_lft, y_bot, x_rgt, y_top, fill=\"gray80\", outline=\"gray80\", width = 0) )\n\n## if ( self.show_box.get() == True ):\n## color=\"gray80\"\n## rad = 3.0*(PlotScale/2.0) #this makes the line thickness two pixels\n## self.Plot_Line_ISO( minx,maxy,0.0,maxx,maxy,0.0, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,maxy,0.0,maxx,miny,0.0, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,miny,0.0,minx,miny,0.0, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( minx,miny,0.0,minx,maxy,0.0, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n \n## color=\"gray80\"\n## #TOP BOX\n## self.Plot_Line_ISO( minx,maxy,minz,maxx,maxy,minz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,maxy,minz,maxx,miny,minz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,miny,minz,minx,miny,minz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( minx,miny,minz,minx,maxy,minz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## #BOTTOM BOX\n## self.Plot_Line_ISO( minx,maxy,maxz,maxx,maxy,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,maxy,maxz,maxx,miny,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,miny,maxz,minx,miny,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( minx,miny,maxz,minx,maxy,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## #CONNECTING LINES\n## self.Plot_Line_ISO( minx,maxy,minz,minx,maxy,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,maxy,minz,maxx,maxy,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( maxx,miny,minz,maxx,miny,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n## self.Plot_Line_ISO( minx,miny,minz,minx,miny,maxz, midH,midV,cszw,cszh,PlotScale,color,radius=rad)\n\n\n Rstock = float(self.WRAP_DIA.get())/2.0\n MaxLen = radians(float(self.segarc.get())) * Rstock\n\n \n for line in self.coords:\n XY = line\n if XY[6]==1:\n color=\"blue\"\n if ( self.show_path.get() == False ):\n continue\n elif XY[6]==2:\n color=\"black\"\n if ( self.show_path.get() == False ):\n continue\n elif XY[6]==3:\n color=\"white\"\n if (( self.show_path.get() == False ) and self.gcode_op.get() != \"probe\"):\n continue\n else:\n color=\"green\"\n if ( self.show_path.get() == False ):\n continue\n\n if XY[7] == 1:\n\n if self.gcode_op.get() == \"wrap\" and Rstock > 0.0:\n \n DX = XY[3]-XY[0]\n DY = XY[4]-XY[1]\n DZ = XY[5]-XY[2]\n Xlast = XY[0]\n Ylast = XY[1]\n Zlast = XY[2]\n \n if Wrap == \"XYZ\":\n coordA=[ XY[0], XY[1], XY[2] ]\n coordB=[ XY[3], XY[4], XY[5] ]\n\n elif Wrap == \"Y2A\" or Wrap == \"Y2B\":\n STEPS = int(floor(abs(DY) / MaxLen)+1)\n for i in range(1,STEPS+1):\n Xstep = XY[0]+DX/STEPS*i\n Ystep = XY[1]+DY/STEPS*i\n Zstep = XY[2]+DZ/STEPS*i\n \n angleA = Ylast/Rstock\n yt,zt = Transform(0.0,Zlast+Rstock, -angleA )\n coordA = [ Xlast, yt ,zt-Rstock ]\n \n angleB = Ystep/Rstock\n yt,zt = Transform(0.0,Zstep+Rstock, -angleB )\n coordB = [ Xstep, yt ,zt-Rstock ]\n\n self.Plot_Line_ISO( coordA[0],coordA[1],coordA[2],coordB[0],coordB[1],coordB[2], midH,midV,cszw,cszh,PlotScale,color,radius=0)\n Xlast = Xstep\n Ylast = Ystep\n Zlast = Zstep \n\n elif Wrap == \"X2B\" or Wrap == \"X2A\":\n STEPS = int(floor(abs(DX) / MaxLen)+1)\n for i in range(1,STEPS+1):\n Xstep = XY[0]+DX/STEPS*i\n Ystep = XY[1]+DY/STEPS*i\n Zstep = XY[2]+DZ/STEPS*i\n \n angleA = Xlast/Rstock\n zt, xt = Transform(Zlast+Rstock, 0.0, angleA )\n coordA = [ xt, Ylast ,zt-Rstock ]\n \n angleB = Xstep/Rstock\n zt, xt = Transform(Zstep+Rstock,0.0, angleB )\n coordB = [ xt, Ystep ,zt-Rstock ]\n\n self.Plot_Line_ISO( coordA[0],coordA[1],coordA[2],coordB[0],coordB[1],coordB[2], midH,midV,cszw,cszh,PlotScale,color,radius=0)\n Xlast = Xstep\n Ylast = Ystep\n Zlast = Zstep\n\n else:\n self.Plot_Line_ISO( XY[0],XY[1],XY[2],XY[3],XY[4],XY[5], midH,midV,cszw,cszh,PlotScale,color,radius=0)\n\n else:\n self.Plot_Arc(XY[7],XY[0],XY[1],XY[2],XY[3],XY[4],XY[5],XY[8],XY[9],midH,midV,cszw,cszh,PlotScale,color,radius=0)\n \n axis_length=(maxH-minH)/4\n axis_x1 = cszw/2 + (-midH ) / PlotScale\n axis_x2 = cszw/2 + ( axis_length-midH ) / PlotScale\n axis_y1 = cszh/2 - (-midV ) / PlotScale\n axis_y2 = cszh/2 - ( axis_length-midV ) / PlotScale\n\n if self.show_axis.get() == True:\n # Plot coordinate system origin\n self.Plot_Line_ISO(0,0,0,axis_length,0,0, midH,midV,cszw,cszh,PlotScale,\"red\",radius=0, dash=False)\n self.Plot_Line_ISO(0,0,0,0,axis_length,0, midH,midV,cszw,cszh,PlotScale,\"green\",radius=0, dash=False)\n self.Plot_Line_ISO(0,0,0,0,0,axis_length, midH,midV,cszw,cszh,PlotScale,\"blue\",radius=0, dash=False)\n\n # Plot Splitting line and center circle\n if self.gcode_op.get() == \"split\" and self.rotateb.get() == False: \n split_angle = float(self.SPLITA.get() )\n split_x = float(self.SPLITX.get() )\n split_y = float(self.SPLITY.get() ) \n \n y_maxx = (maxx-split_x) * tan(radians(90-split_angle)) + split_y\n y_minx = (minx-split_x) * tan(radians(90-split_angle)) + split_y\n x_maxy = (maxy-split_y) * tan(radians(split_angle)) + split_x\n x_miny = (miny-split_y) * tan(radians(split_angle)) + split_x\n\n plt_crds=[]\n if y_maxx <= maxy and y_maxx >= miny:\n plt_crds.append([maxx,y_maxx])\n \n if y_minx <= maxy and y_minx >= miny:\n plt_crds.append([minx,y_minx])\n\n if x_maxy <= maxx and x_maxy >= minx:\n plt_crds.append([x_maxy,maxy])\n\n if x_miny <= maxx and x_miny >= minx:\n plt_crds.append([x_miny,miny])\n\n handle_rad=(maxx-minx)/100\n self.Plot_Circ(split_x,split_y,midH,midV,cszw,cszh,PlotScale,\"yellow\",handle_rad,1) \n if len(plt_crds) > 1:\n self.Plot_Line_ISO(plt_crds[0][0],plt_crds[0][1],0.0,plt_crds[1][0],plt_crds[1][1],0.0,\n midH,midV,cszw,cszh,PlotScale,\"yellow\",radius=0, dash=True)\n \n ############################################################################\n # Perform Calculations #\n ############################################################################\n def DoIt(self):\n if self.initComplete == 0:\n return\n if (self.Check_All_Variables() > 0):\n return\n self.statusbar.configure( bg = 'yellow' )\n self.statusMessage.set(\" Calculating.........\")\n self.master.update_idletasks()\n\n # erase old data\n self.gcode = []\n self.coords = []\n \n for seg in self.segID:\n self.PreviewCanvas.delete(seg)\n self.segID = []\n\n #####################################################\n try: \n scale_xy = float(self.SCALEXY.get())/100.0\n scale_z = float(self.SCALEZ.get() )/100.0\n scale_f = float(self.SCALEF.get() )/100.0\n gcode_rotate = float(self.ROTATE.get() )\n split_angle = float(self.SPLITA.get() )\n split_x = float(self.SPLITX.get() )\n split_y = float(self.SPLITY.get() )\n \n probe_depth = float(self.probe_depth.get())\n probe_nX = int(float((self.probe_nX.get())))\n probe_nY = int(float((self.probe_nY.get())))\n probe_istep = float(self.probe_istep.get())\n except:\n self.statusMessage.set(\" Unable to create paths. Check Settings Entry Values.\")\n self.statusbar.configure( bg = 'red' )\n return\n \n ###################################################### \n message2 = \"\"\n temp,minx,maxx,miny,maxy,minz,maxz = self.g_rip.scale_rotate_code(self.g_rip.g_code_data,[scale_xy,scale_xy,scale_z,scale_f],gcode_rotate)\n\n ##########################################\n # ORIGIN LOCATING STUFF #\n ##########################################\n midx = (minx+maxx)/2\n midy = (miny+maxy)/2\n CASE = str(self.origin.get())\n if CASE == \"Top-Left\":\n x_zero = minx\n y_zero = maxy\n elif CASE == \"Top-Center\":\n x_zero = midx\n y_zero = maxy\n elif CASE == \"Top-Right\":\n x_zero = maxx\n y_zero = maxy\n elif CASE == \"Mid-Left\":\n x_zero = minx\n y_zero = midy\n elif CASE == \"Mid-Center\":\n x_zero = midx\n y_zero = midy\n elif CASE == \"Mid-Right\":\n x_zero = maxx\n y_zero = midy\n elif CASE == \"Bot-Left\":\n x_zero = minx\n y_zero = miny\n elif CASE == \"Bot-Center\":\n x_zero = midx\n y_zero = miny\n elif CASE == \"Bot-Right\":\n x_zero = maxx\n y_zero = miny\n elif CASE == \"Arc-Center\":\n x_zero = 0\n y_zero = 0\n else: #\"Default\"\n x_zero = 0\n y_zero = 0\n ##########################################\n\n temp = self.g_rip.scale_translate(temp,translate=[x_zero,y_zero,0.0])\n\n self.g_rip.scaled_trans = temp\n minx = minx - x_zero\n maxx = maxx - x_zero\n miny = miny - y_zero\n maxy = maxy - y_zero\n\n if self.gcode_op.get() == \"split\":\n self.g_rip.split_code(self.g_rip.scaled_trans,shift=[split_x,split_y,0],angle=split_angle)\n\n if self.rotateb.get() == True:\n self.g_rip.left_side,minx1,maxx1,miny1,maxy1,minz1,maxz1 = \\\n self.g_rip.scale_rotate_code(self.g_rip.left_side,[1,1,1,1],180)\n\n self.g_rip.right_side,minx2,maxx2,miny2,maxy2,minz2,maxz2 = \\\n self.g_rip.scale_rotate_code(self.g_rip.right_side,[1,1,1,1],0)\n\n minx = min(minx1,minx2)\n maxx = max(maxx1,maxx2)\n miny = min(miny1,miny2)\n maxy = max(maxy1,maxy2)\n minz = min(minz1,minz2)\n maxz = max(maxz1,maxz2)\n\n for line in self.g_rip.left_side:\n if line[0] == 3 or line[0] == 2 or line[0] == 1:\n x1 = line[1][0]\n y1 = line[1][1]\n z1 = line[1][2]\n x2 = line[2][0]\n y2 = line[2][1]\n z2 = line[2][2]\n if line[0] == 1:\n self.coords.append([x1, y1, z1, x2, y2, z2, 2, line[0] ])\n elif line[0] == 3 or line[0] == 2:\n xc = line[3][0]\n yc = line[3][1]\n self.coords.append([x1, y1, z1, x2, y2, z2, 2, line[0], xc, yc ])\n for line in self.g_rip.right_side:\n if line[0] == 3 or line[0] == 2 or line[0] == 1:\n x1 = line[1][0]\n y1 = line[1][1]\n z1 = line[1][2]\n x2 = line[2][0]\n y2 = line[2][1]\n z2 = line[2][2]\n if line[0] == 1:\n self.coords.append([x1, y1, z1, x2, y2, z2, 3, line[0] ])\n elif line[0] == 3 or line[0] == 2:\n xc = line[3][0]\n yc = line[3][1]\n self.coords.append([x1, y1, z1, x2, y2, z2, 3, line[0], xc, yc ])\n \n elif self.gcode_op.get() == \"probe\":\n if (self.probe_data==[]):\n min_probe_x = minx\n min_probe_y = miny\n max_probe_x = maxx\n max_probe_y = maxy \n \n else:\n Xoffset = float(self.probe_offsetX.get())\n Yoffset = float(self.probe_offsetY.get())\n \n min_probe_x = self.probe_data[0][0] - Xoffset\n min_probe_y = self.probe_data[0][1] - Yoffset\n\n last_point = len(self.probe_data)-1\n\n max_probe_x = self.probe_data[last_point][0] - Xoffset\n max_probe_y = self.probe_data[last_point][1] - Yoffset\n \n nX = int(max(2,int(probe_nX)))\n nY = int(max(2,int(probe_nY)))\n xPartitionLength = (max_probe_x-min_probe_x)/(nX-1)\n if (xPartitionLength < Zero): xPartitionLength=.001\n yPartitionLength = (max_probe_y-min_probe_y)/(nY-1)\n if (yPartitionLength < Zero): yPartitionLength=.001\n \n self.g_rip.probe_code(self.g_rip.scaled_trans,nX,nY,probe_istep,min_probe_x,min_probe_y,xPartitionLength,yPartitionLength)\n\n for line in self.g_rip.probe_gcode:\n if line[0] == 3 or line[0] == 2 or line[0] == 1:\n x1 = line[1][0]\n y1 = line[1][1]\n z1 = line[1][2]\n x2 = line[2][0]\n y2 = line[2][1]\n z2 = line[2][2]\n if line[0] == 1:\n self.coords.append([x1, y1, z1, x2, y2, z2, 1, line[0] ])\n elif line[0] == 3 or line[0] == 2:\n xc = line[3][0]\n yc = line[3][1]\n self.coords.append([x1, y1, z1, x2, y2, z2, 1, line[0], xc, yc ])\n \n if (self.probe_data==[]):\n for line in self.g_rip.probe_coords:\n xp = line[2]\n yp = line[3]\n zp = probe_depth\n Lpt= xPartitionLength/5\n if (line[0]):\n self.coords.append([xp-Lpt, yp , zp, xp+Lpt, yp , zp, 3, 1 ])\n self.coords.append([xp , yp+Lpt, zp, xp , yp-Lpt, zp, 3, 1 ])\n self.coords.append([xp , yp , 0, xp , yp , zp, 3, 1 ])\n else:\n self.coords.append([xp-Lpt, yp , zp, xp+Lpt, yp , zp, 2, 1 ])\n self.coords.append([xp , yp+Lpt, zp, xp , yp-Lpt, zp, 2, 1 ])\n self.coords.append([xp , yp , 0, xp , yp , zp, 2, 1 ])\n else:\n for line in self.probe_data:\n Xoffset = float(self.probe_offsetX.get())\n Yoffset = float(self.probe_offsetY.get())\n Zoffset = float(self.probe_offsetZ.get())\n xp = line[0] - Xoffset\n yp = line[1] - Yoffset\n zp = line[2] - Zoffset\n Lpt= xPartitionLength/5\n self.coords.append([xp-Lpt, yp , zp, xp+Lpt, yp , zp, 2, 1 ])\n self.coords.append([xp , yp+Lpt, zp, xp , yp-Lpt, zp, 2, 1 ])\n self.coords.append([xp , yp , 0, xp , yp , zp, 2, 1 ])\n \n else:\n for line in self.g_rip.scaled_trans:\n if line[0] == 3 or line[0] == 2 or line[0] == 1:\n x1 = line[1][0]\n y1 = line[1][1]\n z1 = line[1][2]\n x2 = line[2][0]\n y2 = line[2][1]\n z2 = line[2][2]\n if line[0] == 1:\n self.coords.append([x1, y1, z1, x2, y2, z2, 1, line[0] ])\n elif line[0] == 3 or line[0] == 2:\n xc = line[3][0]\n yc = line[3][1]\n self.coords.append([x1, y1, z1, x2, y2, z2, 1, line[0], xc, yc ])\n\n self.MAXX=maxx \n self.MINX=minx \n self.MAXY=maxy\n self.MINY=miny\n self.MAXZ=maxz\n self.MINZ=minz\n\n # Reset Status Bar and Entry Fields\n\n self.entry_set(self.Entry_GscaleXY, self.Entry_GscaleXY_Check() ,1)\n self.entry_set(self.Entry_GscaleZ, self.Entry_GscaleZ_Check() ,1)\n self.entry_set(self.Entry_GscaleF, self.Entry_GscaleF_Check() ,1)\n self.entry_set(self.Entry_Rotate, self.Entry_Rotate_Check() ,1)\n self.entry_set(self.Entry_SplitX, self.Entry_SplitX_Check() ,1)\n self.entry_set(self.Entry_SplitY, self.Entry_SplitY_Check() ,1)\n self.entry_set(self.Entry_SplitA, self.Entry_SplitA_Check() ,1)\n self.entry_set(self.Entry_Feed, self.Entry_Feed_Check() ,1)\n self.entry_set(self.Entry_Zsafe, self.Entry_Zsafe_Check() ,1)\n self.entry_set(self.Entry_Wrap_DIA, self.Entry_Wrap_DIA_Check() ,1)\n self.entry_set(self.Entry_Probe_Num_X,self.Entry_probe_nX_Check() ,1)\n self.entry_set(self.Entry_Probe_Num_Y,self.Entry_probe_nY_Check() ,1)\n self.entry_set(self.Entry_ProbeOffsetX,self.Entry_ProbeOffsetX_Check() ,1)\n self.entry_set(self.Entry_ProbeOffsetY,self.Entry_ProbeOffsetY_Check() ,1)\n self.entry_set(self.Entry_ProbeOffsetZ,self.Entry_ProbeOffsetZ_Check() ,1)\n self.entry_set(self.Entry_ProbeDepth,self.Entry_ProbeDepth_Check() ,1)\n \n \n\n if (self.gcode_op.get()==\"none\") or (self.gcode_op.get()==\"split\") or (self.gcode_op.get()==\"probe\"):\n self.statusMessage.set(\"Bounding Box = \" +\n \"%.3g\" % (maxx-minx) +\n \" %s \" % self.units.get() +\n \" x \" +\n \"%.3g\" % (maxy-miny) +\n \" %s \" % self.units.get() +\n \" %s\" % message2)\n else:\n self.statusMessage.set(\" \")\n \n self.Plot_Data()\n ################\n # End DoIt #\n ################\n\n################################################################################\n# General Settings Window #\n################################################################################ \n def GEN_Settings_Window(self):\n gen_settings = Toplevel(width=560, height=485)\n gen_settings.grab_set() # Use grab_set to prevent user input in the main window during calculations\n gen_settings.resizable(0,0)\n gen_settings.title('Settings')\n gen_settings.iconname(\"Settings\")\n \n D_Yloc = 6\n D_dY = 24\n xd_label_L = 12\n\n w_label=150\n w_entry=60\n w_units=35\n xd_entry_L=xd_label_L+w_label+10 \n xd_units_L=xd_entry_L+w_entry+5\n\n #Radio Button\n D_Yloc=D_Yloc+D_dY\n self.Label_Units = Label(gen_settings,text=\"Units\")\n self.Label_Units.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Radio_Units_IN = Radiobutton(gen_settings,text=\"inch\", value=\"in\",\n width=\"100\", anchor=W)\n self.Radio_Units_IN.place(x=w_label+22, y=D_Yloc, width=75, height=23)\n self.Radio_Units_IN.configure(variable=self.units )\n self.Radio_Units_MM = Radiobutton(gen_settings,text=\"mm\", value=\"mm\",\n width=\"100\", anchor=W)\n self.Radio_Units_MM.place(x=w_label+110, y=D_Yloc, width=75, height=23)\n self.Radio_Units_MM.configure(variable=self.units )\n self.units.trace_variable(\"w\", self.Entry_units_var_Callback)\n \n D_Yloc=D_Yloc+D_dY\n self.Label_ArcAngle = Label(gen_settings,text=\"Arc Angle\")\n self.Label_ArcAngle.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_ArcAngle_u = Label(gen_settings,text=\"deg\", anchor=W)\n self.Label_ArcAngle_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_ArcAngle = Entry(gen_settings,width=\"15\")\n self.Entry_ArcAngle.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_ArcAngle.configure(textvariable=self.segarc)\n self.Entry_ArcAngle.bind('', self.Settings_ReLoad_Click)\n self.segarc.trace_variable(\"w\", self.Entry_ArcAngle_Callback)\n self.entry_set(self.Entry_ArcAngle,self.Entry_ArcAngle_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_Accuracy = Label(gen_settings,text=\"Accuracy\")\n self.Label_Accuracy.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_Accuracy_u = Label(gen_settings,textvariable=self.units, anchor=W)\n self.Label_Accuracy_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_Accuracy = Entry(gen_settings,width=\"15\")\n self.Entry_Accuracy.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_Accuracy.configure(textvariable=self.accuracy)\n self.Entry_Accuracy.bind('', self.Settings_ReLoad_Click)\n self.accuracy.trace_variable(\"w\", self.Entry_Accuracy_Callback)\n self.entry_set(self.Entry_Accuracy,self.Entry_Accuracy_Check(),2)\n \n D_Yloc=D_Yloc+D_dY\n self.Label_clean = Label(gen_settings,text=\"XY Arcs to Lines\")\n self.Label_clean.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Checkbutton_clean = Checkbutton(gen_settings,text=\"\", anchor=W)\n self.Checkbutton_clean.place(x=xd_entry_L, y=D_Yloc, width=75, height=23)\n self.Checkbutton_clean.configure(variable=self.arc2line)\n self.arc2line.trace_variable(\"w\", self.Settings_ReLoad_Click)\n \n D_Yloc=D_Yloc+D_dY\n self.Label_Gpre = Label(gen_settings,text=\"G Code Header\")\n self.Label_Gpre.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Entry_Gpre = Entry(gen_settings,width=\"15\")\n self.Entry_Gpre.place(x=xd_entry_L, y=D_Yloc, width=300, height=23)\n self.Entry_Gpre.configure(textvariable=self.gpre)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_Gpost = Label(gen_settings,text=\"G Code Postscript\")\n self.Label_Gpost.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Entry_Gpost = Entry(gen_settings,width=\"15\")\n self.Entry_Gpost.place(x=xd_entry_L, y=D_Yloc, width=300, height=23)\n self.Entry_Gpost.configure(textvariable=self.gpost)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_var_dis = Label(gen_settings,text=\"Disable Variables\")\n self.Label_var_dis.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Checkbutton_var_dis = Checkbutton(gen_settings,text=\"\", anchor=W)\n self.Checkbutton_var_dis.place(x=xd_entry_L, y=D_Yloc, width=75, height=23)\n self.Checkbutton_var_dis.configure(variable=self.var_dis)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_DPlaces_L = Label(gen_settings,text=\"Decimal Places (XYZ)\")\n self.Label_DPlaces_L.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Entry_DPlaces_L = Entry(gen_settings,width=\"15\")\n self.Entry_DPlaces_L.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_DPlaces_L.configure(textvariable=self.DPlaces_L)\n self.Entry_DPlaces_L.bind('', self.Settings_ReLoad_Click)\n self.DPlaces_L.trace_variable(\"w\", self.Entry_DPlaces_L_Callback)\n self.entry_set(self.Entry_DPlaces_L,self.Entry_DPlaces_L_Check(),2)\n \n D_Yloc=D_Yloc+D_dY\n self.Label_DPlaces_R = Label(gen_settings,text=\"Decimal Places (Rotary)\")\n self.Label_DPlaces_R.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Entry_DPlaces_R = Entry(gen_settings,width=\"15\")\n self.Entry_DPlaces_R.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_DPlaces_R.configure(textvariable=self.DPlaces_R)\n self.Entry_DPlaces_R.bind('', self.Settings_ReLoad_Click)\n self.DPlaces_R.trace_variable(\"w\", self.Entry_DPlaces_R_Callback)\n self.entry_set(self.Entry_DPlaces_R,self.Entry_DPlaces_R_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_DPlaces_F = Label(gen_settings,text=\"Decimal Places (Feed)\")\n self.Label_DPlaces_F.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Entry_DPlaces_F = Entry(gen_settings,width=\"15\")\n self.Entry_DPlaces_F.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_DPlaces_F.configure(textvariable=self.DPlaces_F)\n self.Entry_DPlaces_F.bind('', self.Settings_ReLoad_Click)\n self.DPlaces_F.trace_variable(\"w\", self.Entry_DPlaces_F_Callback)\n self.entry_set(self.Entry_DPlaces_F,self.Entry_DPlaces_F_Check(),2)\n \n D_Yloc=D_Yloc+D_dY\n self.Label_WriteAll = Label(gen_settings,text=\"Write all Coords\")\n self.Label_WriteAll.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Checkbutton_WriteAll = Checkbutton(gen_settings,text=\"\", anchor=W)\n self.Checkbutton_WriteAll.place(x=xd_entry_L, y=D_Yloc, width=75, height=23)\n self.Checkbutton_WriteAll.configure(variable=self.WriteAll)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_NoComments = Label(gen_settings,text=\"Remove Comments\")\n self.Label_NoComments.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Checkbutton_NoComments = Checkbutton(gen_settings,text=\"\", anchor=W)\n self.Checkbutton_NoComments.place(x=xd_entry_L, y=D_Yloc, width=75, height=23)\n self.Checkbutton_NoComments.configure(variable=self.NoComments)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SaveConfig = Label(gen_settings,text=\"Configuration File\")\n self.Label_SaveConfig.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.GEN_SaveConfig = Button(gen_settings,text=\"Save\")\n self.GEN_SaveConfig.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=21, anchor=\"nw\")\n self.GEN_SaveConfig.bind(\"\", self.Write_Config_File)\n \n ## Buttons ##\n gen_settings.update_idletasks()\n Ybut=int(gen_settings.winfo_height())-30\n Xbut=int(gen_settings.winfo_width()/2)\n\n self.GEN_Reload = Button(gen_settings,text=\"Recalculate\")\n self.GEN_Reload.place(x=Xbut-65, y=Ybut, width=130, height=30, anchor=\"e\")\n self.GEN_Reload.bind(\"\", self.Recalculate_Click)\n \n self.GEN_Recalculate = Button(gen_settings,text=\"Re-Load G-Code\")\n self.GEN_Recalculate.place(x=Xbut, y=Ybut, width=130, height=30, anchor=\"c\")\n self.GEN_Recalculate.bind(\"\", self.Settings_ReLoad_Click)\n \n self.GEN_Close = Button(gen_settings,text=\"Close\")\n self.GEN_Close.bind(\"\", self.Close_Current_Window_Click)\n \n self.GEN_Close.place(x=Xbut+65, y=Ybut, width=130, height=30, anchor=\"w\")\n\n\n################################################################################\n# Stock Round Window #\n################################################################################ \n def STOCK_Round_Window(self):\n stock_round_win = Toplevel(width=300, height=350)\n stock_round_win.grab_set() # Use grab_set to prevent user input in the main window during calculations\n stock_round_win.resizable(0,0)\n stock_round_win.title('Stock Rounding')\n stock_round_win.iconname(\"Stock Rounding\")\n \n #####################################\n if self.WRAP_TYPE.get() == \"Y2A\" or self.WRAP_TYPE.get() == \"Y2B\":\n self.SRmin_label.set(\"Min X\")\n self.SRmax_label.set(\"Max X\")\n else:\n self.SRmin_label.set(\"Min Y\")\n self.SRmax_label.set(\"Max Y\")\n #####################################\n \n D_Yloc = 6\n D_dY = 24\n xd_label_L = 12\n\n w_label=130\n w_entry=60\n w_units=35\n xd_entry_L=xd_label_L+w_label+10 \n xd_units_L=xd_entry_L+w_entry+5\n\n D_Yloc=D_Yloc+D_dY \n self.Label_SR_DIA_REF = Label(stock_round_win,text=\"Wrap Diameter\")\n self.Label_SR_DIA_REF.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_DIA_REF_u = Label(stock_round_win,textvariable=self.units, anchor=W)\n self.Label_SR_DIA_REF_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Label_SR_DIA_DATA = Label(stock_round_win,textvariable=self.WRAP_DIA)\n self.Label_SR_DIA_DATA.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n \n D_Yloc=D_Yloc+D_dY\n self.Label_SR_Tool_DIA = Label(stock_round_win,text=\"Tool Diameter\")\n self.Label_SR_Tool_DIA.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_Tool_DIA_u = Label(stock_round_win,textvariable=self.units, anchor=W)\n self.Label_SR_Tool_DIA_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_SR_Tool_DIA = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_Tool_DIA.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_Tool_DIA.configure(textvariable=self.sr_tool_dia)\n self.sr_tool_dia.trace_variable(\"w\", self.Entry_SR_Tool_DIA_Callback)\n self.entry_set(self.Entry_SR_Tool_DIA,self.Entry_SR_Tool_DIA_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_Step = Label(stock_round_win,text=\"Step Over\")\n self.Label_SR_Step.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_Step_u = Label(stock_round_win,text=\"%\", anchor=W)\n self.Label_SR_Step_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_SR_Step = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_Step.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_Step.configure(textvariable=self.sr_step)\n self.sr_step.trace_variable(\"w\", self.Entry_SR_Step_Callback)\n self.entry_set(self.Entry_SR_Step,self.Entry_SR_Step_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_Remove = Label(stock_round_win,text=\"Cut Depth\")\n self.Label_SR_Remove.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_Remove_u = Label(stock_round_win,textvariable=self.units, anchor=W)\n self.Label_SR_Remove_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_SR_Remove = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_Remove.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_Remove.configure(textvariable=self.sr_remove)\n self.Entry_SR_Remove.bind('', self.Settings_ReLoad_Click)\n self.sr_remove.trace_variable(\"w\", self.Entry_SR_Remove_Callback)\n self.entry_set(self.Entry_SR_Remove,self.Entry_SR_Remove_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_MIN_X = Label(stock_round_win,textvariable=self.SRmin_label)\n self.Label_SR_MIN_X.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_MIN_X_u = Label(stock_round_win,textvariable=self.units, anchor=W)\n self.Label_SR_MIN_X_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_SR_MIN_X = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_MIN_X.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_MIN_X.configure(textvariable=self.sr_minx)\n self.sr_minx.trace_variable(\"w\", self.Entry_SR_MIN_X_Callback)\n self.entry_set(self.Entry_SR_MIN_X,self.Entry_SR_MIN_X_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_MAX_X = Label(stock_round_win,textvariable=self.SRmax_label)\n self.Label_SR_MAX_X.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_MAX_X_u = Label(stock_round_win,textvariable=self.units, anchor=W)\n self.Label_SR_MAX_X_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_SR_MAX_X = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_MAX_X.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_MAX_X.configure(textvariable=self.sr_maxx)\n self.sr_maxx.trace_variable(\"w\", self.Entry_SR_MAX_X_Callback)\n self.entry_set(self.Entry_SR_MAX_X,self.Entry_SR_MAX_X_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_ZSafe = Label(stock_round_win,text=\"Z Safe\")\n self.Label_SR_ZSafe.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_ZSafe_u = Label(stock_round_win,textvariable=self.units, anchor=W)\n self.Label_SR_ZSafe_u.place(x=xd_units_L, y=D_Yloc, width=w_units, height=21)\n self.Entry_SR_ZSafe = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_ZSafe.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_ZSafe.configure(textvariable=self.sr_zsafe)\n self.sr_zsafe.trace_variable(\"w\", self.Entry_SR_ZSafe_Callback)\n self.entry_set(self.Entry_SR_ZSafe,self.Entry_SR_ZSafe_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_Feed = Label(stock_round_win,text=\"Feed Rate\")\n self.Label_SR_Feed.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_Feed_u = Label(stock_round_win,textvariable=self.funits, anchor=W)\n self.Label_SR_Feed_u.place(x=xd_units_L, y=D_Yloc, width=w_units+15, height=21)\n self.Entry_SR_Feed = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_Feed.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_Feed.configure(textvariable=self.sr_feed)\n self.Entry_SR_Feed.bind('', self.Settings_ReLoad_Click)\n self.sr_feed.trace_variable(\"w\", self.Entry_SR_Feed_Callback)\n self.entry_set(self.Entry_SR_Feed,self.Entry_SR_Feed_Check(),2)\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_PlungeFeed = Label(stock_round_win,text=\"Plunge Feed\")\n self.Label_SR_PlungeFeed.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Label_SR_PlungeFeed_u = Label(stock_round_win,textvariable=self.funits, anchor=W)\n self.Label_SR_PlungeFeed_u.place(x=xd_units_L, y=D_Yloc, width=w_units+15, height=21)\n self.Entry_SR_PlungeFeed = Entry(stock_round_win,width=\"15\")\n self.Entry_SR_PlungeFeed.place(x=xd_entry_L, y=D_Yloc, width=w_entry, height=23)\n self.Entry_SR_PlungeFeed.configure(textvariable=self.sr_plungef)\n self.Entry_SR_PlungeFeed.bind('', self.Settings_ReLoad_Click)\n self.sr_plungef.trace_variable(\"w\", self.Entry_SR_PlungeFeed_Callback)\n self.entry_set(self.Entry_SR_PlungeFeed,self.Entry_SR_PlungeFeed_Check(),2)\n\n ##self.round_type #\"axial\" or \"spiral\"\n ##Radio Button\n #D_Yloc=D_Yloc+D_dY\n #self.Label_SR_Type = Label(stock_round_win,text=\"Type\")\n #self.Label_SR_Type.place(x=xd_label_L, y=D_Yloc, width=113, height=21)\n #self.Radio_SR_Type_Spiral = Radiobutton(stock_round_win,text=\"Spiral\", value=\"spiral\", width=\"100\", anchor=W)\n #self.Radio_SR_Type_Spiral.place(x=w_label+22, y=D_Yloc, width=75, height=23)\n #self.Radio_SR_Type_Spiral.configure(variable=self.round_type )\n #self.Radio_SR_Type_Linear = Radiobutton(stock_round_win,text=\"Axial\", value=\"axial\", width=\"100\", anchor=W)\n #self.Radio_SR_Type_Linear.place(x=w_label+110, y=D_Yloc, width=75, height=23)\n #self.Radio_SR_Type_Linear.configure(variable=self.round_type )\n\n D_Yloc=D_Yloc+D_dY\n self.Label_SR_Climb = Label(stock_round_win,text=\"Climb Mill\")\n self.Label_SR_Climb.place(x=xd_label_L, y=D_Yloc, width=w_label, height=21)\n self.Checkbutton_SR_Climb = Checkbutton(stock_round_win,text=\"\", anchor=W)\n self.Checkbutton_SR_Climb.place(x=xd_entry_L, y=D_Yloc, width=75, height=23)\n self.Checkbutton_SR_Climb.configure(variable=self.sr_climb)\n\n ## Buttons ##\n stock_round_win.update_idletasks()\n Ybut=int(stock_round_win.winfo_height())-30\n Xbut=int(stock_round_win.winfo_width()/2)\n \n self.SR_Save = Button(stock_round_win,text=\"Save Rounding G-Code\", command=self.menu_File_Save_G_Code_round)\n self.SR_Save.place(x=Xbut, y=Ybut, width=140, height=30, anchor=\"e\")\n \n self.GEN_Close = Button(stock_round_win,text=\"Close\")\n self.GEN_Close.bind(\"\", self.Close_Current_Window_Click) \n self.GEN_Close.place(x=Xbut, y=Ybut, width=140, height=30, anchor=\"w\")\n\n#################\n### START LIB ###\n#################\n############################################################################\nclass G_Code_Rip:\n def __init__(self):\n self.Zero = 0.0000001\n self.g_code_data = []\n self.scaled_trans = []\n self.right_side = []\n self.left_side = []\n self.probe_gcode = []\n self.probe_coords = []\n self.arc_angle = 10\n self.accuracy = .001\n self.units = \"in\"\n\n def Read_G_Code(self,filename, XYarc2line = False, arc_angle=10, units=\"in\", Accuracy=\"\"):\n self.g_code_data = []\n self.scaled_trans = []\n self.right_side = []\n self.left_side = []\n self.probe_gcode = []\n self.probe_coords = []\n self.arc_angle = arc_angle\n self.units = units\n if Accuracy == \"\":\n if units == \"in\":\n self.accuracy = .001\n else:\n self.accuracy = .025\n else:\n self.accuracy = float(Accuracy)\n \n READ_MSG = []\n\n # Try to open file for reading\n try:\n fin = open(filename,'r')\n except:\n READ_MSG.append(\"Unable to open file: %s\" %(filename))\n return READ_MSG\n\n scale = 1\n variables = []\n line_number = 0\n\n xind=0\n yind=1\n zind=2\n\n mode_arc = \"incremental\" # \"absolute\"\n mode_pos = \"absolute\" # \"incremental\"\n\n mvtype = 1 # G0 (Rapid), G1 (linear), G2 (clockwise arc) or G3 (counterclockwise arc). \n plane = \"17\" # G17 (Z-axis, XY-plane), G18 (Y-axis, XZ-plane), or G19 (X-axis, YZ-plane)\n pos =['','','']\n pos_last=['','','']\n POS =[complex(0,1),complex(0,1),complex(0,1)]\n feed = 0 \n \n #########################\n for line in fin:\n line_number = line_number + 1\n #print line_number\n line = line.replace(\"\\n\",\"\")\n line = line.replace(\"\\r\",\"\")\n code_line=[]\n \n #####################\n ### FIND COMMENTS ###\n #####################\n if line.find(\"(\") != -1:\n s = line.find(\"(\")\n p_cnt=0\n e = len(line)\n for i_txt in range(s,len(line)):\n if line[i_txt]==\"(\":\n p_cnt=p_cnt+1\n if line[i_txt]==\")\":\n p_cnt=p_cnt-1\n if p_cnt==0:\n e=i_txt\n #print(e,line[s:e+1])\n break\n code_line.append([ \";\", line[s:e+1] ])\n line = self.rm_text(line,s,e)\n \n if line.find(\";\") != -1:\n s = line.find(\";\")\n e = len(line)\n code_line.append([ \";\", line[s:e] ])\n line = self.rm_text(line,s,e)\n # If comment exists write it to output \n if code_line!= []: \n for comment in code_line:\n self.g_code_data.append(comment)\n code_line=[]\n\n # Switch remaining non comment data to upper case\n # and remove spaces\n line = line.upper()\n line = line.replace(\" \",\"\")\n\n \n #####################################################\n # Find # chars and check for a variable definition #\n #####################################################\n if line.find(\"#\") != -1:\n s = line.rfind(\"#\")\n while s != -1:\n if line[s+1] == '<':\n e = s+2\n while line[e] != '>' and e <= len(line):\n e = e+1\n e = e+1\n vname = line[s:e].lower()\n else:\n vname = re.findall(r'[-+]?\\d+',line[s:])[0]\t\n e = s + 1 + len(vname)\n vname = line[s:e]\n\n DEFINE = False\n if e < len(line):\n if line[e]==\"=\":\n DEFINE = True\n if DEFINE:\n try:\n vval = \"%.4f\" %(float(line[e+1:]))\n line = ''\n except:\n try:\n vval = self.EXPRESSION_EVAL(line[e+1:])\n line = ''\n except:\n READ_MSG.append(str(sys.exc_info()[1]))\n return READ_MSG\n \n variables.append([vname,vval])\n line = self.rm_text(line,s,e-1)\n else:\n line = self.rm_text(line,s,e-1)\n VALUE = ''\n for V in variables:\n if V[0] == vname:\n VALUE = V[1]\n \n line = self.insert_text(line,VALUE,s)\n \n s = line.rfind(\"#\")\n\n #########################\n ### FIND MATH REGIONS ###\n #########################\n if line.find(\"[\") != -1 and line.find(\"[\") != 0:\n ############################\n s = line.find(\"[\")\n while s != -1:\n e = s + 1\n val = 1\n while val > 0:\n if e >= len(line):\n MSG = \"ERROR: Unable to evaluate expression: G-Code Line %d\" %(line_number)\n raise ValueError(MSG)\n if line[e]==\"[\":\n val = val + 1\n elif line[e] == \"]\":\n val = val - 1\n e = e + 1\n \n new_val = self.EXPRESSION_EVAL(line[s:e])\n \n line = self.rm_text(line,s,e-1)\n line = self.insert_text(line,new_val,s)\n s = line.find(\"[\")\n #############################\n\n\n ####################################\n ### FIND FULLY UNSUPPORTED CODES ###\n ####################################\n # D Tool radius compensation number\n # E ...\n # L ...\n # O ... Subroutines\n # Q Feed increment in G73, G83 canned cycles\n # A A axis of machine\n # B B axis of machine\n # C C axis of machine\n # U U axis of machine\n # V V axis of machine\n # W W axis of machine\n\n UCODES = (\"A\",\"B\",\"C\",\"D\",\"E\",\"L\",\"O\",\"Q\",\"U\",\"V\",\"W\")\n skip = False\n for code in UCODES:\n if line.find(code) != -1:\n READ_MSG.append(\"Warning: %s Codes are not supported ( G-Code File Line: %d )\" %(code,line_number))\n skip = True\n if skip:\n continue\n \n\n ##############################\n ### FIND ALL CODES ###\n ##############################\n # F Feed rate\n # G General function\n # I X offset for arcs and G87 canned cycles\n # J Y offset for arcs and G87 canned cycles\n # K Z offset for arcs and G87 canned cycles. Spindle-Motion Ratio for G33 synchronized movements.\n # M Miscellaneous function (See table Modal Groups)\n # P Dwell time in canned cycles and with G4. Key used with G10. Used with G2/G3.\n # R Arc radius or canned cycle plane\n # S Spindle speed\n # T Tool selection\n # X X axis of machine\n # Y Y axis of machine\n # Z Z axis of machine\n \n ALL = (\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\\\n \"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\\\n \"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"#\",\"=\")\n temp = []\n line = line.replace(\" \",\"\")\n for code in ALL:\n index=-1\n index = line.find(code,index+1)\n while index != -1:\n temp.append([code,index])\n index = line.find(code,index+1)\n temp.sort(key=lambda a:a[1])\n\n code_line=[]\n if temp != []:\n x = 0\n while x <= len(temp)-1:\n s = temp[x][1]+1\n if x == len(temp)-1:\n e = len(line)\n else: \n e = temp[x+1][1]\n \n CODE = temp[x][0]\n VALUE = line[s:e]\n code_line.append([ CODE, VALUE ])\n x = x + 1\n\n #################################\n \n mv_flag = 0\n POS_LAST = POS[:]\n #CENTER = ['','','']\n CENTER = POS_LAST[:]\n passthru = \"\"\n for i in range(len(code_line)):\n #for com in code_line:\n com = code_line[i]\n if com[0] == \"G\":\n Gnum = \"%g\" %(float(com[1]))\n if Gnum == \"0\" or Gnum == \"1\":\n mvtype = int(Gnum)\n elif Gnum == \"2\" or Gnum == \"3\":\n mvtype = int(Gnum)\n #CENTER = POS_LAST[:]\n elif Gnum == \"17\":\n plane = Gnum\n elif Gnum == \"18\":\n plane = Gnum\n elif Gnum == \"19\":\n plane = Gnum\n elif Gnum == \"20\":\n if units == \"in\":\n scale = 1\n else:\n scale = 25.4\n elif Gnum == \"21\":\n if units == \"mm\":\n scale = 1\n else:\n scale = 1.0/25.4\n elif Gnum == \"81\":\n READ_MSG.append(\"Warning: G%s Codes are not supported ( G-Code File Line: %d )\" %(Gnum,line_number))\n elif Gnum == \"90.1\":\n mode_arc = \"absolute\"\n \n elif Gnum == \"90\":\n mode_pos = \"absolute\"\n\n elif Gnum == \"91\":\n mode_pos = \"incremental\"\n \n elif Gnum == \"91.1\":\n mode_arc = \"incremental\"\n\n elif Gnum == \"92\":\n READ_MSG.append(\"Warning: G%s Codes are not supported ( G-Code File Line: %d )\" %(Gnum,line_number))\n \n elif Gnum == \"38.2\":\n READ_MSG.append(\"Warning: G%s Codes are not supported ( G-Code File Line: %d )\" %(Gnum,line_number))\n\n elif Gnum == \"43\":\n passthru = passthru + \"%s%s \" %(com[0],com[1])\n\n elif Gnum == \"53\":\n READ_MSG.append(\"Warning: G%s Codes are not fully supported ( G-Code File Line: %d )\" %(Gnum,line_number))\n passthru = passthru + \"%s%s \" %(com[0],com[1])\n for i_dump in range(i+1,len(code_line)):\n print(code_line[i_dump])\n passthru = passthru + \"%s%s \" %(code_line[i_dump][0],code_line[i_dump][1])\n break\n \n else:\n passthru = passthru + \"%s%s \" %(com[0],com[1])\n \n elif com[0] == \"X\":\n if mode_pos == \"absolute\":\n POS[xind] = float(com[1])*scale\n else:\n POS[xind] = float(com[1])*scale + POS_LAST[xind]\n mv_flag = 1\n\n elif com[0] == \"Y\":\n if mode_pos == \"absolute\":\n POS[yind] = float(com[1])*scale\n else:\n POS[yind] = float(com[1])*scale + POS_LAST[yind]\n mv_flag = 1\n\n elif com[0] == \"Z\": \n if mode_pos == \"absolute\":\n POS[zind] = float(com[1])*scale\n else:\n POS[zind] = float(com[1])*scale + POS_LAST[zind]\n mv_flag = 1\n\n ###################\n elif com[0] == \"I\":\n if mode_arc == \"absolute\":\n CENTER[xind] = float(com[1])*scale\n else:\n CENTER[xind] = float(com[1])*scale + POS_LAST[xind]\n if (mvtype==2 or mvtype==3):\n mv_flag = 1\n \n elif com[0] == \"J\":\n if mode_arc == \"absolute\":\n CENTER[yind] = float(com[1])*scale\n else:\n CENTER[yind] = float(com[1])*scale + POS_LAST[yind]\n if (mvtype==2 or mvtype==3):\n mv_flag = 1\n elif com[0] == \"K\":\n if mode_arc == \"absolute\":\n CENTER[zind] = float(com[1])*scale\n else:\n CENTER[zind] = float(com[1])*scale + POS_LAST[zind]\n if (mvtype==2 or mvtype==3):\n mv_flag = 1\n\n elif com[0] == \"R\":\n Rin= float(com[1])*scale\n CENTER = self.get_center(POS,POS_LAST,Rin,mvtype,plane)\n \n ###################\n elif com[0] == \"F\":\n feed = float(com[1]) * scale\n\n elif com[0] == \";\":\n passthru = passthru + \"%s \" %(com[1])\n\n elif com[0] == \"P\" and mv_flag == 1 and mvtype > 1:\n READ_MSG.append(\"Aborting G-Code Reading: P word specifying the number of full or partial turns of arc are not supported\")\n return READ_MSG\n\n elif com[0] == \"M\":\n Mnum = \"%g\" %(float(com[1]))\n if Mnum == \"2\":\n self.g_code_data.append([ \"M2\", \"(END PROGRAM)\" ])\n passthru = passthru + \"%s%s \" %(com[0],com[1])\n\n elif com[0] == \"N\":\n pass\n #print \"Ignoring Line Number %g\" %(float(com[1]))\n \n else:\n passthru = passthru + \"%s%s \" %(com[0],com[1])\n\n\n pos = POS[:]\n pos_last = POS_LAST[:]\n center = CENTER[:]\n \n # Most command on a line are executed prior to a move so \n # we will write the passthru commands on the line before we found them\n # only \"M0, M1, M2, M30 and M60\" are executed after the move commands\n # there is a risk that one of these commands could stop the program before\n # the move is completed\n\n if passthru != '':\n self.g_code_data.append(\"%s\" %(passthru))\n\n\n ###############################################################################\n if mv_flag == 1:\n if mvtype == 0:\n self.g_code_data.append([mvtype,pos_last[:],pos[:]])\n if mvtype == 1:\n self.g_code_data.append([mvtype,pos_last[:],pos[:],feed])\n if mvtype == 2 or mvtype == 3:\n if plane == \"17\":\n if XYarc2line == False:\n self.g_code_data.append([mvtype,pos_last[:],pos[:],center[:],feed])\n else:\n data = self.arc2lines(pos_last[:],pos[:],center[:], mvtype, plane)\n \n for line in data:\n XY=line\n self.g_code_data.append([1,XY[:3],XY[3:],feed])\n \n elif plane == \"18\":\n data = self.arc2lines(pos_last[:],pos[:],center[:], mvtype, plane)\n for line in data:\n XY=line\n self.g_code_data.append([1,XY[:3],XY[3:],feed])\n \n elif plane == \"19\":\n data = self.arc2lines(pos_last[:],pos[:],center[:], mvtype, plane)\n for line in data:\n XY=line\n self.g_code_data.append([1,XY[:3],XY[3:],feed])\n ###############################################################################\n #################################\n fin.close()\n \n ## Post process the g-code data to remove complex numbers\n cnt = 0\n firstx = complex(0,1)\n firsty = complex(0,1)\n firstz = complex(0,1)\n first_sum = firstx + firsty + firstz\n while ((cnt < len(self.g_code_data)) and (isinstance(first_sum, complex))):\n line = self.g_code_data[cnt]\n if line[0] == 0 or line[0] == 1 or line[0] == 2 or line[0] == 3:\n if (isinstance(firstx, complex)): firstx = line[2][0]\n if (isinstance(firsty, complex)): firsty = line[2][1]\n if (isinstance(firstz, complex)): firstz = line[2][2]\n cnt=cnt+1\n first_sum = firstx + firsty + firstz\n max_cnt = cnt\n cnt = 0\n ambiguousX = False\n ambiguousY = False\n ambiguousZ = False\n while (cnt < max_cnt):\n line = self.g_code_data[cnt]\n if line[0] == 1 or line[0] == 2 or line[0] == 3:\n # X Values\n if (isinstance(line[1][0], complex)):\n line[1][0] = firstx\n ambiguousX = True\n if (isinstance(line[2][0], complex)):\n line[2][0] = firstx\n ambiguousX = True\n # Y values\n if (isinstance(line[1][1], complex)):\n line[1][1] = firsty\n ambiguousY = True\n if (isinstance(line[2][1], complex)):\n line[2][1] = firsty\n ambiguousY = True\n # Z values\n if (isinstance(line[1][2], complex)):\n line[1][2] = firstz\n ambiguousZ = True\n if (isinstance(line[2][2], complex)):\n line[2][2] = firstz\n ambiguousZ = True\n cnt=cnt+1\n if (ambiguousX or ambiguousY or ambiguousZ):\n MSG = \"Ambiguous G-Code start location:\\n\"\n if (ambiguousX): MSG = MSG + \"X position is not set by a G0(rapid) move prior to a G1,G2 or G3 move.\\n\"\n if (ambiguousY): MSG = MSG + \"Y position is not set by a G0(rapid) move prior to a G1,G2 or G3 move.\\n\"\n if (ambiguousZ): MSG = MSG + \"Z position is not set by a G0(rapid) move prior to a G1,G2 or G3 move.\\n\"\n MSG = MSG + \"!! Review output files carefully !!\"\n READ_MSG.append(MSG)\n \n return READ_MSG\n\n def get_center(self,POS,POS_LAST,Rin,mvtype,plane=\"17\"):\n if plane == \"18\":\n xind=2\n yind=0\n zind=1\n elif plane == \"19\":\n xind=1\n yind=2\n zind=0\n elif plane == \"17\":\n xind=0\n yind=1\n zind=2\n\n CENTER=[\"\",\"\",\"\"]\n cord = sqrt( (POS[xind]-POS_LAST[xind])**2 + (POS[yind]-POS_LAST[yind])**2 )\n v1 = cord/2.0\n \n #print \"rin=%f v1=%f (Rin**2 - v1**2)=%f\" %(Rin,v1,(Rin**2 - v1**2))\n v2_sq = Rin**2 - v1**2\n if v2_sq<0.0:\n v2_sq = 0.0\n v2 = sqrt( v2_sq )\n\n theta = self.Get_Angle2(POS[xind]-POS_LAST[xind],POS[yind]-POS_LAST[yind])\n\n if mvtype == 3:\n dxc,dyc = self.Transform(-v2,v1,radians(theta-90))\n elif mvtype == 2:\n dxc,dyc = self.Transform(v2,v1,radians(theta-90))\n else:\n return \"Center Error\"\n\n xcenter = POS_LAST[xind] + dxc\n ycenter = POS_LAST[yind] + dyc\n\n CENTER[xind] = xcenter\n CENTER[yind] = ycenter\n CENTER[zind] = POS_LAST[zind]\n\n return CENTER\n\n #######################################\n def split_code(self,code2split,shift=[0,0,0],angle=0.0):\n xsplit=0.0\n mvtype = -1 # G0 (Rapid), G1 (linear), G2 (clockwise arc) or G3 (counterclockwise arc).\n\n passthru = \"\"\n POS =[0,0,0]\n feed = 0\n self.right_side = []\n self.left_side = []\n\n L = 0\n R = 1\n for line in code2split:\n if line[0] == 1:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = ['','','']\n feed = line[3]\n\n elif line[0] == 3 or line[0] == 2:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = line[3][:]\n feed = line[4]\n\n else:\n mvtype = -1\n passthru = line\n \n ###############################################################################\n if mvtype >= 1 and mvtype <= 3:\n pos = self.coordop(POS,shift,angle)\n pos_last = self.coordop(POS_LAST,shift,angle)\n\n if CENTER[0]!='' and CENTER[1]!='':\n center = self.coordop(CENTER,shift,angle)\n else:\n center = CENTER\n\n this=\"\"\n other=\"\"\n \n if pos_last[0] > xsplit+self.Zero:\n flag_side = R\n elif pos_last[0] < xsplit-self.Zero:\n flag_side = L\n else:\n if mvtype == 1:\n if pos[0] >= xsplit:\n flag_side = R\n else:\n flag_side = L\n \n elif mvtype == 2:\n \n if abs(pos_last[1]-center[1]) < self.Zero:\n if center[0] > xsplit:\n flag_side = R\n else:\n flag_side = L\n else:\n if pos_last[1] >= center[1]:\n flag_side = R\n else:\n flag_side = L\n \n else: #(mvtype == 3)\n if abs(pos_last[1]-center[1]) < self.Zero:\n if center[0] > xsplit:\n flag_side = R\n else:\n flag_side = L\n else:\n if pos_last[1] >= center[1]:\n flag_side = L\n else:\n flag_side = R\n\n if flag_side == R:\n this = 1\n other = 0\n else:\n this = 0\n other = 1\n \n app=[self.apright, self.apleft]\n \n #############################\n if mvtype == 0:\n pass\n\n if mvtype == 1:\n A = self.coordunop(pos_last[:],shift,angle)\n C = self.coordunop(pos[:] ,shift,angle)\n cross = self.get_line_intersect(pos_last, pos, xsplit)\n\n if len(cross) > 0: ### Line crosses boundary ###\n B = self.coordunop(cross[0] ,shift,angle)\n app[this] ( [mvtype,A,B,feed] )\n app[other]( [mvtype,B,C,feed] )\n else:\n app[this] ( [mvtype,A,C,feed] )\n\n if mvtype == 2 or mvtype == 3:\n A = self.coordunop(pos_last[:],shift,angle)\n C = self.coordunop(pos[:] ,shift,angle)\n D = self.coordunop(center ,shift,angle)\n cross = self.get_arc_intersects(pos_last[:], pos[:], xsplit, center[:], \"G%d\" %(mvtype))\n\n if len(cross) > 0: ### Arc crosses boundary at least once ###\n B = self.coordunop(cross[0] ,shift,angle)\n #Check length of arc before writing\n if sqrt((A[0]-B[0])**2 + (A[1]-B[1])**2) > self.accuracy:\n app[this]( [mvtype,A,B,D,feed])\n \n if len(cross) == 1: ### Arc crosses boundary only once ###\n #Check length of arc before writing\n if sqrt((B[0]-C[0])**2 + (B[1]-C[1])**2) > self.accuracy:\n app[other]([ mvtype,B,C,D, feed] )\n if len(cross) == 2: ### Arc crosses boundary twice ###\n E = self.coordunop(cross[1],shift,angle)\n #Check length of arc before writing\n if sqrt((B[0]-E[0])**2 + (B[1]-E[1])**2) > self.accuracy:\n app[other]([ mvtype,B,E,D, feed] )\n #Check length of arc before writing\n if sqrt((E[0]-C[0])**2 + (E[1]-C[1])**2) > self.accuracy:\n app[this] ([ mvtype,E,C,D, feed] )\n else: ### Arc does not cross boundary ###\n app[this]([ mvtype,A,C,D, feed])\n\n ###############################################################################\n else:\n if passthru != '':\n self.apboth(passthru)\n\n #######################################\n def probe_code(self,code2probe,nX,nY,probe_istep,minx,miny,xPartitionLength,yPartitionLength): #,Xoffset,Yoffset):\n #def probe_code(self,code2probe,nX,nY,probe_istep,minx,miny,xPartitionLength,yPartitionLength,Xoffset,Yoffset,Zoffset):\n #print \"nX,nY =\",nX,nY \n probe_coords = []\n BPN=500\n POINT_LIST = [False for i in range(int((nY)*(nX)))]\n \n if code2probe == []:\n return \n \n mvtype = -1 # G0 (Rapid), G1 (linear), G2 (clockwise arc) or G3 (counterclockwise arc).\n passthru = \"\"\n POS = [0,0,0]\n feed = 0\n out = []\n\n min_length = min(xPartitionLength,yPartitionLength) / probe_istep\n if (min_length < Zero):\n min_length = max(xPartitionLength,yPartitionLength) / probe_istep\n if (min_length < Zero):\n min_length = 1\n\n for line in code2probe:\n if line[0] == 0 or line[0] == 1:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = ['','','']\n if line[0] == 1:\n feed = line[3]\n\n elif line[0] == 3 or line[0] == 2:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = line[3][:]\n feed = line[4]\n else:\n mvtype = -1\n passthru = line\n\n ###############################################################################\n if mvtype >= 0 and mvtype <=3:\n pos = POS[:]\n pos_last = POS_LAST[:]\n center = CENTER[:]\n \n #############################\n if mvtype == 0:\n out.append( [mvtype,pos_last,pos] )\n \n if mvtype == 1:\n dx = pos[0]-pos_last[0]\n dy = pos[1]-pos_last[1]\n dz = pos[2]-pos_last[2]\n length = sqrt(dx*dx + dy*dy)\n if (length <= min_length):\n out.append( [mvtype,pos_last,pos,feed] )\n else:\n Lsteps = max(2,int(ceil(length / min_length)))\n xstp0 = float(pos_last[0])\n ystp0 = float(pos_last[1])\n zstp0 = float(pos_last[2])\n for n in range(1,Lsteps+1):\n xstp1 = n/float(Lsteps)*dx + pos_last[0] \n ystp1 = n/float(Lsteps)*dy + pos_last[1]\n zstp1 = n/float(Lsteps)*dz + pos_last[2]\n out.append( [mvtype,[xstp0,ystp0,zstp0],[xstp1,ystp1,zstp1],feed] )\n xstp0 = float(xstp1)\n ystp0 = float(ystp1)\n zstp0 = float(zstp1)\n \n if mvtype == 2 or mvtype == 3:\n out.append( [ mvtype,pos_last,pos,center, feed] ) \n ###############################################################################\n else:\n if passthru != '':\n out.append(passthru)\n\n ################################\n ## Loop through output to ##\n ## find needed probe points ##\n ################################\n for i in range(len(out)):\n line = out[i]\n if line[0] == 0 or line[0] == 1:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = ['','','']\n if line[0] == 1:\n feed = line[3]\n\n elif line[0] == 3 or line[0] == 2:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = line[3][:]\n feed = line[4]\n else:\n mvtype = -1\n passthru = line\n\n if mvtype >= 1 and mvtype <=3:\n pos = POS[:]\n pos_last = POS_LAST[:]\n center = CENTER[:]\n\n\n #### ADD ADDITIONAL DATA TO POS_LAST DATA ####\n i_x,i_y = self.get_ix_iy((pos_last[0]-minx),(pos_last[1]-miny),xPartitionLength,yPartitionLength)\n #i_x = i_x+Xoffset\n #i_y = i_y+Yoffset\n if i_x < 0:\n i_x=0\n if i_y < 0:\n i_y=0\n if (i_x+1 >= nX):\n i_x = nX-2\n #i_x = i_x-1 #commented 02/22\n #print \"adjust i_x POS_LAST\"\n i_x2 = i_x+1\n if (i_y+1 >= nY):\n i_y = nY-2\n #i_y = i_y-1 #commented 02/22\n #print \"adjust i_y POS_LAST\"\n i_y2 = i_y+1\n \n p_index_A = int(i_y* nX + i_x )\n p_index_B = int(i_y2*nX + i_x )\n p_index_C = int(i_y *nX + i_x2)\n p_index_D = int(i_y2*nX + i_x2) \n \n Xfraction=((pos_last[0]-minx)-(i_x*xPartitionLength))/xPartitionLength\n Yfraction=((pos_last[1]-miny)-(i_y*yPartitionLength))/yPartitionLength\n\n if Xfraction>1.0:\n #print \"ERROR POS_LAST: Xfraction = \", Xfraction\n Xfraction = 1.0\n if Xfraction <0.0:\n #print \"ERROR POS_LAST: Xfraction = \", Xfraction\n Xfraction = 0.0\n if Yfraction > 1.0:\n #print \"ERROR POS_LAST: Yfraction = \", Yfraction\n Yfraction = 1.0\n if Yfraction<0.0:\n #print \"ERROR POS_LAST: Yfraction = \", Yfraction\n Yfraction = 0.0\n\n BPN=500\n out[i][1].append(p_index_A+BPN)\n out[i][1].append(p_index_B+BPN)\n out[i][1].append(p_index_C+BPN)\n out[i][1].append(p_index_D+BPN)\n out[i][1].append(Xfraction)\n out[i][1].append(Yfraction)\n\n try:\n POINT_LIST[p_index_A ] = True\n POINT_LIST[p_index_B ] = True\n POINT_LIST[p_index_C ] = True\n POINT_LIST[p_index_D ] = True\n except:\n pass \n #### ADD ADDITIONAL DATA TO POS_LAST DATA ####\n i_x,i_y = self.get_ix_iy((pos[0]-minx),(pos[1]-miny),xPartitionLength,yPartitionLength)\n #i_x = i_x+Xoffset\n #i_y = i_y+Yoffset\n if i_x < 0:\n i_x=0\n if i_y < 0:\n i_y=0\n if (i_x+1 >= nX):\n i_x = nX-2\n #i_x = i_x-1 #commented 02/22\n #print \"adjust i_x POS\"\n i_x2 = i_x+1\n if (i_y+1 >= nY):\n i_y = nY-2\n #i_y = i_y-1#commented 02/22\n #print \"adjust i_y POS\"\n i_y2 = i_y+1\n \n p_index_A = int(i_y* nX + i_x )\n p_index_B = int(i_y2*nX + i_x )\n p_index_C = int(i_y *nX + i_x2)\n p_index_D = int(i_y2*nX + i_x2)\n Xfraction=((pos[0]-minx)-(i_x*xPartitionLength))/xPartitionLength\n Yfraction=((pos[1]-miny)-(i_y*yPartitionLength))/yPartitionLength\n \n if Xfraction>1.0:\n Xfraction = 1.0\n #print \"ERROR POS: Xfraction = \", Xfraction\n if Xfraction <0.0:\n Xfraction = 0.0\n #print \"ERROR POS: Xfraction = \", Xfraction\n if Yfraction > 1.0:\n Yfraction = 1.0\n #print \"ERROR POS: Yfraction = \", Yfraction\n if Yfraction<0.0:\n Yfraction = 0.0\n #print \"ERROR POS: Yfraction = \", Yfraction\n \n out[i][2].append(p_index_A+BPN)\n out[i][2].append(p_index_B+BPN)\n out[i][2].append(p_index_C+BPN)\n out[i][2].append(p_index_D+BPN)\n out[i][2].append(Xfraction)\n out[i][2].append(Yfraction)\n try:\n POINT_LIST[p_index_A ] = True\n POINT_LIST[p_index_B ] = True\n POINT_LIST[p_index_C ] = True\n POINT_LIST[p_index_D ] = True\n except:\n pass\n self.probe_gcode = out\n #for line in out:\n # print line\n \n ################################\n ## Generate Probing Code ##\n ## For needed points ##\n ################################\n\n for i in range(len(POINT_LIST)):\n i_x = i % nX\n i_y = int(i / nX)\n xp = i_x * xPartitionLength + minx\n yp = i_y * yPartitionLength + miny\n probe_coords.append([POINT_LIST[i],i+BPN,xp,yp])\n\n self.probe_coords = probe_coords\n return\n\n def get_ix_iy(self,x,y,xPartitionLength,yPartitionLength):\n i_x=int(x/xPartitionLength)\n i_y=int(y/yPartitionLength)\n return i_x,i_y\n\n ####################################### \n def scale_rotate_code(self,code2scale,scale=[1.0,1.0,1.0,1.0],angle=0.0):\n if code2scale == []:\n return code2scale,0,0,0,0,0,0\n minx = 99999\n maxx = -99999\n miny = 99999\n maxy = -99999\n minz = 99999\n maxz = -99999\n mvtype = -1 # G0 (Rapid), G1 (linear), G2 (clockwise arc) or G3 (counterclockwise arc).\n\n passthru = \"\"\n POS =[0,0,0]\n feed = 0\n out = []\n\n L = 0\n R = 1\n flag_side = 1 \n\n for line in code2scale:\n if line[0] == 0 or line[0] == 1:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = ['','','']\n if line[0] == 1:\n feed = line[3] * scale[3]\n\n elif line[0] == 3 or line[0] == 2:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = line[3][:]\n feed = line[4] * scale[3]\n else:\n mvtype = -1\n passthru = line\n\n ###############################################################################\n if mvtype >= 0 and mvtype <=3:\n\n pos = self.scale_rot_coords(POS,scale,angle)\n pos_last = self.scale_rot_coords(POS_LAST,scale,angle)\n\n\n if CENTER[0]!='' and CENTER[1]!='':\n center = self.scale_rot_coords(CENTER,scale,angle)\n else:\n center = CENTER\n \n #############################\n if mvtype != 0:\n try:\n minx = min( minx, min(pos[0],pos_last[0]) ) \n maxx = max( maxx, max(pos[0],pos_last[0]) )\n except:\n pass\n try:\n miny = min( miny, min(pos[1],pos_last[1]) ) \n maxy = max( maxy, max(pos[1],pos_last[1]) )\n except:\n pass\n try:\n minz = min( minz, min(pos[2],pos_last[2]) ) \n maxz = max( maxz, max(pos[2],pos_last[2]) )\n except:\n pass\n\n if mvtype == 0:\n out.append( [mvtype,pos_last,pos] )\n \n if mvtype == 1:\n out.append( [mvtype,pos_last,pos,feed] )\n\n if mvtype == 2 or mvtype == 3:\n out.append( [ mvtype,pos_last,pos,center, feed] )\n \n if mvtype == 3:\n ang1 = self.Get_Angle2(pos_last[0]-center[0],pos_last[1]-center[1])\n xtmp,ytmp = self.Transform(pos[0]-center[0],pos[1]-center[1],radians(-ang1))\n ang2 = self.Get_Angle2(xtmp,ytmp)\n\n else:\n ang1 = self.Get_Angle2(pos[0]-center[0],pos[1]-center[1])\n xtmp,ytmp = self.Transform(pos_last[0]-center[0],pos_last[1]-center[1],radians(-ang1))\n ang2 = self.Get_Angle2(xtmp,ytmp)\n \n if ang2 == 0:\n ang2=359.999\n \n Radius = sqrt( (pos[0]-center[0])**2 +(pos[1]-center[1])**2 )\n \n if ang1 > 270:\n da = 270\n elif ang1 > 180:\n da = 180\n elif ang1 > 90:\n da = 90\n else:\n da = 0\n for side in [90,180,270,360]:\n spd = side + da\n if ang2 > (spd-ang1):\n if spd > 360:\n spd=spd-360\n if spd==90:\n maxy = max( maxy, center[1]+Radius )\n if spd==180:\n minx = min( minx, center[0]-Radius)\n if spd==270:\n miny = min( miny, center[1]-Radius )\n if spd==360:\n maxx = max( maxx, center[0]+Radius ) \n ###############################################################################\n else:\n if passthru != '':\n out.append(passthru)\n \n return out,minx,maxx,miny,maxy,minz,maxz\n\n\n #######################################\n def scale_translate(self,code2translate,translate=[0.0,0.0,0.0]):\n \n if translate[0]==0 and translate[1]==0 and translate[2]==0:\n return code2translate\n \n mvtype = -1 # G0 (Rapid), G1 (linear), G2 (clockwise arc) or G3 (counterclockwise arc).\n passthru = \"\"\n POS =[0,0,0]\n pos =[0,0,0]\n pos_last=[0,0,0]\n feed = 0\n out = []\n\n L = 0\n R = 1\n flag_side = 1 \n\n for line in code2translate:\n if line[0] == 1 or line[0] == 0:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = ['','','']\n if line[0] == 1:\n feed = line[3]\n\n elif line[0] == 3 or line[0] == 2:\n mvtype = line[0]\n POS_LAST = line[1][:]\n POS = line[2][:]\n CENTER = line[3][:]\n feed = line[4]\n else:\n mvtype = -1\n passthru = line\n\n ###############################################################################\n if mvtype >= 0 and mvtype <=3:\n pos = self.scale_trans_coords(POS,translate)\n pos_last = self.scale_trans_coords(POS_LAST,translate)\n if CENTER[0]!='' and CENTER[1]!='':\n center = self.scale_trans_coords(CENTER,translate)\n else:\n center = CENTER[:]\n \n #############################\n if mvtype == 0:\n out.append( [mvtype,pos_last,pos] )\n \n if mvtype == 1:\n out.append( [mvtype,pos_last,pos,feed] )\n\n if mvtype == 2 or mvtype == 3:\n out.append( [ mvtype,pos_last,pos,center, feed] )\n ###############################################################################\n else:\n if passthru != '':\n out.append(passthru)\n return out\n\n def scale_trans_coords(self,coords,trans):\n x = coords[0] - trans[0]\n y = coords[1] - trans[1]\n z = coords[2] - trans[2]\n return [x,y,z]\n\n def scale_rot_coords(self,coords,scale,rot):\n x = coords[0] * scale[0]\n y = coords[1] * scale[1]\n z = coords[2] * scale[2]\n\n x,y = self.Transform(x,y, radians(rot) )\n return [x,y,z]\n \n def generate_probing_gcode(self,\n probe_coords,\n probe_safe,\n probe_feed,\n probe_depth,\n pre_codes=\" \",\n pause_codes=\" \",\n probe_offsetX=0.0,\n probe_offsetY=0.0,\n probe_offsetZ=0.0,\n probe_soft=\"LinuxCNC\",\n close_file = False,\n postamble=\" \",\n savepts=1,\n allpoints=1):\n\n savepts = savepts or close_file\n ################################\n ## Generate Probing Code ##\n ## For needed points ##\n ################################\n g_code = []\n g_code.append(\"%\")\n g_code.append(\"( G-Code Modified by G-Code Ripper )\")\n g_code.append(\"( by Scorch - 2013-2021 www.scorchworks.com )\")\n if self.units == \"in\":\n g_code.append(\"G20 (set units to inches)\")\n else:\n g_code.append(\"G21 (set units to mm)\")\n\n Gprobe = \"G38.2\"\n ZProbeValue = \"#5422\"\n datafileopen =\"(Insert code to open data file for writing here.)\"\n datafileclose =\"(Insert code to close data file for writing here.)\"\n datafileclose\n if (probe_soft==\"LinuxCNC\"):\n Gprobe = \"G38.2\"\n ZProbeValue = \"#5422\"\n if savepts:\n datafileopen = \"(PROBEOPEN probe_points.txt)\"\n datafileclose= \"(PROBECLOSE)\"\n msg = \"The Probe point data from LinuxCNC will\\n\"\n msg = msg + \"be witten to a file named 'probe_points.txt'.\\n\"\n msg = msg + \"The file will be located in the linuxcnc\\n\"\n msg = msg + \"configuration folder.\"\n message_box(\"Probe Data File\",msg)\n \n elif (probe_soft==\"MACH3\"):\n if savepts:\n datafileopen = \"M40\"\n datafileclose= \"M41\"\n Gprobe = \"G31\"\n ZProbeValue = \"#2002\"\n \n elif (probe_soft==\"MACH4\"):\n if savepts:\n datafileopen = \"M40\"\n datafileclose= \"M41\"\n Gprobe = \"G31\"\n ZProbeValue = \"#5063\" # The Z value variable changed from #2002 to #5063 in Mach4\n\n elif (probe_soft==\"DDCS\"):\n if savepts:\n datafileopen = \"ClearCoords[0]\"\n datafileclose= \"\"\n msg = \"The Probe point data from DDCS will\\n\"\n msg = msg + \"be witten to a file named 'ProbeMap0.txt'.\"\n message_box(\"Probe Data File\",msg)\n Gprobe=\"M101\\nG01\"\n ZProbeValue = \"#701\"\n \n elif (probe_soft==\"GRBL\"):\n #need to figure out if GRBL can do this\n #Sadly GRBL cannot work this way\n pass\n \n g_code.append(\"G90\")\n\n for line in pre_codes.split('|'):\n g_code.append(line)\n \n g_code.append(datafileopen)\t\t\n max_probe_safe = max(probe_safe,probe_safe+probe_offsetZ)\n\n g_code.append(\"G0 Z%.3f\" %(max_probe_safe))\n xp = 0.0\n yp = 0.0\n if (probe_soft==\"LinuxCNC\"):\n g_code.append(\"#499 = %.3f\" %(probe_depth))\n else:\n g_code.append(\"#499 = %.3f\" %(probe_safe))\n #g_code.append(\"(PRINT,value of variable 499 INIT is: #499)\")\n for i in range(len(probe_coords)):\n if (probe_coords[i][0] or allpoints): #or close_file):\n xp = probe_coords[i][2]\n yp = probe_coords[i][3]\n \n g_code.append(\"G0 X%.3fY%.3f\" %(xp+probe_offsetX,yp+probe_offsetY))\n g_code.append(\"%s Z%.3f F%.1f\" %(Gprobe, probe_depth+probe_offsetZ,probe_feed))\n\n if (probe_soft==\"DDCS\"):\n g_code.append(\"M102\")\n g_code.append(\"G04P0\")\n g_code.append(\"RecordCoords[0,#699,#700,#701,#702]\")\n \n if (close_file == False):\n if (probe_offsetZ==0.0):\n g_code.append(\"#%d = %s\" %(probe_coords[i][1],ZProbeValue))\n else:\n g_code.append(\"#%d = [%s-%.4f]\" %(probe_coords[i][1],ZProbeValue,probe_offsetZ))\n if (probe_soft==\"LinuxCNC\"):\n g_code.append(\"#499= [ [[#%d GE #499]*#%d] + [[#%d LT #499]*#499] ]\" %(probe_coords[i][1],probe_coords[i][1],probe_coords[i][1]))\n #g_code.append(\"(PRINT,value of variable 499 is: #499)\")\n g_code.append(\"G0 Z%.3f\" %(probe_safe+probe_offsetZ) )\n\n g_code.append(\"G0 Z%.3f\" %(max_probe_safe))\n g_code.append(\"G0 X%.3fY%.3f\" %(xp,yp))\n\n g_code.append(datafileclose)\n for line in pause_codes.split('|'):\n g_code.append(line)\n\n\n if (close_file == False):\n g_code.append(\"M0 (PAUSE PROGRAM)\")\n else:\n for entry in postamble.split('|'):\n g_code.append(entry)\n g_code.append(\"M2\")\n#DEBUG\n g_code.append(\"%\") \n return g_code\n \n###\n###\n def generategcode_probe(self,side,z_safe=.5,\n plunge_feed=10.0,\n no_variables=False,\n Rstock=0.0,\n Wrap=\"XYZ\",\n preamble=\"\",\n postamble=\"\",\n PLACES_L=4,\n PLACES_R=3,\n PLACES_F=1,\n WriteAll=False,\n FSCALE=\"Scale-Rotary\",\n Reverse_Rotary = False,\n NoComments=False,\n probe_data=[],\n probe_offsetZ=0,\n probe_safe=.5):\n\n g_code = []\n\n sign = 1\n if Reverse_Rotary:\n sign = -1\n\n self.MODAL_VAL={'X':\" \", 'Y':\" \", 'Z':\" \", 'F':\" \", 'A':\" \", 'B':\" \", 'I':\" \", 'J':\" \"}\n LASTX = 0\n LASTY = 0\n LASTZ = z_safe\n\n g_code.append(\"( G-Code Modified by G-Code Ripper )\")\n g_code.append(\"( by Scorch - 2013-2021 www.scorchworks.com )\")\n AXIS=[\"X\" , \"Y\" , \"Z\" ]\n DECP=[PLACES_L, PLACES_L, PLACES_L] \n \n g_code.append(\"G90 (set absolute distance mode)\")\n g_code.append(\"G90.1 (set absolute distance mode for arc centers)\")\n g_code.append(\"G17 (set active plane to XY)\")\n \n if self.units == \"in\":\n g_code.append(\"G20 (set units to inches)\")\n else:\n g_code.append(\"G21 (set units to mm)\")\n \n if no_variables==False:\n g_code.append(\"# = % 5.3f \" %(z_safe))\n g_code.append(\"# = % 5.0f \" %(plunge_feed))\n \n for line in preamble.split('|'):\n g_code.append(line)\n\n g_code.append(\"(---------------------------------------------------------)\")\n ###################\n ## GCODE WRITING ##\n ###################\n Z_probe_max = probe_offsetZ\n if probe_data!=[]:\n try:\n Z_probe_max = probe_data[1][2] #set initial max value\n except:\n Z_probe_max = 0\n for point_data in probe_data:\n if point_data[2] > Z_probe_max:\n Z_probe_max=point_data[2]\n\n First_Z_Safe = 0+0j\n for line in side:\n if line[0] == 0:\n if (not isinstance(line[1][2], complex)):\n First_Z_Safe = line[1][2]\n break\n \n for line in side:\n if line[0] == 1 or line[0] == 2 or line[0] == 3 or (line[0] == 0):\n D0 = line[2][0]-line[1][0] \n D1 = line[2][1]-line[1][1] \n D2 = line[2][2]-line[1][2]\n D012 = sqrt((D0+0j).real**2+(D1+0j).real**2+(D2+0j).real**2)\n \n coordA=[ line[1][0], line[1][1], line[1][2] ]\n coordB=[ line[2][0], line[2][1], line[2][2] ]\n \n dx = coordA[0]-LASTX\n dy = coordA[1]-LASTY\n dz = coordA[2]-LASTZ\n\n LASTX = coordB[0]\n LASTY = coordB[1]\n LASTZ = coordB[2]\n \n if (line[0] == 1) or (line[0] == 2) or (line[0] == 3):\n Feed_adj = line[3]\n \n LINE = \"G%d\" %(line[0])\n if probe_data!=[]:\n # Write probe adjusted values\n Z1 = probe_data[line[2][3]-500][2] \n Z2 = probe_data[line[2][4]-500][2] \n Z3 = probe_data[line[2][5]-500][2] \n Z4 = probe_data[line[2][6]-500][2] \n F1 = line[2][7]\n F2 = line[2][8]\n\n v102 = Z1 + F2*Z2 - F2*Z1\n v101 = Z3 + F2*Z4 - F2*Z3\n v100 = v102 + F1*v101 - F1*v102\n Z_calculated = coordB[2] + v100 - probe_offsetZ\n \n LINE = self.app_gcode_line(LINE,AXIS[0],coordB[0],DECP[0],WriteAll)\n LINE = self.app_gcode_line(LINE,AXIS[1],coordB[1],DECP[1],WriteAll)\n LINE = self.app_gcode_line(LINE,AXIS[2],Z_calculated,DECP[2],WriteAll) \n LINE = self.app_gcode_line(LINE,\"F\",Feed_adj ,PLACES_F,WriteAll)\n else:\n g_code.append(\"#102 = [#%d + %.3f*#%d - %.3f*#%d]\" %(line[2][3],line[2][8],line[2][4],line[2][8],line[2][3]))\n g_code.append(\"#101 = [#%d + %.3f*#%d - %.3f*#%d]\" %(line[2][5],line[2][8],line[2][6],line[2][8],line[2][5]))\n g_code.append(\"#100 = [#102+ %.3f*#101- %.3f*#102]\"%(line[2][7],line[2][7]))\n\n LINE = self.app_gcode_line(LINE,AXIS[0],coordB[0],DECP[0],WriteAll)\n LINE = self.app_gcode_line(LINE,AXIS[1],coordB[1],DECP[1],WriteAll)\n # Do not delete the following line that sets junk value\n junk = self.app_gcode_line(LINE,AXIS[2],coordB[2],DECP[2],WriteAll)\n LINE = LINE + \" Z[%.3f+#100] \" %(coordB[2])\n LINE = self.app_gcode_line(LINE,\"F\",Feed_adj ,PLACES_F,WriteAll)\n\n g_code.append(LINE)\n \n elif (line[0] == 0):\n LINE = \"G%d\" %(line[0])\n LINE = self.app_gcode_line(LINE,AXIS[0],coordB[0],DECP[0],WriteAll)\n LINE = self.app_gcode_line(LINE,AXIS[1],coordB[1],DECP[1],WriteAll)\n if probe_data!=[]:\n LINE = self.app_gcode_line(LINE,AXIS[2],coordB[2]+Z_probe_max-probe_offsetZ,DECP[2],WriteAll)\n else:\n if (not isinstance(coordB[2], complex)):\n LINE = LINE + \" %s[%.3f+#499]\" %(AXIS[2],coordB[2])\n else:\n LINE = LINE + \" %s[%.3f+#499]\" %(AXIS[2],First_Z_Safe)\n \n g_code.append(LINE)\n\n elif line[0] == \";\":\n if not NoComments:\n g_code.append(\"%s\" %(line[1]))\n \n elif line[0] == \"M2\":\n for entry in postamble.split('|'):\n g_code.append(entry)\n else:\n g_code.append(line)\n\n ########################\n ## END G-CODE WRITING ##\n ########################\n return g_code\n\n###\n###\n def generategcode(self,side,z_safe=.5,\n plunge_feed=10.0,\n no_variables=False,\n Rstock=0.0,\n Wrap=\"XYZ\",\n preamble=\"\",\n postamble=\"\",\n gen_rapids=False,\n PLACES_L=4,\n PLACES_R=3,\n PLACES_F=1,\n WriteAll=False,\n FSCALE=\"Scale-Rotary\",\n Reverse_Rotary = False,\n NoComments=False):\n\n g_code = []\n\n sign = 1\n if Reverse_Rotary:\n sign = -1\n\n self.MODAL_VAL={'X':\" \", 'Y':\" \", 'Z':\" \", 'F':\" \", 'A':\" \", 'B':\" \", 'I':\" \", 'J':\" \"}\n LASTX = 0\n LASTY = 0\n LASTZ = z_safe\n\n g_code.append(\"( G-Code Modified by G-Code Ripper )\")\n g_code.append(\"( by Scorch - 2013-2021 www.scorchworks.com )\")\n if Wrap == \"XYZ\":\n AXIS=[\"X\" , \"Y\" , \"Z\" ]\n DECP=[PLACES_L, PLACES_L, PLACES_L] \n elif Wrap == \"Y2A\":\n AXIS=[\"X\" , \"A\" , \"Z\" ]\n DECP=[PLACES_L, PLACES_R, PLACES_L]\n WriteAll=False\n g_code.append(\"(G-Code Ripper has mapped the Y-Axis to the A-Axis )\")\n elif Wrap == \"X2B\":\n AXIS=[\"B\" , \"Y\" , \"Z\" ]\n DECP=[PLACES_R, PLACES_L, PLACES_L]\n WriteAll=False\n g_code.append(\"(G-Code Ripper has mapped the X-Axis to the B-Axis )\")\n elif Wrap == \"Y2B\":\n AXIS=[\"X\" , \"B\" , \"Z\" ]\n DECP=[PLACES_L, PLACES_R, PLACES_L]\n WriteAll=False\n g_code.append(\"(G-Code Ripper has mapped the Y-Axis to the B-Axis )\")\n elif Wrap == \"X2A\":\n AXIS=[\"A\" , \"Y\" , \"Z\" ]\n DECP=[PLACES_R, PLACES_L, PLACES_L]\n WriteAll=False\n g_code.append(\"(G-Code Ripper has mapped the X-Axis to the A-Axis )\")\n \n if Wrap != \"XYZ\":\n g_code.append(\"(A nominal stock radius of %f was used. )\" %(Rstock))\n g_code.append(\"(Z-axis zero position is the surface of the round stock. )\")\n g_code.append(\"(---------------------------------------------------------)\")\n \n g_code.append(\"G90 (set absolute distance mode)\")\n g_code.append(\"G90.1 (set absolute distance mode for arc centers)\")\n g_code.append(\"G17 (set active plane to XY)\")\n \n if self.units == \"in\":\n g_code.append(\"G20 (set units to inches)\")\n else:\n g_code.append(\"G21 (set units to mm)\")\n \n if no_variables==False:\n g_code.append(\"# = % 5.3f \" %(z_safe))\n g_code.append(\"# = % 5.0f \" %(plunge_feed))\n \n for line in preamble.split('|'):\n g_code.append(line)\n\n g_code.append(\"(---------------------------------------------------------)\")\n ###################\n ## GCODE WRITING ##\n ###################\n for line in side:\n if line[0] == 1 or line[0] == 2 or line[0] == 3 or (line[0] == 0 and gen_rapids == False):\n D0 = line[2][0]-line[1][0] \n D1 = line[2][1]-line[1][1] \n D2 = line[2][2]-line[1][2]\n D012 = sqrt((D0+0j).real**2+(D1+0j).real**2+(D2+0j).real**2)\n \n coordA=[ line[1][0], line[1][1], line[1][2] ]\n coordB=[ line[2][0], line[2][1], line[2][2] ]\n if Wrap == \"Y2A\" or Wrap == \"Y2B\":\n #if line[1][1].imag == 0:\n if (not isinstance(line[1][1], complex)):\n coordA[1]=sign*degrees(line[1][1]/Rstock)\n #if line[2][1].imag == 0:\n if (not isinstance(line[2][1], complex)):\n coordB[1]=sign*degrees(line[2][1]/Rstock)\n elif Wrap == \"X2B\" or Wrap == \"X2A\":\n #if line[1][0].imag == 0:\n if (not isinstance(line[1][0], complex)):\n coordA[0]=sign*degrees(line[1][0]/Rstock)\n #if line[2][0].imag == 0:\n if (not isinstance(line[2][0], complex)):\n coordB[0]=sign*degrees(line[2][0]/Rstock)\n\n dx = coordA[0]-LASTX\n dy = coordA[1]-LASTY\n dz = coordA[2]-LASTZ\n\n # Check if next point is coincident with the\n # current point within the set accuracy\n if sqrt((dx+0j).real**2 + (dy+0j).real**2 + (dz+0j).real**2) > self.accuracy and gen_rapids == True:\n ### Move tool to safe height (z_safe) ###\n if no_variables==False:\n g_code.append(\"G0 %c # \" %(AXIS[2]) )\n self.MODAL_VAL[AXIS[2]] = z_safe\n else:\n LINE = \"G0\"\n LINE = self.app_gcode_line(LINE,AXIS[2],z_safe,DECP[2],WriteAll)\n if len(LINE) > 2: g_code.append(LINE)\n \n ### Move tool to coordinates of next cut ###\n LINE = \"G0\"\n LINE = self.app_gcode_line(LINE,AXIS[0],coordA[0],DECP[0],WriteAll)\n LINE = self.app_gcode_line(LINE,AXIS[1],coordA[1],DECP[1],WriteAll)\n if len(LINE) > 2: g_code.append(LINE)\n\n if float(coordA[2]) < float(z_safe):\n if no_variables==False:\n LINE = \"G1\"\n LINE = self.app_gcode_line(LINE,AXIS[2],coordA[2],DECP[2],WriteAll)\n LINE = LINE + \" F #\"\n self.MODAL_VAL[\"F\"] = plunge_feed\n if len(LINE) > 2: g_code.append(LINE) \n else:\n LINE = \"G1\"\n LINE = self.app_gcode_line(LINE,AXIS[2],coordA[2] ,DECP[2] , WriteAll)\n LINE = self.app_gcode_line(LINE,\"F\" ,plunge_feed,PLACES_F, WriteAll)\n if len(LINE) > 2: g_code.append(LINE)\n\n LASTX = coordB[0]\n LASTY = coordB[1]\n LASTZ = coordB[2]\n\n if (line[0] == 1) or (line[0] == 2) or (line[0] == 3) or (line[0] == 0 and (gen_rapids == False)):\n try: LAST0 = float(self.MODAL_VAL[AXIS[0]])\n except: LAST0 = coordB[0]\n try: LAST1 = float(self.MODAL_VAL[AXIS[1]])\n except: LAST1 = coordB[1]\n try: LAST2 = float(self.MODAL_VAL[AXIS[2]])\n except: LAST2 = coordB[2]\n \n LINE = \"G%d\" %(line[0])\n LINE = self.app_gcode_line(LINE,AXIS[0],coordB[0],DECP[0],WriteAll)\n LINE = self.app_gcode_line(LINE,AXIS[1],coordB[1],DECP[1],WriteAll)\n LINE = self.app_gcode_line(LINE,AXIS[2],coordB[2],DECP[2],WriteAll)\n if (line[0] == 1):\n if ((LINE.find(\"A\") > -1) or (LINE.find(\"B\") > -1)) and (FSCALE == \"Scale-Rotary\") and (D012>self.Zero):\n if (LINE.find(\"X\") > -1) or (LINE.find(\"Y\") > -1) or (LINE.find(\"Z\") > -1):\n if Wrap == \"Y2A\" or Wrap == \"Y2B\":\n Df = hypot( coordB[0]-LAST0, coordB[2]-LAST2 )\n elif Wrap == \"X2B\" or Wrap == \"X2A\":\n Df = hypot( coordB[1]-LAST1, coordB[2]-LAST2 )\n Feed_adj = abs(Df / (D012/line[3]))\n else:\n if Wrap == \"Y2A\" or Wrap == \"Y2B\":\n DAf = coordB[1]-LAST1\n Feed_adj = abs(DAf / (D012/line[3]))\n elif Wrap == \"X2B\" or Wrap == \"X2A\":\n DAf = coordB[0]-LAST0\n Feed_adj = abs(DAf / (D012/line[3]))\n else:\n Feed_adj = line[3]\n LINE = self.app_gcode_line(LINE,\"F\",Feed_adj ,PLACES_F,WriteAll)\n \n elif (line[0] == 2) or (line[0] == 3):\n Feed_adj = line[4]\n LINE = self.app_gcode_line(LINE,\"I\",line[3][0],DECP[0] ,WriteAll)\n LINE = self.app_gcode_line(LINE,\"J\",line[3][1],DECP[1] ,WriteAll)\n LINE = self.app_gcode_line(LINE,\"F\",Feed_adj ,PLACES_F,WriteAll)\n if len(LINE) > 2: g_code.append(LINE)\n\n elif (line[0] == 0 and gen_rapids == True):\n pass\n\n elif line[0] == \";\":\n if not NoComments:\n g_code.append(\"%s\" %(line[1]))\n \n elif line[0] == \"M2\":\n if gen_rapids == True:\n if no_variables==False:\n g_code.append(\"G0 %c # \" %(AXIS[2]) )\n self.MODAL_VAL[AXIS[2]] = z_safe\n else:\n LINE = \"G0\"\n LINE = self.app_gcode_line(LINE,AXIS[2],z_safe,DECP[2],WriteAll)\n g_code.append(LINE)\n \n for entry in postamble.split('|'):\n g_code.append(entry)\n #g_code.append(line[0])\n else:\n g_code.append(line)\n ########################\n ## END G-CODE WRITING ##\n ########################\n return g_code\n\n \n ##################################################\n ### Begin Dxf_Write G-Code Writing Function ###\n ##################################################\n def generate_dxf_write_gcode(self,side,Rapids=True):\n g_code = []\n # Create a header section just in case the reading software needs it\n g_code.append(\"999\")\n g_code.append(\"DXF created by G-Code Ripper \")\n \n g_code.append(\"0\")\n g_code.append(\"SECTION\")\n g_code.append(\"2\")\n g_code.append(\"HEADER\")\n g_code.append(\"0\")\n g_code.append(\"ENDSEC\")\n # \n #Tables Section\n #These can be used to specify predefined constants, line styles, text styles, view \n #tables, user coordinate systems, etc. We will only use tables to define some layers \n #for use later on. Note: not all programs that support DXF import will support \n #layers and those that do usually insist on the layers being defined before use\n #\n # The following will initialise layers 1 and 2 for use with moves and rapid moves.\n g_code.append(\"0\")\n g_code.append(\"SECTION\")\n g_code.append(\"2\")\n g_code.append(\"TABLES\")\n g_code.append(\"0\")\n g_code.append(\"TABLE\")\n g_code.append(\"2\")\n g_code.append(\"LTYPE\")\n g_code.append(\"70\")\n g_code.append(\"1\")\n g_code.append(\"0\")\n g_code.append(\"LTYPE\")\n g_code.append(\"2\")\n g_code.append(\"CONTINUOUS\")\n g_code.append(\"70\")\n g_code.append(\"64\")\n g_code.append(\"3\")\n g_code.append(\"Solid line\")\n g_code.append(\"72\")\n g_code.append(\"65\")\n g_code.append(\"73\")\n g_code.append(\"0\")\n g_code.append(\"40\")\n g_code.append(\"0.000000\")\n g_code.append(\"0\")\n g_code.append(\"ENDTAB\")\n g_code.append(\"0\")\n g_code.append(\"TABLE\")\n g_code.append(\"2\")\n g_code.append(\"LAYER\")\n g_code.append(\"70\")\n g_code.append(\"6\")\n g_code.append(\"0\")\n g_code.append(\"LAYER\")\n g_code.append(\"2\")\n g_code.append(\"1\")\n g_code.append(\"70\")\n g_code.append(\"64\")\n g_code.append(\"62\")\n g_code.append(\"7\")\n g_code.append(\"6\")\n g_code.append(\"CONTINUOUS\")\n g_code.append(\"0\")\n g_code.append(\"LAYER\")\n g_code.append(\"2\")\n g_code.append(\"2\")\n g_code.append(\"70\")\n g_code.append(\"64\")\n g_code.append(\"62\")\n g_code.append(\"7\")\n g_code.append(\"6\")\n g_code.append(\"CONTINUOUS\")\n g_code.append(\"0\")\n g_code.append(\"ENDTAB\")\n g_code.append(\"0\")\n g_code.append(\"TABLE\")\n g_code.append(\"2\")\n g_code.append(\"STYLE\")\n g_code.append(\"70\")\n g_code.append(\"0\")\n g_code.append(\"0\")\n g_code.append(\"ENDTAB\")\n g_code.append(\"0\")\n g_code.append(\"ENDSEC\")\n \n #This block section is not necessary but apparently it's good form to include one anyway.\n #The following is an empty block section.\n g_code.append(\"0\")\n g_code.append(\"SECTION\")\n g_code.append(\"2\")\n g_code.append(\"BLOCKS\")\n g_code.append(\"0\")\n g_code.append(\"ENDSEC\")\n\n # Start entities section\n g_code.append(\"0\")\n g_code.append(\"SECTION\")\n g_code.append(\"2\")\n g_code.append(\"ENTITIES\")\n g_code.append(\" 0\")\n\n #################################\n ## GCODE WRITING for Dxf_Write ##\n #################################\n for line in side:\n if line[0] == 1 or (line[0] == 0 and Rapids):\n g_code.append(\"LINE\")\n g_code.append(\" 5\")\n g_code.append(\"30\")\n g_code.append(\"100\")\n g_code.append(\"AcDbEntity\")\n g_code.append(\" 8\") #layer Code #g_code.append(\"0\")\n if line[0] == 1:\n g_code.append(\"1\")\n else:\n g_code.append(\"2\") \n g_code.append(\" 62\") #color code\n if line[0] == 1:\n g_code.append(\"10\")\n else:\n g_code.append(\"150\")\n g_code.append(\"100\")\n g_code.append(\"AcDbLine\")\n g_code.append(\" 10\")\n g_code.append(\"%.4f\" %((line[1][0]+0j).real)) #x1 coord\n g_code.append(\" 20\")\n g_code.append(\"%.4f\" %((line[1][1]+0j).real)) #y1 coord\n g_code.append(\" 30\")\n g_code.append(\"%.4f\" %((line[1][2]+0j).real)) #z1 coord\n g_code.append(\" 11\")\n g_code.append(\"%.4f\" %((line[2][0]+0j).real)) #x2 coord\n g_code.append(\" 21\")\n g_code.append(\"%.4f\" %((line[2][1]+0j).real)) #y2 coord\n g_code.append(\" 31\")\n g_code.append(\"%.4f\" %((line[2][2]+0j).real)) #z2 coord\n g_code.append(\" 0\")\n\n g_code.append(\"ENDSEC\")\n g_code.append(\"0\")\n g_code.append(\"EOF\")\n ######################################\n ## END G-CODE WRITING for Dxf_Write ##\n ######################################\n return g_code\n ##################################################\n ### End Dxf_Write G-Code Writing Function ###\n ##################################################\n\n #####################################\n ### Begin CSV Writing Function ###\n #####################################\n def generate_csv_write_gcode(self,side,Rapids=True):\n g_code = []\n mv_type = 1\n g_code.append(\"Type,X,Y,Z\")\n for line in side:\n type_last = mv_type\n if (line[0] == 1) or (line[0] == 0 and Rapids):\n mv_type = line[0]\n if type_last != mv_type:\n g_code.append(\"%d,%.4f,%.4f,%.4f\" %(mv_type,\n (line[1][0]+0j).real,\n (line[1][1]+0j).real,\n (line[1][2]+0j).real))\n g_code.append(\"%d,%.4f,%.4f,%.4f\" %(mv_type,\n (line[2][0]+0j).real,\n (line[2][1]+0j).real,\n (line[2][2]+0j).real))\n elif line[0] == 0:\n g_code.append(\",,,\")\n # end for line in side \n return g_code\n \n #####################################\n ### End CSV Writing Function ###\n #####################################\n\n \n def generate_round_gcode(self,\n Lmin = 0.0,\n Lmax = 3.0,\n cut_depth = 0.03,\n tool_dia = .25,\n step_over = 25.0,\n feed = 20,\n plunge_feed=10.0,\n z_safe=.5,\n no_variables=False,\n Rstock=0.0,\n Wrap=\"XYZ\",\n preamble=\"\",\n postamble=\"\",\n PLACES_L=4,\n PLACES_R=3,\n PLACES_F=1,\n climb_mill=False,\n Reverse_Rotary = False,\n FSCALE=\"Scale-Rotary\"):\n\n g_code = []\n Feed_adj = feed\n if PLACES_F > 0:\n FORMAT_FEED = \"%% .%df\" %(PLACES_F)\n else:\n FORMAT_FEED = \"%d\"\n \n if Lmin < Lmax:\n Lmin_tp = Lmin + tool_dia/2.0\n Lmax_tp = Lmax - tool_dia/2.0\n else:\n Lmin_tp = Lmax + tool_dia/2.0\n Lmax_tp = Lmin - tool_dia/2.0\n \n sign = 1\n if Reverse_Rotary:\n sign = -1 * sign\n\n if not climb_mill:\n sign = -1 * sign\n\n g_code.append(\"( G-Code Generated by G-Code Ripper )\")\n g_code.append(\"( by Scorch - 2013-2021 www.scorchworks.com )\")\n if Lmax_tp-Lmin_tp < tool_dia:\n g_code.append(\"( Tool diameter too large for defined cleanup area. )\")\n return g_code\n \n if Wrap == \"XYZ\":\n return\n elif Wrap == \"Y2A\":\n LINEAR=\"X\"\n ROTARY=\"A\"\n g_code.append(\"( Rounding A-axis, Linear axis is X-axis)\")\n elif Wrap == \"X2B\":\n LINEAR=\"Y\"\n ROTARY=\"B\"\n g_code.append(\"( Rounding B-axis, Linear axis is Y-axis)\")\n elif Wrap == \"Y2B\":\n LINEAR=\"X\"\n ROTARY=\"B\"\n g_code.append(\"( Rounding B-axis, Linear axis is X-axis)\")\n elif Wrap == \"X2A\":\n LINEAR=\"Y\"\n ROTARY=\"A\"\n g_code.append(\"( Rounding A-axis, Linear axis is Y-axis)\")\n \n g_code.append(\"(A nominal stock radius of %f was used. )\" %(Rstock))\n g_code.append(\"(Z-axis zero position is the surface of the round stock. )\")\n g_code.append(\"(---------------------------------------------------------)\") \n g_code.append(\"G90 (set absolute distance mode)\")\n g_code.append(\"G90.1 (set absolute distance mode for arc centers)\")\n g_code.append(\"G17 (set active plane to XY)\")\n \n if self.units == \"in\":\n g_code.append(\"G20 (set units to inches)\")\n else:\n g_code.append(\"G21 (set units to mm)\")\n \n if no_variables==False:\n FORMAT = \"# = %% .%df\" %(PLACES_L)\n g_code.append(FORMAT %(plunge_feed))\n\n #FORMAT= \"# = %% .%df\" %(PLACES_F)\n FORMAT = \"# = %s\" %(FORMAT_FEED)\n\n g_code.append(FORMAT %(plunge_feed))\n\n for line in preamble.split('|'):\n g_code.append(line)\n\n g_code.append(\"(---------------------------------------------------------)\")\n ###################\n ## GCODE WRITING ##\n ###################\n\n if no_variables==False:\n g_code.append(\"G0 Z#\")\n else:\n FORMAT = \"G0 Z%%.%df\" %(PLACES_L)\n g_code.append(FORMAT %(z_safe) )\n\n FORMAT = \"G0 %%c%%.%df %%c%%.%df\" %(PLACES_L,PLACES_R)\n g_code.append(FORMAT %(LINEAR, Lmin_tp, ROTARY, 0.0) )\n \n FORMAT = \"G1 Z%%.%df F%s\" %(PLACES_L,FORMAT_FEED)\n g_code.append(FORMAT %(cut_depth, plunge_feed ) )\n \n Angle = 0\n\n Dangle = 360.0*sign\n Angle = Angle + Dangle\n if FSCALE == \"Scale-Rotary\":\n Dist = radians(Dangle)*Rstock\n Feed_adj = abs(Dangle / (Dist/feed) )\n FORMAT=\"G1 %%c%%.%df F%s\" %(PLACES_R,FORMAT_FEED)\n g_code.append(FORMAT %(ROTARY, Angle, Feed_adj) )\n\n Dangle = 360*(Lmax_tp-Lmin_tp)/(tool_dia*step_over/100)*sign\n Angle = Angle + Dangle\n if FSCALE == \"Scale-Rotary\":\n Dist = sqrt((radians(Dangle)*Rstock)**2 + (Lmax_tp-Lmin_tp)**2)\n Fdist = Lmax_tp-Lmin_tp\n Feed_adj = abs( Fdist / (Dist/feed) )\n FORMAT = \"G1 %%c%%.%df %%c%%.%df F%s\" %(PLACES_L, PLACES_R, FORMAT_FEED)\n g_code.append(FORMAT %(LINEAR, Lmax_tp, ROTARY, Angle, Feed_adj) )\n\n\n Dangle = 360.0*sign\n Angle = Angle + Dangle\n if FSCALE == \"Scale-Rotary\":\n Dist = abs(radians(Dangle)*Rstock)\n Feed_adj = abs(Dangle / (Dist/feed) )\n FORMAT = \"G1 %%c%%.%df F%s\" %(PLACES_R,FORMAT_FEED)\n g_code.append(FORMAT %(ROTARY, Angle, Feed_adj) )\n\n\n if no_variables==False:\n g_code.append(\"G0 Z #\")\n else:\n FORMAT = \"G0 Z%%.%df\" %(PLACES_L)\n g_code.append(FORMAT %(z_safe) )\n \n ########################\n ## END G-CODE WRITING ##\n ########################\n for entry in postamble.split('|'):\n g_code.append(entry)\n g_code.append(\"M5 M2\")\n return g_code\n\n\n def app_gcode_line(self,LINE,CODE,VALUE,PLACES,WriteAll):\n if isinstance(VALUE, complex):\n return LINE\n #if VALUE.imag != 0:\n # return LINE\n\n if CODE == \"F\":\n if (VALUE*10**PLACES) < 1:\n # Fix Zero feed rate\n VALUE = 1.0/(10**PLACES)\n\n if PLACES > 0:\n FORMAT=\"%% .%df\" %(PLACES)\n else:\n FORMAT=\"%d\"\n VAL = FORMAT %(VALUE)\n\n if ( VAL != self.MODAL_VAL[CODE] )\\\n or ( CODE==\"I\" ) \\\n or ( CODE==\"J\" ) \\\n or (WriteAll):\n LINE = LINE + \" %s%s\" %(CODE, VAL)\n self.MODAL_VAL[CODE] = VAL\n\n return LINE\n\n def get_arc_intersects(self, p1, p2, xsplit, cent, code):\n xcross1= xsplit\n xcross2= xsplit\n \n R = sqrt( (cent[0]-p1[0])**2 + (cent[1]-p1[1])**2 )\n Rt= sqrt( (cent[0]-p2[0])**2 + (cent[1]-p2[1])**2 )\n if abs(R-Rt) > self.accuracy: fmessage(\"Radius Warning: R1=%f R2=%f\"%(R,Rt))\n\n val = R**2 - (xsplit - cent[0])**2\n if val >= 0.0:\n root = sqrt( val )\n ycross1 = cent[1] - root\n ycross2 = cent[1] + root\n else:\n return []\n\n theta = self.Get_Angle2(p1[0]-cent[0],p1[1]-cent[1])\n\n xbeta,ybeta = self.Transform(p2[0]-cent[0],p2[1]-cent[1],radians(-theta))\n beta = self.Get_Angle2(xbeta,ybeta,code)\n\n if abs(beta) <= self.Zero: beta = 360.0\n\n xt,yt = self.Transform(xsplit-cent[0],ycross1-cent[1],radians(-theta))\n gt1 = self.Get_Angle2(xt,yt,code)\n\n xt,yt = self.Transform(xsplit-cent[0],ycross2-cent[1],radians(-theta))\n gt2 = self.Get_Angle2(xt,yt,code)\n \n if gt1 < gt2:\n gamma1 = gt1\n gamma2 = gt2\n else:\n gamma1 = gt2\n gamma2 = gt1\n temp = ycross1\n ycross1 = ycross2\n ycross2 = temp\n\n dz = p2[2] - p1[2] \n da = beta\n mz = dz/da\n zcross1 = p1[2] + gamma1 * mz\n zcross2 = p1[2] + gamma2 * mz\n\n output=[]\n if gamma1 < beta and gamma1 > self.Zero and gamma1 < beta-self.Zero:\n output.append([xcross1,ycross1,zcross1])\n if gamma2 < beta and gamma1 > self.Zero and gamma2 < beta-self.Zero:\n output.append([xcross2,ycross2,zcross2])\n \n #print(\" start: x1 =%5.2f y1=%5.2f z1=%5.2f\" %(p1[0], p1[1], p1[2]))\n #print(\" end: x2 =%5.2f y2=%5.2f z2=%5.2f\" %(p2[0], p2[1], p2[2]))\n #print(\"center: xc =%5.2f yc=%5.2f xsplit=%5.2f code=%s\" %(cent[0],cent[1],xsplit,code))\n #print(\"R = %f\" %(R))\n #print(\"theta =%5.2f\" %(theta))\n #print(\"beta =%5.2f gamma1=%5.2f gamma2=%5.2f\\n\" %(beta,gamma1,gamma2))\n #cnt=0\n #for line in output:\n # cnt=cnt+1\n # print(\"arc cross%d: %5.2f, %5.2f, %5.2f\" %(cnt, line[0], line[1], line[2]))\n #print(output)\n #print(\"----------------------------------------------\\n\")\n\n return output\n\n def arc2lines(self, p1, p2, cent, code, plane=\"17\"):\n if plane == \"18\":\n xind=2\n yind=0\n zind=1\n elif plane == \"19\":\n xind=1\n yind=2\n zind=0\n elif plane == \"17\":\n xind=0\n yind=1\n zind=2\n \n R = sqrt( (cent[xind]-p1[xind])**2 + (cent[yind]-p1[yind])**2 )\n Rt= sqrt( (cent[xind]-p2[xind])**2 + (cent[yind]-p2[yind])**2 )\n if abs(R-Rt) > self.accuracy: fmessage(\"Radius Warning: R1=%f R2=%f \"%(R,Rt))\n\n if code == 3:\n theta = self.Get_Angle2(p1[xind]-cent[xind],p1[yind]-cent[yind])\n xbeta,ybeta = self.Transform(p2[xind]-cent[xind],p2[yind]-cent[yind],radians(-theta))\n X1 = p1[xind]\n Y1 = p1[yind]\n Z1 = p1[zind]\n zstart = Z1\n zend = p2[zind]\n if code == 2:\n theta = self.Get_Angle2(p2[xind]-cent[xind],p2[yind]-cent[yind])\n xbeta,ybeta = self.Transform(p1[xind]-cent[xind],p1[yind]-cent[yind],radians(-theta))\n X1 = p2[xind]\n Y1 = p2[yind]\n Z1 = p2[zind]\n zstart = Z1\n zend = p1[zind]\n \n beta = self.Get_Angle2(xbeta,ybeta) #,code)\n \n if abs(beta) <= self.Zero: beta = 360.0\n ##########################################\n arc_step=self.arc_angle\n \n my_range=[]\n \n at=arc_step\n while at < beta:\n my_range.append(at)\n at = at+arc_step\n my_range.append(beta)\n\n \n\n new_lines=[]\n for at in my_range:\n xt,yt = self.Transform(R,0,radians(theta+at))\n\n X2 = cent[xind] + xt\n Y2 = cent[yind] + yt\n #Z2 = p1[zind] + at*(p2[zind]-p1[zind])/beta\n Z2 = zstart + at*(zend-zstart)/beta\n data = [\"\",\"\",\"\",\"\",\"\",\"\"]\n\n\n if code == 3:\n data[xind]=X1\n data[yind]=Y1\n data[zind]=Z1\n data[3+xind]=X2\n data[3+yind]=Y2\n data[3+zind]=Z2\n new_lines.append(data)\n else:\n data[xind]=X2\n data[yind]=Y2\n data[zind]=Z2\n data[3+xind]=X1\n data[3+yind]=Y1\n data[3+zind]=Z1\n new_lines.insert(0, data)\n \n X1=X2\n Y1=Y2\n Z1=Z2\n at = at+arc_step\n\n return new_lines\n \n def get_line_intersect(self,p1, p2, xsplit):\n dx = p2[0] - p1[0]\n dy = p2[1] - p1[1]\n dz = p2[2] - p1[2]\n \n xcross = xsplit \n try:\n my = dy/dx\n by = p1[1] - my * p1[0]\n ycross = my*xsplit + by\n except:\n ycross = p1[1]\n try:\n mz = dz/dx\n bz = p1[2] - mz * p1[0]\n zcross = mz*xsplit + bz\n except:\n zcross = p1[2]\n\n output=[]\n if xcross > min(p1[0],p2[0])+self.Zero and xcross < max(p1[0],p2[0])-self.Zero:\n output.append([xcross,ycross,zcross]) \n return output\n\n\n def apleft(self, gtext):\n self.left_side.append(gtext)\n\n\n def apright(self, gtext):\n self.right_side.append(gtext)\n\n\n def apboth(self, gtext):\n self.left_side.append(gtext)\n self.right_side.append(gtext)\n\n\n def rm_text(self,line,s,e):\n if e == -1:\n e = len(line)\n temp1 = line[0:s]\n temp2 = line[e+1:len(line)]\n return temp1+temp2\n\n\n def insert_text(self,line,itext,s):\n temp1 = line[0:s]\n temp2 = line[s:len(line)]\n return temp1+itext+temp2\n\n\n def coordop(self,coords,offset,rot):\n x = coords[0]\n y = coords[1] \n z = coords[2]\n x = x - offset[0]\n y = y - offset[1]\n z = z - offset[2] \n x,y = self.Transform(x,y, radians(rot) )\n return [x,y,z]\n\n\n def coordunop(self,coords,offset,rot):\n x = coords[0]\n y = coords[1] \n z = coords[2]\n x,y = self.Transform(x,y, radians(-rot) )\n x = x + offset[0]\n y = y + offset[1]\n z = z + offset[2] \n return [x,y,z]\n\n ####################################### #######################################\n ####################################### #######################################\n ####################################### #######################################\n ####################################### #######################################\n\n def FUNCTION_EVAL(self,list):\n #list consists of [name,val1,val2]\n name = list[0]\n val1 = float(list[1])\n fval = float(val1)\n #############################################\n ########### G-CODE FUNCTIONS ################\n #############################################\n # ATAN[Y]/[X] Four quadrant inverse tangent #\n # ABS[arg] Absolute value #\n # ACOS[arg] Inverse cosine #\n # ASIN[arg] Inverse sine #\n # COS[arg] Cosine #\n # EXP[arg] e raised to the given power #\n # FIX[arg] Round down to integer #\n # FUP[arg] Round up to integer #\n # ROUND[arg] Round to nearest integer #\n # LN[arg] Base-e logarithm #\n # SIN[arg] Sine #\n # SQRT[arg] Square Root #\n # TAN[arg] Tangent #\n # EXISTS[arg]\tCheck named Parameter #\n #############################################\n if name == \"ATAN\":\n fval2 = float(list[2])\n atan2(fval1,fval2)\n if name == \"ABS\":\n return abs(fval)\n if name == \"ACOS\":\n return degrees(acos(fval))\n if name == \"ASIN\":\n return degrees(asin(fval))\n if name == \"COS\":\n return cos(radians(fval))\n if name == \"EXP\":\n return exp(fval)\n if name == \"FIX\":\n return floor(fval)\n if name == \"FUP\":\n return ceil(fval)\n if name == \"ROUND\":\n return round(fval)\n if name == \"LN\":\n return log(fval)\n if name == \"SIN\":\n return sin(radians(fval))\n if name == \"SQRT\":\n return sqrt(fval)\n if name == \"TAN\":\n return tan(radians(fval))\n if name == \"EXISTS\":\n pass\n \n def EXPRESSION_EVAL(self,line):\n ###################################################\n ### EVALUATE MATH IN REGION ###\n ###################################################\n line_in = line\n P = 0\n if P==1: fmessage(\"line=%s\" %(line))\n\n if len(line)<2:\n MSG = \"ERROR EXP-1: Unable to evaluate expression: %s\\n\" %(line_in)\n raise ValueError(MSG)\n \n \n line = line.replace(\" \",\"\")\n \n #################################################\n ### G-CODE OPPERATORS ###\n ### In Precedence Order ###\n #################################################\n ## ** #\n ## * / MOD #\n ## + - #\n ## EQ NE GT GE LT LE #\n ## AND OR XOR #\n #################################################\n\n #################################################\n ### Replace multiple +/- with single operator ###\n #################################################\n cnt = 1\n while cnt > 0:\n if (not cmp_new(line[cnt],'+')) or (not cmp_new(line[cnt],'-')):\n sign = 1\n span = 0\n FLAG = True\n while FLAG:\n if not cmp_new(line[cnt+span],'+'):\n span = span + 1\n elif not cmp_new(line[cnt+span],'-'):\n sign = -sign\n span = span + 1\n else:\n FLAG = False\n tmp1=line[:(cnt)]\n tmp2=line[(cnt+span):]\n if sign > 0:\n line = tmp1+'+'+tmp2\n else:\n line = tmp1+'-'+tmp2 \n cnt=cnt + 1\n if cnt >= len(line):\n cnt = -1\n \n #########################################\n ### Replace multi-character operators ###\n ### with single character identifiers ###\n #########################################\n line = line.replace(\"XOR\",\"|\")\n line = line.replace(\"AND\",\"&\")\n line = line.replace(\"LE\",\"l\")\n line = line.replace(\"LT\",\"<\")\n line = line.replace(\"GE\",\"g\")\n line = line.replace(\"GT\",\">\")\n line = line.replace(\"NE\",\"!\")\n line = line.replace(\"EQ\",\"=\")\n line = line.replace(\"**\",\"^\")\n\n #########################################\n ### Split the text into a list ###\n #########################################\n line = re.split( r\"([\\[\\]^*/%+\\-| &l!=])\", line)\n \n #########################################\n ### Remove empty items from the list ###\n #########################################\n for i in range(line.count('')): line.remove('')\n \n #########################################\n ### Find the last \"[\" in the list ###\n #########################################\n s=-1\n for cnt in range(s+1,len(line)):\n if line[cnt] == '[':\n s = cnt\n if s == -1:\n MSG = \"ERROR EXP-2: Unable to evaluate expression: %s\" %(line_in)\n #fmessage(MSG)\n raise ValueError(MSG)\n \n #################################################################\n ### While there are still brackets \"[...]\" keep processing ###\n #################################################################\n while s != -1:\n ###############################################################\n ### Find the first occurrence of \"]\" after the current \"[\" ###\n ###############################################################\n e=-1\n for cnt in range(len(line)-1,s,-1):\n if line[cnt] == ']':\n e = cnt\n \n #############################################\n ### Find the items between the brackets ###\n #############################################\n temp = line[s+1:e]\n \n ##############################################################\n ### Fix Some Special Cases ###\n ##############################################################\n ### **- *- MOD- ###\n ##############################################################\n for cnt in range(0,len(temp)):\n if (not cmp_new(temp[cnt],'^')) or \\\n (not cmp_new(temp[cnt],'*')) or \\\n (not cmp_new(temp[cnt],'%')):\n if not cmp_new(temp[cnt+1],'-'):\n temp[cnt+1]=''\n temp[cnt+2]= -float(temp[cnt+2])\n elif not cmp_new(temp[cnt+1],'+'):\n temp[cnt+1]=''\n temp[cnt+2]= float(temp[cnt+2])\n for i in range(temp.count('')): temp.remove('')\n\n #####################################\n XOR_operation = self.list_split(temp,\"|\") #XOR\n for iXOR in range(0,len(XOR_operation)):\n #####################################\n AND_operation = self.list_split(XOR_operation[iXOR],\"&\") #AND\n for iAND in range(0,len(AND_operation)):\n #####################################\n LE_operation = self.list_split(AND_operation[iAND],\"l\") #LE\n for iLE in range(0,len(LE_operation)):\n #####################################\n LT_operation = self.list_split(LE_operation[iLE],\"<\") #LT\n for iLT in range(0,len(LT_operation)):\n #####################################\n GE_operation = self.list_split(LT_operation[iLT],\"g\") #GE\n for iGE in range(0,len(GE_operation)):\n #####################################\n GT_operation = self.list_split(GE_operation[iGE],\">\") #GT\n for iGT in range(0,len(GT_operation)):\n #####################################\n NE_operation = self.list_split(GT_operation[iGT],\"!\") #NE\n for iNE in range(0,len(NE_operation)):\n #####################################\n EQ_operation = self.list_split(NE_operation[iNE],\"=\") #EQ\n for iEQ in range(0,len(EQ_operation)):\n #####################################\n add = self.list_split(EQ_operation[iEQ],\"+\")\n for cnt in range(1,len(add)):\n if add[cnt-1]==[]:\n add[cnt-1] = ''\n for i in range(add.count('')): add.remove('') \n for iadd in range(0,len(add)):\n #####################################\n subtract = self.list_split(add[iadd],\"-\") \n for cnt in range(1,len(subtract)):\n if subtract[cnt-1]==[]:\n subtract[cnt-1] = ''\n subtract[cnt][0] = -float(subtract[cnt][0])\n for i in range(subtract.count('')): subtract.remove('')\n for isub in range(0,len(subtract)):\n #####################################\n multiply = self.list_split(subtract[isub],\"*\")\n for imult in range(0,len(multiply)):\n #####################################\n divide = self.list_split(multiply[imult],\"/\")\n for idiv in range(0,len(divide)):\n #####################################\n mod = self.list_split(divide[idiv],\"%\")\n for imod in range(0,len(mod)):\n #####################################\n power = self.list_split(mod[imod],\"^\")\n for ipow in range(0,len(power)):\n if power[ipow]==[]:\n MSG = \"ERROR EXP-3: Unable to evaluate expression: %s\" %(line_in)\n raise ValueError(MSG)\n \n if type(power[0]) is list:\n power_len = len(power[0])\n else:\n power_len = 1\n if power_len > 1:\n power[ipow] = self.FUNCTION_EVAL(power[0])\n else:\n power[ipow] = float(power[ipow][0])\n #####################################\n res_power=power[0]\n for k in range(1,len(power)):\n res_power = res_power**power[k]\n if P==True: fmessage(\" POWER\"+str(power)+\"=\"+str(res_power))\n mod[imod]=res_power\n #####################################\n #REVERSE MOD\n res_mod=mod[len(mod)-1]\n for k in range(len(mod),1,-1):\n res_mod = mod[k-2]%res_mod\n fmessage(\" MOD\"+str(mod)+\"=\"+str(res_mod))\n divide[idiv]=res_mod\n #####################################\n res_divide=divide[0]\n for k in range(1,len(divide),1):\n res_divide = res_divide/divide[k]\n if P==True: fmessage(\" DIVIDE\"+str(divide)+\"=\"+str(res_divide))\n multiply[imult]=res_divide\n #####################################\n res_multiply=multiply[0]\n for k in range(1,len(multiply)):\n res_multiply = res_multiply*multiply[k]\n if P==True: fmessage(\"MULTIPLY\"+str(multiply)+\"=\"+str(res_multiply)) \n subtract[isub]=res_multiply\n #####################################\n res_subtract=subtract[0]\n for k in range(1,len(subtract)):\n res_subtract = res_subtract-subtract[k]\n if P==True: fmessage(\"SUBTRACT\"+str(subtract)+\"=\"+str(res_subtract))\n add[iadd]=res_subtract\n #####################################\n res_add=add[len(add)-1]\n for k in range(len(add),1,-1):\n res_add = add[k-2]+res_add\n if P==True: fmessage(\" ADD\"+str(add)+\"=\"+str(res_add))\n EQ_operation[iEQ]=res_add\n #####################\n res_EQ=EQ_operation[0]\n for k in range(1,len(EQ_operation),1):\n if res_EQ == EQ_operation[k]:\n res_EQ = 1\n else:\n res_EQ = 0\n if P==True: fmessage(\" EQ\"+str(EQ_operation)+\"=\"+str(res_EQ))\n NE_operation[iNE]=res_EQ\n #####################\n res_NE=NE_operation[0]\n for k in range(1,len(NE_operation),1):\n if res_NE != NE_operation[k]:\n res_NE = 1\n else:\n res_NE = 0\n if P==True: fmessage(\" NE\"+str(NE_operation)+\"=\"+str(res_NE))\n GT_operation[iGT]=res_NE\n #####################\n res_GT=GT_operation[0]\n for k in range(1,len(GT_operation),1):\n if res_GT > GT_operation[k]:\n res_GT = 1\n else:\n res_GT = 0\n if P==True: fmessage(\" GT\"+str(GT_operation),\"=\"+str(res_GT))\n GE_operation[iGE]=res_GT\n #####################\n res_GE=GE_operation[0]\n for k in range(1,len(GE_operation),1):\n if res_GE >= GE_operation[k]:\n res_GE = 1\n else:\n res_GE = 0\n if P==True: fmessage(\" GE\"+str(GE_operation)+\"=\"+str(res_GE))\n LT_operation[iLT]=res_GE\n #####################\n res_LT=LT_operation[0]\n for k in range(1,len(LT_operation),1):\n if res_LT < LT_operation[k]:\n res_LT = 1\n else:\n res_LT = 0\n if P==True: fmessage(\" LT\"+str(LT_operation)+\"=\"+str(res_LT))\n LE_operation[iLE]=res_LT\n #####################\n res_LE=LE_operation[0]\n for k in range(1,len(LE_operation),1):\n if res_LE <= LE_operation[k]:\n res_LE = 1\n else:\n res_LE = 0\n if P==True: fmessage(\" LE\"+str(LE_operation)+\"=\"+str(res_LE))\n AND_operation[iAND]=res_LE\n #####################\n res_AND=AND_operation[0]\n for k in range(1,len(AND_operation),1):\n if res_AND and AND_operation[k]:\n res_AND = 1\n else:\n res_AND = 0\n if P==True: fmessage(\" AND\"+str(AND_operation)+\"=\"+str(res_AND))\n XOR_operation[iXOR]=res_AND\n #####################\n res_XOR=XOR_operation[0]\n for k in range(1,len(XOR_operation),1):\n if bool(res_XOR) ^ bool(XOR_operation[k]):\n res_XOR = 1\n else:\n res_XOR = 0\n if P==True: fmessage(\" XOR\"+str(XOR_operation)+\"=\"+str(res_XOR))\n\n #####################################\n ### Return NEW VALUE to the list ###\n #####################################\n for i in range(e,s-1,-1): line.pop(i)\n line.insert(int(s),res_XOR)\n\n #############################\n # Find Last \"[\" in the list #\n #############################\n s=-1\n for cnt in range(s+1,len(line)):\n if line[cnt] == '[':\n s = cnt\n ################################################################# \n ### END of While there are still brackets \"[...]\" ###\n #################################################################\n \n if len(line) > 1:\n MSG = \"ERROR EXP-5: Unable to evaluate expression: %s\" %(line_in)\n raise ValueError(MSG)\n return \"%.4f\" %(line[0])\n\n\n def list_split(self,lst,obj):\n loc=[]\n index = -1\n for cnt in range(0,len(lst)):\n if not cmp_new(lst[cnt],obj):\n loc.append( lst[index+1:cnt] )\n index=cnt\n loc.append( lst[index+1:len(lst)])\n return loc\n\n ############################################################################\n # routine takes an x and a y coords and does a coordinate transformation #\n # to a new coordinate system at angle from the initial coordinate system #\n # Returns new x,y tuple #\n ############################################################################\n def Transform(self,x,y,angle):\n newx = x * cos(angle) - y * sin(angle)\n newy = x * sin(angle) + y * cos(angle)\n return newx,newy\n\n ############################################################################\n # routine takes an sin and cos and returnss the angle (between 0 and 360) #\n ############################################################################\n def Get_Angle2(self,x,y,code=\"\"):\n angle = 90.0-degrees(atan2(x,y))\n if angle < 0:\n angle = 360 + angle\n if code == \"G2\":\n return (360.0 - angle)\n else:\n return angle\n\n###############\n### END LIB ###\n###############\n\ndef main_is_frozen():\n return (hasattr(sys, \"frozen\") or # new py2exe or pyinstaller\n hasattr(sys, \"importers\")) # old py2exe\n\n################################################################################\n# Startup Application #\n################################################################################\nroot = Tk()\nroot.wm_attributes(\"-topmost\", 1)\napp = Application(root)\napp.master.title(\"G-Code-Ripper V\"+version)\napp.master.iconname(\"G-Code-Ripper\")\napp.master.minsize(780,540)\ntry:\n try:\n import tkFont\n default_font = tkFont.nametofont(\"TkDefaultFont\")\n except:\n import tkinter.font\n default_font = tkinter.font.nametofont(\"TkDefaultFont\")\n\n default_font.configure(size=9)\n default_font.configure(family='arial')\n #print(default_font.cget(\"size\"))\n #print(default_font.cget(\"family\"))\n debug_message(\"Font Set success!\")\nexcept:\n debug_message(\"Font Set Failed.\")\n\n################################## Set Icon ########################################\nIcon_Set=False\nif main_is_frozen():\n print(\"frozen\")\n try:\n root.iconbitmap(default=sys.argv[0])\n Icon_Set=True\n except:\n Icon_Set=False\n \nif not Icon_Set:\n try:\n scorch_ico_B64=b'R0lGODlhEAAQAIYAAA\\\n AAABAQEBYWFhcXFxsbGyUlJSYmJikpKSwsLC4uLi8vLzExMTMzMzc3Nzg4ODk5OTs7Oz4+PkJCQkRERE\\\n VFRUtLS0xMTE5OTlNTU1dXV1xcXGBgYGVlZWhoaGtra3FxcXR0dHh4eICAgISEhI+Pj5mZmZ2dnaKioq\\\n Ojo62tra6urrS0tLi4uLm5ub29vcLCwsbGxsjIyMzMzM/Pz9PT09XV1dbW1tjY2Nzc3OHh4eLi4uXl5e\\\n fn5+jo6Ovr6+/v7/Hx8fLy8vT09PX19fn5+fv7+/z8/P7+/v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEKAEkALAAAAAAQABAAQAj/AJMIFBhBQYAACRIkWbgwAA\\\n 4kEFEECACAxBAkGH8ESEKgBZIiAIQECBAjAA8kNwIkScKgQhAkRggAIJACCZIaJxgk2clgAY4OAAoEAO\\\n ABCIIDSZIwkIHEBw0YFAAA6IGDCBIkLAhMyICka9cAKZCIRTLEBIMkaA0MSNGjSBEVIgpESEK3LgMCI1\\\n aAWCFDA4EDSQInwaDACBEAImLwCAFARw4HFJJcgGADyZEAL3YQcMGBBpIjHx4EeIGkRoMFJgakWADABx\\\n IkPwIgcIGkdm0AMJDo1g3jQBIBRZAINyKAwxEkyHEUSMIcwYYbEgwYmQGgyI8SD5Jo327hgIIAAQ5cBs\\\n CQpHySgAA7'\n icon_im =PhotoImage(data=scorch_ico_B64, format='gif')\n root.call('wm', 'iconphoto', root._w, '-default', icon_im)\n except:\n pass\n#####################################################################################\n \n \nroot.mainloop()\n"} {"id": "linuxcnc-source:lib/python/qtvcp/plugins/led_plugin.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/qtvcp/plugins/led_plugin.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/qtvcp/plugins/led_plugin.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "268ea3ffa9ab9da6254ab8d463c2b84c54142f0bb8f1ef7d8ba74fbc23186db0", "bytes": 1289, "tokens": 396, "text": "#!/usr/bin/env python3\n\nfrom PyQt5.QtGui import QIcon, QPixmap\nfrom PyQt5.QtDesigner import QPyDesignerCustomWidgetPlugin\nfrom qtvcp.widgets.led_widget import LED\nfrom qtvcp.widgets.qtvcp_icons import Icon\n\nICON = Icon()\n\n\nclass LEDPlugin(QPyDesignerCustomWidgetPlugin):\n\n def __init__(self, parent=None):\n super(LEDPlugin, self).__init__(parent)\n\n self.initialized = False\n\n def initialize(self, core):\n if self.initialized:\n return\n\n self.initialized = True\n\n def isInitialized(self):\n return self.initialized\n\n def createWidget(self, parent):\n return LED(parent)\n\n def name(self):\n return \"LED\"\n\n def group(self):\n return \"Linuxcnc - HAL\"\n\n def icon(self):\n return QIcon(QPixmap(ICON.get_path('led')))\n\n def toolTip(self):\n return \"\"\n\n def whatsThis(self):\n return \"\"\n\n def isContainer(self):\n return False\n\n # Returns an XML description of a custom widget instance that describes\n # default values for its properties. Each custom widget created by this\n # plugin will be configured using this description.\n def domXml(self):\n return '\\n'\n\n def includeFile(self):\n return \"qtvcp.widgets.led_widget\"\n"} {"id": "linuxcnc-source:lib/python/qtvcp/widgets/bar.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/qtvcp/widgets/bar.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/qtvcp/widgets/bar.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "85eeac2766e443554e8985f84391c9eb67c076f3fa783d11d384d611f6437edd", "bytes": 11874, "tokens": 3345, "text": "from PyQt5 import QtWidgets\nfrom PyQt5.QtGui import QColor, QBrush, QPainter\nfrom PyQt5.QtCore import (Qt, pyqtSlot, pyqtProperty, QVariant, QRectF,\n QSize)\n\ntry:\n from PyQt5.QtCore import Q_ENUM\nexcept:\n # before Qt 5.10\n from PyQt5.QtCore import Q_ENUMS as Q_ENUM\n\nfrom qtvcp.widgets.widget_baseclass import _HalWidgetBase\nimport hal\n\n# Set up logging\nfrom qtvcp import logger\nLOG = logger.getLogger(__name__)\n\n# Force the log level for this module\n#LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL\n\nclass Bar(QtWidgets.QWidget):\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n\n self._vertical = False\n self._opposite = False\n self._minimum = 0\n self._maximum = 200\n self._value = 100\n\n self.setSizePolicy(\n QtWidgets.QSizePolicy.MinimumExpanding,\n QtWidgets.QSizePolicy.MinimumExpanding\n )\n\n # set default number of colored steps\n self.setSteps(None)\n\n self._bar_solid_percent = 0.9\n self._background_color = QColor('black')\n self._padding = 4.0 # n-pixel gap around edge.\n\n def paintEvent(self, e):\n painter = QPainter(self)\n\n brush = QBrush()\n brush.setColor(self._background_color)\n brush.setStyle(Qt.SolidPattern)\n rect = QRectF(0, 0, painter.device().width(), painter.device().height())\n painter.fillRect(rect, brush)\n\n # Get current state.\n vmin, vmax = self.minimum(), self.maximum()\n value = self.value()\n\n # Define our canvas.\n d_height = painter.device().height() - (self._padding * 2)\n d_width = painter.device().width() - (self._padding * 2)\n\n if self._vertical:\n # Draw the vertical bars.\n step_size = d_height / self.n_steps\n bar_height = step_size * self._bar_solid_percent\n bar_spacer = step_size * (1 - self._bar_solid_percent) / 2\n\n # Calculate the y-stop position, from the value in range.\n pc = (value - vmin) / (vmax - vmin)\n n_steps_to_draw = int(pc * self.n_steps)\n partial = (pc * self.n_steps) % 1\n #print('pre',value,pc, n_steps_to_draw, partial)\n\n n =-1 # default fall through value if n_steps_to_draw = 0\n # draw complete step bars\n for n in range(n_steps_to_draw):\n brush.setColor(QColor(self._step_color_list[n]))\n if self._opposite:\n rect = QRectF(\n self._padding,\n self._padding + (( + n) * step_size) + bar_spacer,\n d_width,\n bar_height\n )\n else:\n rect = QRectF(\n self._padding,\n self._padding + d_height - ((1 + n) * step_size) + bar_spacer,\n d_width,\n bar_height\n )\n painter.fillRect(rect, brush)\n\n # draw partial step bar for in-between values\n if partial > 0:\n n +=1\n brush.setColor(QColor(self._step_color_list[n]))\n if self._opposite:\n rect = QRectF(\n self._padding,\n self._padding + (n * step_size) + bar_spacer,\n d_width,\n bar_height * partial\n )\n else:\n height = (bar_height* partial)\n # left,top,width,height\n rect = QRectF(\n self._padding,\n self._padding + d_height - (n * step_size) + bar_spacer - height,\n d_width,\n height- bar_spacer\n )\n\n painter.fillRect(rect, brush)\n\n else:\n # Draw the horizontal bars.\n step_size = d_width / self.n_steps\n bar_width = step_size * self._bar_solid_percent\n bar_spacer = step_size * (1 - self._bar_solid_percent) / 2\n\n # Calculate the y-stop position, from the value in range.\n pc = (value - vmin) / (vmax - vmin)\n n_steps_to_draw = int(pc * self.n_steps)\n partial = (pc * self.n_steps) % 1\n #print('pre',value,pc, n_steps_to_draw, partial)\n\n n=-1 # default fall through value if n_steps_to_draw = 0\n for n in range(n_steps_to_draw):\n brush.setColor(QColor(self._step_color_list[n]))\n # left, top, width and height floats\n if self._opposite:\n left = self._padding + d_width - ((1 + n) * step_size) + bar_spacer\n else:\n left = self._padding + bar_spacer + ((0 + n) * step_size)\n rect = QRectF(\n left ,\n self._padding ,\n bar_width,\n d_height\n )\n painter.fillRect(rect, brush)\n\n # draw partial step bar for in-between values\n if partial > 0:\n n+=1\n brush.setColor(QColor(self._step_color_list[n]))\n # right to left\n if self._opposite:\n width = (bar_width* partial)\n left = self._padding - (n * step_size) + d_width - width\n rect = QRectF(\n left ,\n self._padding ,\n width - bar_spacer,\n d_height\n )\n # left to right\n else:\n left = self._padding + bar_spacer + (n * step_size)\n rect = QRectF(\n left,\n self._padding ,\n bar_width * partial,\n d_height\n )\n painter.fillRect(rect, brush)\n\n painter.end()\n\n # list of color strings or an integer of steps\n def setSteps(self, steps):\n if steps is None:\n steps = ['green', 'green', '#00b600', '#00b600', '#00d600',\n '#00d600', 'yellow', 'yellow', 'red', 'red']\n self.n_steps = len(steps)\n self._step_color_list = steps\n\n if isinstance(steps, list):\n # list of colors.\n self.n_steps = len(steps)\n self._step_color_list = steps\n\n elif isinstance(steps, int):\n # int number of bars, defaults to red.\n self.n_steps = steps\n self._step_color_list = ['red'] * steps\n else:\n raise TypeError('steps must be a list or int')\n\n def value(self):\n return self._value\n\n @pyqtSlot(float)\n @pyqtSlot(int)\n def setValue(self, data):\n if data != self._value:\n if data > self._maximum: data = self._maximum\n if data < self._minimum : data = self._minimum\n self._value = data\n self.update()\n\n def sizeHint(self):\n if self._vertical:\n return QSize(40, 120)\n else:\n return QSize(40, 20)\n\n def minimum(self):\n return self._minimum\n\n def maximum(self):\n return self._maximum\n\n def setRange(self, low, hi):\n self._minimum = low\n self._maximum = hi\n\n def setFormat(self, data):\n pass\n\n def getInvertedAppearance(self):\n return self._opposite\n def setInvertedAppearance(self, data):\n self._opposite = bool(data)\n self.update()\n def resetInvertedAppearance(self, data):\n self._opposite = False\n self.update()\n\n #########################################################################\n # This is how designer can interact with our widget properties.\n # designer will show the pyqtProperty properties in the editor\n # it will use the get set and reset calls to do those actions\n ########################################################################\n\n def set_step_color_l(self, data):\n # convert stylesheet list of single string to list of multiple\n if ',' in data[0]:\n self.setSteps(data[0].split(','))\n else:\n self.setSteps(data)\n def get_step_color_l(self):\n return self._step_color_list\n def reset_step_color_l(self):\n self.setSteps( ['green', 'green', '#00b600', '#00b600',\n '#00d600', '#00d600', 'yellow', 'yellow', 'red', 'red'])\n\n def getBackgroundColor(self):\n return self._background_color\n\n @pyqtSlot(QColor)\n def setBackgroundColor(self, value):\n self._background_color = value\n self.update()\n\n def getMax(self):\n return self._maximum\n def setMax(self, data):\n self._maximum = data\n def resetMax(self):\n self._maximum = 200\n\n def getMin(self):\n return self._minimum\n def setMin(self, data):\n self._minimum = data\n def resetMin(self):\n self._minimum = 0\n\n def getVertical(self):\n return self._vertical\n def setVertical(self, data):\n self._vertical = data\n self.update()\n def resetVertical(self):\n self._vertical = False\n self.update()\n\n stepColorList = pyqtProperty(\n QVariant.typeToName(QVariant.StringList),\n get_step_color_l, set_step_color_l, reset_step_color_l)\n\n backgroundColor = pyqtProperty(QColor, getBackgroundColor, setBackgroundColor)\n setMaximum = pyqtProperty(int, getMax, setMax, resetMax)\n setMinimum = pyqtProperty(int, getMin, setMin, resetMin)\n setVertical = pyqtProperty(bool, getVertical, setVertical, resetVertical)\n setInverted = pyqtProperty(bool, getInvertedAppearance, setInvertedAppearance, resetInvertedAppearance)\n\nclass HALPinType:\n NONE = 0\n S32 = hal.HAL_S32\n FLOAT = hal.HAL_FLOAT\n\n\nclass HalBar(Bar, _HalWidgetBase):\n HALPinType = HALPinType\n Q_ENUM(HALPinType)\n\n # older version of pyqt5 need this as well as Q_ENUM\n NONE = 0\n S32 = hal.HAL_S32\n FLOAT = hal.HAL_FLOAT\n\n def __init__(self, *args, **kwargs):\n super(). __init__( *args, **kwargs)\n self._pin_type = HALPinType.S32\n self._pin_name = ''\n\n def _hal_init(self):\n if self._pin_name == '':\n pname = self.HAL_NAME_\n else:\n pname = self._pin_name\n\n if self._pin_type == HALPinType.FLOAT:\n self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_FLOAT, hal.HAL_IN)\n self.hal_pin.value_changed.connect(lambda data: self.updateDisplay(data))\n elif self._pin_type == HALPinType.S32:\n self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_S32, hal.HAL_IN)\n self.hal_pin.value_changed.connect(lambda data: self.updateDisplay(data))\n\n def updateDisplay(self, data):\n self.setValue(data)\n\n def set_pin_type(self, value):\n self._pin_type = value\n def get_pin_type(self):\n return self._pin_type\n def reset_pin_type(self):\n self._pin_type = HALPinType.S32\n\n def set_pin_name(self, value):\n self._pin_name = value\n def get_pin_name(self):\n return self._pin_name\n def reset_pin_name(self):\n self._pin_name = ''\n\n pinType = pyqtProperty(HALPinType, get_pin_type, set_pin_type, reset_pin_type)\n pinName = pyqtProperty(str, get_pin_name, set_pin_name, reset_pin_name)\n\nif __name__ == '__main__':\n app = QtWidgets.QApplication([])\n bar = HalBar()\n bar.setProperty('setInverted',True)\n bar.setProperty('setVertical',True)\n bar.setValue(51)\n bar.show()\n app.exec_()\n"} {"id": "linuxcnc-source:lib/python/qtvcp/widgets/overlay_widget.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "lib/python/qtvcp/widgets/overlay_widget.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/lib/python/qtvcp/widgets/overlay_widget.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "30420d0290326f67aef0b61bd667570ee902192b2ff49d2215502786067f84b4", "bytes": 15577, "tokens": 4507, "text": "#!/usr/bin/env python3\n#\n# Qtvcp widget\n# Copyright (c) 2017 Chris Morley\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n###############################################################################\n\nimport os\n\nfrom PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout,\n QVBoxLayout, QPushButton, QDialog, QProgressBar)\nfrom PyQt5.QtCore import (Qt, QEvent, pyqtSlot, pyqtProperty, QChildEvent,\n )\nfrom PyQt5.QtGui import QColor, QImage, QResizeEvent, QPainter, QMoveEvent\n\nfrom qtvcp.widgets.widget_baseclass import _HalWidgetBase\nfrom qtvcp.core import Status\nfrom qtvcp import logger\n\n# Instantiate the libraries with global reference\n# STATUS gives us status messages from linuxcnc\n# LOG is for running code logging\nif __name__ != '__main__':\n STATUS = Status()\nLOG = logger.getLogger(__name__)\n\n# Set the log level for this module\n#LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL\n\n\n################################################################\n# Overlay base class\n# based on c++ code on net\n# Originally designed to allow an overlay on individual widgets\n# which might be nice too but for now just the wholw window\n################################################################\nclass OverlayWidget(QWidget):\n def __init__(self, parent=None):\n self.last = None\n self.top_level = parent\n super(OverlayWidget, self).__init__(parent)\n self.parent = parent\n #self.setAttribute(Qt.WA_NoSystemBackground)\n #self.setAttribute(Qt.WA_TransparentForMouseEvents)\n\n self.setWindowFlags( self.windowFlags() |Qt.Tool |\n Qt.FramelessWindowHint |\n Qt.WindowStaysOnTopHint )\n if not self.parent is None:\n self.parent.installEventFilter(self)\n\n # There seems to be no way to get the very top level widget\n # in QT the parent widget can be owned in another parent\n # this adds an event filter the widget in 'top_level'\n # so we can track what is happening to it.\n def newParent(self):\n self.parent = self.top_level\n self.last = self.parent\n if self.last is not None:\n LOG.debug('last removed: {} NEW:{}'.format(self.last, self.parent))\n self.last.removeEventFilter(self)\n if not self.parent: return\n self.parent.installEventFilter(self)\n #self.raise_()\n\n # Here we track parent window events that we need to react to.\n # then we pass then to the original widget\n def eventFilter(self, obj, event):\n # might be useful events to know\n # 103 window blocked by modal dialog\n # 99 activation changed\n # 25 deactivated\n # 24 activated\n #print event,'parent',self.parent\n #print event,'Event Type',self.event.type()\n if obj == self.parent:\n #Catches resize and child events from the parent widget\n if event.type() == QEvent.Resize:\n #print 'resize'\n self.resize(QResizeEvent.size(event))\n elif event.type() == QEvent.Move:\n self.move(QMoveEvent.pos(event))\n elif(event.type() == QEvent.ChildAdded):\n #print 'CHILD',QChildEvent.child(event)\n if not QChildEvent.child(event) is QDialog:\n self.raise_()\n if event.type() == QEvent.Close:\n self.hide()\n self.closeEvent(event)\n event.accept()\n return super(OverlayWidget, self).eventFilter(obj, event)\n\n # Tracks our instanance of focus widget changes\n # most importantly the paint event\n # if the parent changes it adjusts the event filter\n # but in our case the parent won't because we are\n # tracking the main window rather the the widget focus is in\n def event(self, event):\n #print 'overlay:',event\n if event.type() == QEvent.ParentAboutToChange:\n #print 'REMOVE FILTER'\n self.parent.removeEventFilter(self)\n return True\n if event.type() == QEvent.ParentChange:\n #print 'parentEVENT:', self.parentWidget()\n self.newParent()\n return True\n if event.type() == QEvent.Paint:\n self.paintEvent(event)\n return True\n return False\n\n\n####################################################################\n# subclass for using as a fancy dialog focus overlay\n####################################################################\nclass FocusOverlay(OverlayWidget, _HalWidgetBase):\n def __init__(self, parent=None):\n super(FocusOverlay, self).__init__(parent)\n self.setAttribute(Qt.WA_TranslucentBackground)\n self.bg_color = QColor(0, 0, 0, 150)\n self.text = \"Loading...\"\n self._state = False\n self._image_path = '~/emc-dev/linuxcnc-wizard.gif'\n self._image = QImage(os.path.expanduser(self._image_path))\n self._show_buttons = False\n self._show_image = False\n self._image_transp = 0.3\n self._show_text = True\n self.box()\n\n # This is how we plant the very top level parent into\n # our overlay widget\n # QTVCP_INSTANCE is not accessible from Designer\n # it should work with any main window but doesn't.\n # this worked so i stopped looking why\n # this also sets up following show or hide etc based on\n # STATUS messages\n # adjust image path name at runtime\n def _hal_init(self):\n STATUS.connect('focus-overlay-changed', lambda w, data, text, color:\n self._status_response(data, text, color))\n STATUS.connect('graphics-loading-progress',lambda w,f: self.updateProgress(f))\n if self.PREFS_:\n self.play_sound = self.PREFS_.getpref('overlay_play_sound', False, bool, 'SCREEN_OPTIONS')\n self.sound_type = self.PREFS_.getpref('overlay_sound_type', 'RING', str, 'SCREEN_OPTIONS')\n else:\n self.play_sound = False\n\n # reparent on top window\n self.top_level = self.QTVCP_INSTANCE_\n self.newParent()\n\n # adjust size and location to top window\n self.setGeometry(self.top_level.geometry())\n self.hide()\n\n # look for special path names and change to real path\n if 'STD_IMAGE_DIR/' in self._image_path:\n t = self._image_path.split('STD_IMAGE_DIR/', )[1]\n d = os.path.join(self.PATHS_.IMAGEDIR, t)\n elif 'CONFIG_DIR/' in self._image_path:\n t = self._image_path.split('CONFIG_DIR/', )[1]\n d = os.path.join(self.PATHS_.CONFIGPATH, t)\n else:\n return\n if os.path.exists(d):\n self._image = QImage(d)\n else:\n LOG.debug('Focus Overlay image path runtime error: {}'.format(self._image_path))\n\n def _status_response(self, data, text, color):\n if data:\n if color:\n self.bg_color = color\n else:\n self.bg_color = QColor(0, 0, 0, 150)\n if text:\n self.setShowText(True)\n self.text = text\n else:\n self.setShowText(False)\n self.show()\n self.update()\n LOG.debug('Overlay - Show')\n if self.play_sound:\n STATUS.emit('play-sound', '%s' % self.sound_type)\n #os.system(\"beep -f 555 \")\n else:\n self.hide()\n LOG.debug('Overlay - Hide')\n\n # Ok paint everything\n def paintEvent(self, event):\n qp = QPainter()\n qp.begin(self)\n self.colorBackground(qp)\n if self._show_image:\n self.draw_image(qp)\n self.drawText(qp)\n qp.end()\n\n #################################################\n # Helper functions\n #################################################\n\n def updateProgress(self,fraction):\n if fraction <0:\n self.progressbar.setValue(0)\n self.progressbar.setFormat('')\n self.progressbar.setVisible(False)\n self.hide()\n else:\n self.progressbar.setVisible(True)\n self.progressbar.setValue(fraction)\n self.progressbar.setFormat('Loading: {}%'.format(fraction))\n\n # The basic overlay -transparence is set by bg_color\n def colorBackground(self, qp):\n qp.fillRect(self.rect(), self.bg_color)\n\n # we can add an image like a watermark transparence set by\n # _image_transp\n def draw_image(self, qp):\n #print self._image, self._image_transp\n qp.setOpacity(self._image_transp)\n qp.drawImage(self.rect(), self._image)\n\n # This sets the text that was built in the box\n # old code for text is skipped\n def drawText(self, qp):\n qp.setOpacity(1.0)\n self.mb.setText('

%s

' % self.text)\n return\n size = self.size()\n w = size.width()\n h = size.height()\n qp.setPen(self.text_color)\n qp.setFont(self.font)\n qp.drawText(self.rect(), Qt.AlignCenter, self.text)\n\n # build a black label with text and optionally some buttons\n # using a label rather then drawing text allows options suck as rich text\n # and a solid back ground so text is easy to see\n # buttons could be used as a dialog but would require a focus widget per\n # dialog action or some fancy coding for responses.\n def box(self):\n hbox2 = QHBoxLayout()\n hbox2.addStretch(1)\n self.mb = QLabel('

%s

' % self.text, self)\n self.mb.setStyleSheet(\"background-color: black; color: white\")\n self.mb.setAlignment(Qt.AlignVCenter | Qt.AlignCenter)\n self.mb.setVisible(self._show_text)\n hbox2.addWidget(self.mb)\n\n self.progressbar = QProgressBar()\n self.progressbar.setStyleSheet(\"background-color: black; color: white\")\n self.progressbar.setRange(0,100)\n self.progressbar.setVisible(False)\n hbox2.addWidget(self.progressbar)\n\n hbox = QHBoxLayout()\n hbox.addStretch(1)\n self.okButton = QPushButton(\"OK\")\n self.okButton.pressed.connect(self.okChecked)\n self.cancelButton = QPushButton(\"Cancel\")\n self.cancelButton.pressed.connect(self.cancelChecked)\n self.okButton.setVisible(self._show_buttons)\n self.cancelButton.setVisible(self._show_buttons)\n l = QLabel()\n hbox.addWidget(l)\n hbox.addWidget(self.okButton)\n hbox.addWidget(self.cancelButton)\n\n vbox = QVBoxLayout()\n vbox.addStretch(1)\n vbox.addLayout(hbox2)\n vbox.addLayout(hbox)\n self.setLayout(vbox)\n self.setGeometry(300, 300, 300, 150)\n\n # would need to class patch for something really useful\n def okChecked(self):\n self.hide()\n def cancelChecked(self):\n self.hide()\n\n #########################################################################\n # This is how designer can interact with our widget properties.\n # designer will show the pyqtProperty properties in the editor\n # it will use the get set and reset calls to do those actions\n ########################################################################\n\n @pyqtSlot(bool)\n def setState(self, value):\n self._state = value\n if value:\n self.show()\n else:\n self.hide()\n def getState(self):\n return self._state\n def resetState(self):\n self._state = False\n\n def getOverayColor(self):\n return self.bg_color\n @pyqtSlot(QColor)\n def setOverayColor(self, value):\n self.bg_color = value\n def resetOverayColor(self, value):\n self.bg_color = value\n\n def setShowText(self, value):\n self._show_text = value\n self.mb.setVisible(value)\n def getShowText(self):\n return self._show_text\n def resetShowText(self, value):\n self._show_text = True\n self.mb.setVisible(value)\n\n def setshow_image(self, data):\n self._show_image = data\n #self.hide()\n #self.show()\n def getshow_image(self):\n return self._show_image\n def resetshow_image(self):\n self._show_image = False\n\n def set_image_transp(self, data):\n self._image_transp = data\n #self.hide()\n #self.show()\n def get_image_transp(self):\n return self._image_transp\n def reset_image_transp(self):\n self._image_transp = 0.3\n\n def setshow_buttons(self, data):\n self._show_buttons = data\n self.okButton.setVisible(data)\n self.cancelButton.setVisible(data)\n\n def getshow_buttons(self):\n return self._show_buttons\n def resetshow_buttons(self):\n self._show_buttons = False\n\n def setimage_path(self, data):\n self._image_path = str(data)\n try:\n path = os.path.expanduser(self._image_path)\n self._image = QImage(path)\n except Exception as e:\n LOG.debug('Focus Overlay image path error: {}'.format(self._image_path))\n def getimage_path(self):\n return self._image_path\n def resetimage_path(self):\n self._image_path = False\n\n overlay_color = pyqtProperty(QColor, getOverayColor, setOverayColor, resetOverayColor)\n state = pyqtProperty(bool, getState, setState, resetState)\n show_text = pyqtProperty(bool, getShowText, setShowText, resetShowText)\n show_image_option = pyqtProperty(bool, getshow_image, setshow_image, resetshow_image)\n image_transparency = pyqtProperty(float, get_image_transp, set_image_transp, reset_image_transp)\n show_buttons_option = pyqtProperty(bool, getshow_buttons, setshow_buttons, resetshow_buttons)\n image_path = pyqtProperty(str, getimage_path, setimage_path, resetimage_path)\n\n\n#################\n# Testing\n#################\ndef main():\n import sys\n from PyQt5.QtWidgets import QWidget, QApplication\n from PyQt5.QtCore import QTimer\n app = QApplication(sys.argv)\n\n w = QWidget()\n #w.setWindowFlags( Qt.FramelessWindowHint | Qt.Dialog | Qt.WindowStaysOnTopHint )\n w.setGeometry(300, 300, 250, 150)\n w.setWindowTitle('Test')\n\n l = QLabel('Hello, world!', w)\n l.show()\n LOG.debug('Label: {}'.format(l))\n\n # class patching is my new thing\n # class patch the OK button\n def newOk(w):\n print('Ok')\n w.text = 'OK'\n # make update\n w.hide()\n w.show()\n\n def pop():\n print('Pop')\n f.show()\n f.update()\n\n FocusOverlay.okChecked = newOk\n w.show()\n # could use f = FocusOverlay( w )\n # then dont need to adjust top level\n f = FocusOverlay()\n f.top_level = w\n f.newParent()\n # set with qtproperty call\n f.setshow_buttons(True)\n\n\n timer2 = QTimer()\n timer2.timeout.connect(lambda:pop() )\n timer2.start(1500)\n\n sys.exit(app.exec_())\n\n\nif __name__ == '__main__':\n main()\n"} {"id": "linuxcnc-source:scripts/travis-build-test.sh", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "scripts/travis-build-test.sh", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/scripts/travis-build-test.sh", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "cbedb821b8dc39319e200afe91150c4498fc7f640cfb3a33e486a48bca3e8870", "bytes": 332, "tokens": 145, "text": "#!/bin/sh -ex\ncd src\n./autogen.sh\n./configure --with-realtime=uspace --disable-check-runtime-deps --enable-build-documentation\nmake -O -j$(getconf _NPROCESSORS_ONLN) manpages V=1\nmake -O -j$(getconf _NPROCESSORS_ONLN) translateddocs V=1\nmake -O -j$(getconf _NPROCESSORS_ONLN) default pycheck V=1\n../scripts/rip-environment runtests\n"} {"id": "linuxcnc-source:scripts/travis-install-build-deps.sh", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "scripts/travis-install-build-deps.sh", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/scripts/travis-install-build-deps.sh", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "a63240f85e3ef142a48bb14716cf40938ebaaeadc807334cbff8a988841e7e76", "bytes": 809, "tokens": 299, "text": "#!/bin/sh -ex\nsudo sh -c 'echo deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main universe >> /etc/apt/sources.list'\ngrep . /etc/apt/sources.list /etc/apt/sources.list.d/* || true\nsudo apt-get update -qq\nsudo apt-get install -y devscripts equivs build-essential --no-install-recommends\nsudo apt-get remove -f libreadline6-dev || true\nsudo apt-get remove -f libreadline-dev || true\ndebian/configure\n# This gives an error that is hidden from us\n#mk-build-deps -i -r -s sudo -t 'apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --no-install-suggests'\nif ! sudo apt-get -y build-dep . ; then\n echo \"E: could not install dependencies, maybe inspect d/control for hints:\"\n cat debian/control\n echo\n echo \"E: apt-get -y build-dep . failed\"\n exit 1\nfi\nsudo apt install -y lintian\n"} {"id": "linuxcnc-source:src/emc/kinematics/genserfuncs.c", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/kinematics/genserfuncs.c", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/kinematics/genserfuncs.c", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "e4b775e93b973a4faae873c81a95d7d8361fe5c5c59ea81e362a5f900a1e8781", "bytes": 22068, "tokens": 8730, "text": "/********************************************************************\n* Description: genserfuncs.c\n* (originally part of genserkins.c)\n* Kinematics for a generalised serial kinematics machine\n*\n* Derived from a work by Fred Proctor,\n* changed to work with emc2 and HAL\n*\n* Adapting Author: Alex Joni\n* License: GPL Version 2\n* System: Linux\n*\n* Users:\n* 1) genserkins.c -- kinematics modules\n* 2) ugenserkins.c -- usermode test program (needs work)\n*******************************************************************\n\n These are the forward and inverse kinematic functions for a general\n serial-link manipulator. Thanks to Herman Bruyninckx and John\n Hallam at http://www.roble.info/ for this.\n\n The functions are general enough to be configured for any serial\n configuration.\n The kinematics use Denavit-Hartenberg definition for the joint and\n links. The DH definitions are the ones used by John J Craig in\n \"Introduction to Robotics: Mechanics and Control\"\n The parameters for the manipulator are defined by hal pins.\n Currently the type of the joints is hardcoded to ANGULAR, although\n the kins support both ANGULAR and LINEAR axes.\n\n TODO:\n * make number of joints a loadtime parameter\n * add HAL pins for all settable parameters, including joint type: ANGULAR / LINEAR\n*/\n\n#include \"rtapi_math.h\"\n#include \"gotypes.h\" /* go_result, go_integer */\n#include \"gomath.h\" /* go_pose */\n#include \"genserkins.h\" /* these decls */\n#include \"kinematics.h\"\n#include \"hal.h\"\n\n#ifdef RTAPI\n#include \"rtapi.h\"\n#endif\n\nstatic struct haldata {\n hal_u32_t *max_iterations;\n hal_u32_t *last_iterations;\n hal_float_t *a[GENSER_MAX_JOINTS];\n hal_float_t *alpha[GENSER_MAX_JOINTS];\n hal_float_t *d[GENSER_MAX_JOINTS];\n hal_s32_t *unrotate[GENSER_MAX_JOINTS];\n genser_struct *kins;\n go_pose *pos; // used in various functions, we malloc it\n // only once in genserKinematicsSetup()\n} *haldata = 0;\n\nstatic int total_joints;\ndouble j[GENSER_MAX_JOINTS];\n\n#define A(i) (*(haldata->a[i]))\n#define ALPHA(i) (*(haldata->alpha[i]))\n#define D(i) (*(haldata->d[i]))\n\n#define KINS_PTR (haldata->kins)\n\n#if GENSER_MAX_JOINTS < 6\n#error GENSER_MAX_JOINTS must be at least 6; fix genserkins.h\n#endif\n\nstatic int genser_hal_inited = 0;\n\nint genser_kin_init(void) {\n genser_struct *genser = KINS_PTR;\n int t;\n\n static volatile double tst=0;tst=sqrt(tst); // ensure -lm used\n /* init them all and make them revolute joints */\n /* FIXME: should allow LINEAR joints based on HAL param too */\n for (t = 0; t < GENSER_MAX_JOINTS; t++) {\n genser->links[t].u.dh.a = A(t);\n genser->links[t].u.dh.alpha = ALPHA(t);\n genser->links[t].u.dh.d = D(t);\n genser->links[t].u.dh.theta = 0;\n genser->links[t].type = GO_LINK_DH;\n genser->links[t].quantity = GO_QUANTITY_ANGLE;\n }\n\n /* set a select few to make it PUMA-like */\n // FIXME-AJ: make a hal pin, also set number of joints based on it\n genser->link_num = 6;\n\n return GO_RESULT_OK;\n}\n\n/* compute the forward jacobian function:\n the jacobian is a linear approximation of the kinematics function.\n It is calculated using derivation of the position transformation matrix,\n and usually used for feeding velocities through it.\n It is analytically possible to calculate the inverse of the jacobian\n (sometimes only the pseudoinverse) and to use that for the inverse kinematics.\n*/\nint compute_jfwd(go_link * link_params,\n int link_number,\n go_matrix * Jfwd,\n go_pose * T_L_0)\n{\n GO_MATRIX_DECLARE(Jv, Jvstg, 3, GENSER_MAX_JOINTS);\n GO_MATRIX_DECLARE(Jw, Jwstg, 3, GENSER_MAX_JOINTS);\n GO_MATRIX_DECLARE(R_i_ip1, R_i_ip1stg, 3, 3);\n GO_MATRIX_DECLARE(scratch, scratchstg, 3, GENSER_MAX_JOINTS);\n GO_MATRIX_DECLARE(R_inv, R_invstg, 3, 3);\n go_pose pose;\n go_quat quat;\n go_vector P_ip1_i[3];\n int row, col;\n\n /* init matrices to possibly smaller size */\n go_matrix_init(Jv, Jvstg, 3, link_number);\n go_matrix_init(Jw, Jwstg, 3, link_number);\n go_matrix_init(R_i_ip1, R_i_ip1stg, 3, 3);\n go_matrix_init(scratch, scratchstg, 3, link_number);\n go_matrix_init(R_inv, R_invstg, 3, 3);\n\n Jv.el[0][0] = 0, Jv.el[1][0] = 0, Jv.el[2][0] = (GO_QUANTITY_LENGTH == link_params[0].quantity ? 1 : 0);\n Jw.el[0][0] = 0, Jw.el[1][0] = 0, Jw.el[2][0] = (GO_QUANTITY_ANGLE == link_params[0].quantity ? 1 : 0);\n\n /* initialize inverse rotational transform */\n if (GO_LINK_DH == link_params[0].type) {\n go_dh_pose_convert(&link_params[0].u.dh, &pose);\n } else if (GO_LINK_PP == link_params[0].type) {\n pose = link_params[0].u.pp.pose;\n } else {\n return GO_RESULT_IMPL_ERROR;\n }\n\n *T_L_0 = pose;\n\n for (col = 1; col < link_number; col++) {\n /* T_ip1_i */\n if (GO_LINK_DH == link_params[col].type) {\n go_dh_pose_convert(&link_params[col].u.dh, &pose);\n } else if (GO_LINK_PP == link_params[col].type) {\n pose = link_params[col].u.pp.pose;\n } else {\n return GO_RESULT_IMPL_ERROR;\n }\n\n go_cart_vector_convert(&pose.tran, P_ip1_i);\n go_quat_inv(&pose.rot, &quat);\n go_quat_matrix_convert(&quat, &R_i_ip1);\n\n /* Jv */\n go_matrix_vector_cross(&Jw, P_ip1_i, &scratch);\n go_matrix_matrix_add(&Jv, &scratch, &scratch);\n go_matrix_matrix_mult(&R_i_ip1, &scratch, &Jv);\n Jv.el[0][col] = 0, Jv.el[1][col] = 0, Jv.el[2][col] = (GO_QUANTITY_LENGTH == link_params[col].quantity ? 1 : 0);\n /* Jw */\n go_matrix_matrix_mult(&R_i_ip1, &Jw, &Jw);\n Jw.el[0][col] = 0, Jw.el[1][col] = 0, Jw.el[2][col] = (GO_QUANTITY_ANGLE == link_params[col].quantity ? 1 : 0);\n if (GO_LINK_DH == link_params[col].type) {\n go_dh_pose_convert(&link_params[col].u.dh, &pose);\n } else if (GO_LINK_PP == link_params[col].type) {\n pose = link_params[col].u.pp.pose;\n } else {\n return GO_RESULT_IMPL_ERROR;\n }\n go_pose_pose_mult(T_L_0, &pose, T_L_0);\n }\n\n /* rotate back into {0} frame */\n go_quat_matrix_convert(&T_L_0->rot, &R_inv);\n go_matrix_matrix_mult(&R_inv, &Jv, &Jv);\n go_matrix_matrix_mult(&R_inv, &Jw, &Jw);\n\n /* put Jv atop Jw in J */\n for (row = 0; row < 6; row++) {\n for (col = 0; col < link_number; col++) {\n if (row < 3) {\n Jfwd->el[row][col] = Jv.el[row][col];\n } else {\n Jfwd->el[row][col] = Jw.el[row - 3][col];\n }\n }\n }\n\n return GO_RESULT_OK;\n}\n\n/* compute the inverse of the jacobian matrix */\nint compute_jinv(go_matrix * Jfwd, go_matrix * Jinv)\n{\n int retval;\n GO_MATRIX_DECLARE(JT, JTstg, GENSER_MAX_JOINTS, 6);\n\n /* compute inverse, or pseudo-inverse */\n if (Jfwd->rows == Jfwd->cols) {\n retval = go_matrix_inv(Jfwd, Jinv);\n if (GO_RESULT_OK != retval)\n return retval;\n } else if (Jfwd->rows < Jfwd->cols) {\n /* underdetermined, optimize on smallest sum of square of speeds */\n /* JT(JJT)inv */\n GO_MATRIX_DECLARE(JJT, JJTstg, 6, 6);\n\n go_matrix_init(JT, JTstg, Jfwd->cols, Jfwd->rows);\n go_matrix_init(JJT, JJTstg, Jfwd->rows, Jfwd->rows);\n go_matrix_transpose(Jfwd, &JT);\n go_matrix_matrix_mult(Jfwd, &JT, &JJT);\n retval = go_matrix_inv(&JJT, &JJT);\n if (GO_RESULT_OK != retval)\n return retval;\n go_matrix_matrix_mult(&JT, &JJT, Jinv);\n } else {\n /* overdetermined, do least-squares best fit */\n /* (JTJ)invJT */\n GO_MATRIX_DECLARE(JTJ, JTJstg, GENSER_MAX_JOINTS, GENSER_MAX_JOINTS);\n\n go_matrix_init(JT, JTstg, Jfwd->cols, Jfwd->rows);\n go_matrix_init(JTJ, JTJstg, Jfwd->cols, Jfwd->cols);\n go_matrix_transpose(Jfwd, &JT);\n go_matrix_matrix_mult(&JT, Jfwd, &JTJ);\n retval = go_matrix_inv(&JTJ, &JTJ);\n if (GO_RESULT_OK != retval)\n return retval;\n go_matrix_matrix_mult(&JTJ, &JT, Jinv);\n }\n\n return GO_RESULT_OK;\n}\n\nint genser_kin_jac_inv(void *kins,\n const go_pose * pos,\n const go_screw * vel, const go_real * joints, go_real * jointvels)\n{\n genser_struct *genser = (genser_struct *) kins;\n GO_MATRIX_DECLARE(Jfwd, Jfwd_stg, 6, GENSER_MAX_JOINTS);\n GO_MATRIX_DECLARE(Jinv, Jinv_stg, GENSER_MAX_JOINTS, 6);\n go_pose T_L_0;\n go_link linkout[GENSER_MAX_JOINTS];\n go_real vw[6];\n int link;\n int retval;\n\n go_matrix_init(Jfwd, Jfwd_stg, 6, genser->link_num);\n go_matrix_init(Jinv, Jinv_stg, GENSER_MAX_JOINTS, 6);\n\n for (link = 0; link < genser->link_num; link++) {\n retval =\n go_link_joint_set(&genser->links[link], joints[link],\n &linkout[link]);\n if (GO_RESULT_OK != retval)\n return retval;\n }\n retval = compute_jfwd(linkout, genser->link_num, &Jfwd, &T_L_0);\n if (GO_RESULT_OK != retval)\n return retval;\n retval = compute_jinv(&Jfwd, &Jinv);\n if (GO_RESULT_OK != retval)\n return retval;\n\n vw[0] = vel->v.x;\n vw[1] = vel->v.y;\n vw[2] = vel->v.z;\n vw[3] = vel->w.x;\n vw[4] = vel->w.y;\n vw[5] = vel->w.z;\n\n return go_matrix_vector_mult(&Jinv, vw, jointvels);\n}\n\nint genser_kin_jac_fwd(void *kins,\n const go_real * joints,\n const go_real * jointvels, const go_pose * pos, go_screw * vel)\n{\n genser_struct *genser = (genser_struct *) kins;\n GO_MATRIX_DECLARE(Jfwd, Jfwd_stg, 6, GENSER_MAX_JOINTS);\n go_pose T_L_0;\n go_link linkout[GENSER_MAX_JOINTS];\n go_real vw[6];\n int link;\n int retval;\n\n go_matrix_init(Jfwd, Jfwd_stg, 6, genser->link_num);\n\n for (link = 0; link < genser->link_num; link++) {\n retval =\n go_link_joint_set(&genser->links[link], joints[link],\n &linkout[link]);\n if (GO_RESULT_OK != retval)\n return retval;\n }\n\n retval = compute_jfwd(linkout, genser->link_num, &Jfwd, &T_L_0);\n if (GO_RESULT_OK != retval)\n return retval;\n\n go_matrix_vector_mult(&Jfwd, jointvels, vw);\n vel->v.x = vw[0];\n vel->v.y = vw[1];\n vel->v.z = vw[2];\n vel->w.x = vw[3];\n vel->w.y = vw[4];\n vel->w.z = vw[5];\n\n return GO_RESULT_OK;\n}\n\n/* main function called by emc2 for forward Kins */\nint genserKinematicsForward(const double *joint,\n EmcPose * world,\n const KINEMATICS_FORWARD_FLAGS * fflags,\n KINEMATICS_INVERSE_FLAGS * iflags) {\n\n go_pose *pos;\n go_rpy rpy;\n go_real jcopy[GENSER_MAX_JOINTS]; // will hold the radian conversion of joints\n int ret = 0;\n int i, changed=0;\n if (!genser_hal_inited) {\n rtapi_print_msg(RTAPI_MSG_ERR,\n \"genserKinematicsForward: not initialized\\n\");\n return -1;\n }\n\n for (i=0; i< 6; i++) {\n // FIXME - debug hack\n if (!GO_ROT_CLOSE(j[i],joint[i])) changed = 1;\n // convert to radians to pass to genser_kin_fwd\n jcopy[i] = joint[i] * PM_PI / 180;\n if ((i) && *(haldata->unrotate[i]))\n jcopy[i] -= *(haldata->unrotate[i])*jcopy[i-1];\n }\n\n if (changed) {\n for (i=0; i< 6; i++)\n j[i] = joint[i];\n // rtapi_print(\"genserKinematicsForward(joints: %f %f %f %f %f %f)\\n\",\n //joint[0],joint[1],joint[2],joint[3],joint[4],joint[5]);\n }\n // AJ: convert from emc2 coords (XYZABC - which are actually rpy euler\n // angles)\n // to go angles (quaternions)\n pos = haldata->pos;\n rpy.y = world->c * PM_PI / 180;\n rpy.p = world->b * PM_PI / 180;\n rpy.r = world->a * PM_PI / 180;\n\n go_rpy_quat_convert(&rpy, &pos->rot);\n pos->tran.x = world->tran.x;\n pos->tran.y = world->tran.y;\n pos->tran.z = world->tran.z;\n\n //pass through unused 678 as uvw\n if (total_joints > 6) world->u = joint[6];\n if (total_joints > 7) world->v = joint[7];\n if (total_joints > 8) world->w = joint[8];\n\n // pos will be the world location\n // jcopy: joitn position in radians\n ret = genser_kin_fwd(KINS_PTR, jcopy, pos);\n if (ret < 0)\n return ret;\n\n // AJ: convert back to emc2 coords\n ret = go_quat_rpy_convert(&pos->rot, &rpy);\n if (ret < 0)\n return ret;\n world->tran.x = pos->tran.x;\n world->tran.y = pos->tran.y;\n world->tran.z = pos->tran.z;\n world->a = rpy.r * 180 / PM_PI;\n world->b = rpy.p * 180 / PM_PI;\n world->c = rpy.y * 180 / PM_PI;\n\n if (changed) {\n// rtapi_print(\"genserKinematicsForward(world: %f %f %f %f %f %f)\\n\", world->tran.x, world->tran.y, world->tran.z, world->a, world->b, world->c);\n }\n return 0;\n}\n\nint genser_kin_fwd(void *kins, const go_real * joints, go_pose * pos)\n{\n genser_struct *genser = kins;\n go_link linkout[GENSER_MAX_JOINTS];\n\n int link;\n int retval;\n\n genser_kin_init();\n\n for (link = 0; link < genser->link_num; link++) {\n retval = go_link_joint_set(&genser->links[link], joints[link], &linkout[link]);\n if (GO_RESULT_OK != retval)\n return retval;\n }\n\n retval = go_link_pose_build(linkout, genser->link_num, pos);\n if (GO_RESULT_OK != retval)\n return retval;\n\n return GO_RESULT_OK;\n}\n\nint genserKinematicsInverse(const EmcPose * world,\n double *joints,\n const KINEMATICS_INVERSE_FLAGS * iflags,\n KINEMATICS_FORWARD_FLAGS * fflags)\n{\n\n genser_struct *genser = KINS_PTR;\n GO_MATRIX_DECLARE(Jfwd, Jfwd_stg, 6, GENSER_MAX_JOINTS);\n GO_MATRIX_DECLARE(Jinv, Jinv_stg, GENSER_MAX_JOINTS, 6);\n go_pose T_L_0;\n go_real dvw[6];\n go_real jest[GENSER_MAX_JOINTS];\n go_real dj[GENSER_MAX_JOINTS];\n go_pose pest, pestinv, Tdelta; // pos = converted pose from EmcPose\n go_rpy rpy;\n go_rvec rvec;\n go_cart cart;\n go_link linkout[GENSER_MAX_JOINTS];\n int link;\n int smalls;\n int retval;\n\n // rtapi_print(\"kineInverse(joints: %f %f %f %f %f %f)\\n\",\n // joints[0],joints[1],joints[2],joints[3],joints[4],joints[5]);\n // rtapi_print(\"kineInverse(world: %f %f %f %f %f %f)\\n\",\n // world->tran.x, world->tran.y, world->tran.z, world->a, world->b, world->c);\n\n#ifndef ULAPI\n genser_kin_init();\n if (!genser_hal_inited) {\n rtapi_print_msg(RTAPI_MSG_ERR,\n \"genserKinematicsInverse: not initialized\\n\");\n return -1;\n }\n#endif\n\n // FIXME-AJ: rpy or zyx ?\n rpy.y = world->c * PM_PI / 180;\n rpy.p = world->b * PM_PI / 180;\n rpy.r = world->a * PM_PI / 180;\n\n go_rpy_quat_convert(&rpy, &haldata->pos->rot);\n haldata->pos->tran.x = world->tran.x;\n haldata->pos->tran.y = world->tran.y;\n haldata->pos->tran.z = world->tran.z;\n\n go_matrix_init(Jfwd, Jfwd_stg, 6, genser->link_num);\n go_matrix_init(Jinv, Jinv_stg, genser->link_num, 6);\n\n /* jest[] is a copy of joints[], which is the joint estimate */\n for (link = 0; link < genser->link_num; link++) {\n // jest, and the rest of joint related calcs are in radians\n jest[link] = joints[link] * (PM_PI / 180);\n }\n\n for (genser->iterations = 0;\n genser->iterations < *haldata->max_iterations;\n genser->iterations++) {\n *(haldata->last_iterations) = genser->iterations;\n /* update the Jacobians */\n for (link = 0; link < genser->link_num; link++) {\n go_link_joint_set(&genser->links[link], jest[link], &linkout[link]);\n }\n retval = compute_jfwd(linkout, genser->link_num, &Jfwd, &T_L_0);\n if (GO_RESULT_OK != retval) {\n rtapi_print(\"ERR kI - compute_jfwd (joints: %f %f %f %f %f %f), (iterations=%d)\\n\",\n joints[0],joints[1],joints[2],joints[3],joints[4],joints[5], genser->iterations);\n return retval;\n }\n retval = compute_jinv(&Jfwd, &Jinv);\n if (GO_RESULT_OK != retval) {\n rtapi_print(\"ERR kI - compute_jinv (joints: %f %f %f %f %f %f), (iterations=%d)\\n\",\n joints[0],joints[1],joints[2],joints[3],joints[4],joints[5], genser->iterations);\n return retval;\n }\n\n /* pest is the resulting pose estimate given joint estimate */\n genser_kin_fwd(KINS_PTR, jest, &pest);\n //printf(\"jest: %f %f %f %f %f %f\\n\",jest[0],jest[1],jest[2],jest[3],jest[4],jest[5]);\n /* pestinv is its inverse */\n go_pose_inv(&pest, &pestinv);\n /*\n Tdelta is the incremental pose from pest to pos, such that\n\n 0 L 0\n . pest * Tdelta = pos, or\n L L L\n\n L L 0\n .Tdelta = pestinv * pos\n L 0 L\n */\n go_pose_pose_mult(&pestinv, haldata->pos, &Tdelta);\n\n /*\n We need Tdelta in 0 frame, not pest frame, so rotate it\n back. Since it's effectively a velocity, we just rotate it, and\n don't translate it.\n */\n\n /* first rotate the translation differential */\n go_quat_cart_mult(&pest.rot, &Tdelta.tran, &cart);\n dvw[0] = cart.x;\n dvw[1] = cart.y;\n dvw[2] = cart.z;\n\n /* to rotate the rotation differential, convert it to a\n velocity screw and rotate that */\n go_quat_rvec_convert(&Tdelta.rot, &rvec);\n cart.x = rvec.x;\n cart.y = rvec.y;\n cart.z = rvec.z;\n go_quat_cart_mult(&pest.rot, &cart, &cart);\n dvw[3] = cart.x;\n dvw[4] = cart.y;\n dvw[5] = cart.z;\n\n /* push the Cartesian velocity vector through the inverse Jacobian */\n go_matrix_vector_mult(&Jinv, dvw, dj);\n\n //pass through 678 as uvw\n if (total_joints > 6) joints[6] = world->u;\n if (total_joints > 7) joints[7] = world->v;\n if (total_joints > 8) joints[8] = world->w;\n\n /* check for small joint increments, if so we're done */\n for (link = 0, smalls = 0; link < genser->link_num; link++) {\n if (GO_QUANTITY_LENGTH == linkout[link].quantity) {\n if (GO_TRAN_SMALL(dj[link]))\n smalls++;\n } else {\n if (GO_ROT_SMALL(dj[link]))\n smalls++;\n }\n }\n if (smalls == genser->link_num) {\n /* converged, copy jest[] out */\n for (link = 0; link < genser->link_num; link++) {\n // convert from radians back to angles\n joints[link] = jest[link] * 180 / PM_PI;\n if ((link) && *(haldata->unrotate[link]))\n joints[link] += *(haldata->unrotate[link]) * joints[link-1];\n }\n //rtapi_print(\"DONEkineInverse(joints: %f %f %f %f %f %f), (iterations=%d)\\n\",\n // joints[0],joints[1],joints[2],joints[3],joints[4],joints[5], genser->iterations);\n //rtapi_print(\"OKkineInverse: %.2f %.2f %.2f %.2f %.2f %.2f)\\n\",\n // world->tran.x, world->tran.y, world->tran.z, world->a, world->b, world->c);\n return GO_RESULT_OK;\n }\n /* else keep iterating */\n for (link = 0; link < genser->link_num; link++) {\n jest[link] += dj[link]; //still in radians\n }\n } /* for (iterations) */\n\n rtapi_print(\"ERRkineInverse(joints: %f %f %f %f %f %f), (iterations=%d)\\n\",\n joints[0],joints[1],joints[2],joints[3],joints[4],joints[5], genser->iterations);\n return GO_RESULT_ERROR;\n}\n\n/*\n Extras, not callable using go_kin_ wrapper but if you know you have\n linked in these kinematics, go ahead and call these for your ad hoc\n purposes.\n*/\n\nint genser_kin_inv_iterations(genser_struct * genser)\n{\n return genser->iterations;\n}\n\nint genser_kin_inv_set_max_iterations(int i)\n{\n if (i <= 0) return GO_RESULT_ERROR;\n *haldata->max_iterations = i;\n return GO_RESULT_OK;\n}\n\nint genser_kin_inv_get_max_iterations()\n{\n return *haldata->max_iterations;\n}\n\nint genserKinematicsSetup(const int comp_id,\n const char* coordinates,\n kparms* kp)\n{\n int i,res=0;\n haldata = hal_malloc(sizeof(struct haldata));\n if (!haldata) {goto error;}\n\n // allow for pass through joints 6,7,8 u,v,w\n total_joints = kp->max_joints;\n\n // only the first 6 joints have A,ALPHA,D,unrotate pins\n for (i = 0; i < 6; i++) {\n res += hal_pin_float_newf(HAL_IN, &(haldata->a[i]), comp_id,\n \"%s.A-%d\", kp->halprefix, i);\n *(haldata->a[i])=0;\n res += hal_pin_float_newf(HAL_IN, &(haldata->alpha[i]), comp_id,\n \"%s.ALPHA-%d\", kp->halprefix, i);\n *(haldata->alpha[i])=0;\n res += hal_pin_float_newf(HAL_IN, &(haldata->d[i]), comp_id,\n \"%s.D-%d\", kp->halprefix, i);\n *(haldata->d[i])=0;\n res += hal_pin_s32_newf(HAL_IN, &(haldata->unrotate[i]), comp_id,\n \"%s.unrotate-%d\", kp->halprefix, i);\n *haldata->unrotate[i]=0;\n }\n res += hal_pin_u32_newf(HAL_OUT, &(haldata->last_iterations), comp_id,\n \"%s.last-iterations\",kp->halprefix);\n\n KINS_PTR = hal_malloc(sizeof(genser_struct));\n haldata->pos = (go_pose *) hal_malloc(sizeof(go_pose));\n if (KINS_PTR == NULL) {goto error;}\n if (haldata->pos == NULL) {goto error;}\n res += hal_pin_u32_newf(HAL_IN, &haldata->max_iterations, comp_id,\n \"%s.max-iterations\",kp->halprefix);\n\n if (res) {goto error;}\n\n *haldata->max_iterations = GENSER_DEFAULT_MAX_ITERATIONS;\n\n A(0) = DEFAULT_A1;\n A(1) = DEFAULT_A2;\n A(2) = DEFAULT_A3;\n A(3) = DEFAULT_A4;\n A(4) = DEFAULT_A5;\n A(5) = DEFAULT_A6;\n ALPHA(0) = DEFAULT_ALPHA1;\n ALPHA(1) = DEFAULT_ALPHA2;\n ALPHA(2) = DEFAULT_ALPHA3;\n ALPHA(3) = DEFAULT_ALPHA4;\n ALPHA(4) = DEFAULT_ALPHA5;\n ALPHA(5) = DEFAULT_ALPHA6;\n D(0) = DEFAULT_D1;\n D(1) = DEFAULT_D2;\n D(2) = DEFAULT_D3;\n D(3) = DEFAULT_D4;\n D(4) = DEFAULT_D5;\n D(5) = DEFAULT_D6;\n\n genser_hal_inited = 1;\n return 0;\n\nerror:\n return -1;\n} // genserKinematicsSetup()\n"} {"id": "linuxcnc-source:src/emc/kinematics/lineardeltakins.c", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/kinematics/lineardeltakins.c", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/kinematics/lineardeltakins.c", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "792caf5f3fb8bf06d97a4bb7262697ac22182d78d91fed19e7a9e537585aa748", "bytes": 2489, "tokens": 913, "text": "// Copyright 2013 Jeff Epler \n//\n// This program is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n#include \"hal.h\"\n#include \"kinematics.h\"\n#include \"rtapi_math.h\"\n#include \"rtapi_app.h\"\n\n#include \"lineardeltakins-common.h\"\n\nstruct haldata\n{\n hal_float_t *r, *l;\n} *haldata;\n\nint comp_id;\n\nint kinematicsForward(const double * joints,\n EmcPose * pos,\n const KINEMATICS_FORWARD_FLAGS * fflags,\n KINEMATICS_INVERSE_FLAGS * iflags) {\n set_geometry(*haldata->r, *haldata->l);\n return kinematics_forward(joints, pos);\n}\n\nint kinematicsInverse(const EmcPose *pos, double *joints,\n const KINEMATICS_INVERSE_FLAGS *iflags,\n KINEMATICS_FORWARD_FLAGS *fflags) {\n set_geometry(*haldata->r, *haldata->l);\n return kinematics_inverse(pos, joints);\n}\n\nKINEMATICS_TYPE kinematicsType()\n{\n return KINEMATICS_BOTH;\n}\n\nint rtapi_app_main(void)\n{\n int retval = 0;\n\n comp_id = hal_init(\"lineardeltakins\");\n if(comp_id < 0) retval = comp_id;\n\n if(retval == 0)\n {\n haldata = hal_malloc(sizeof(struct haldata));\n retval = !haldata;\n }\n\n if(retval == 0)\n retval = hal_pin_float_newf(HAL_IN, &haldata->r, comp_id,\n \"lineardeltakins.R\");\n if(retval == 0)\n retval = hal_pin_float_newf(HAL_IN, &haldata->l, comp_id,\n \"lineardeltakins.L\");\n\n if(retval == 0)\n {\n *haldata->r = DELTA_RADIUS;\n *haldata->l = DELTA_DIAGONAL_ROD;\n }\n\n if(retval == 0)\n {\n hal_ready(comp_id);\n }\n\n return retval;\n}\n\nvoid rtapi_app_exit(void)\n{\n hal_exit(comp_id);\n}\n\nKINS_NOT_SWITCHABLE\nEXPORT_SYMBOL(kinematicsType);\nEXPORT_SYMBOL(kinematicsForward);\nEXPORT_SYMBOL(kinematicsInverse);\nMODULE_LICENSE(\"GPL\");\n"} {"id": "linuxcnc-source:src/emc/kinematics/rosekins.c", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/kinematics/rosekins.c", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/kinematics/rosekins.c", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "1de39affa6b99f21c5e902fc67c8b1d8876d44fc8eff920afd816d7f956cfd78", "bytes": 3839, "tokens": 1385, "text": "/*\n Copyright 2016 Dewey Garrett \n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 2 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program; if not, write to the Free Software\n Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n*/\n\n#include \"kinematics.h\"\n#include \"posemath.h\"\n#include \"hal.h\"\n#include \"rtapi.h\"\n#include \"rtapi_math.h\"\n#include \"rtapi_app.h\"\n\nKINS_NOT_SWITCHABLE\nEXPORT_SYMBOL(kinematicsType);\nEXPORT_SYMBOL(kinematicsInverse);\nEXPORT_SYMBOL(kinematicsForward);\nMODULE_LICENSE(\"GPL\");\n\n#ifndef hypot\n#define hypot(a,b) (sqrt((a)*(a)+(b)*(b)))\n#endif\n\nstruct haldata {\n hal_float_t *revolutions;\n hal_float_t *theta_degrees;\n hal_float_t *bigtheta_degrees;\n} *haldata;\n\nint kinematicsForward(const double *joints,\n EmcPose * pos,\n const KINEMATICS_FORWARD_FLAGS * fflags,\n KINEMATICS_INVERSE_FLAGS * iflags)\n{\n double radius,z,theta;\n\n radius = joints[0];\n z = joints[1];\n theta = TO_RAD * joints[2];\n\n pos->tran.x = radius * cos(theta);\n pos->tran.y = radius * sin(theta);\n pos->tran.z = z;\n pos->a = 0;\n pos->b = 0;\n pos->c = 0;\n pos->u = 0;\n pos->v = 0;\n pos->w = 0;\n\n return 0;\n}\n\nint kinematicsInverse(const EmcPose * pos,\n double *joints,\n const KINEMATICS_INVERSE_FLAGS * iflags,\n KINEMATICS_FORWARD_FLAGS * fflags)\n{\n// There is a potential problem when accumulating bigtheta -- loss of\n// precision based on size of mantissa -- but in practice, it is probably ok\n\n static int oldquad;\n static int revolutions;\n\n double theta,bigtheta;\n int nowquad = 0;\n double x = pos->tran.x;\n double y = pos->tran.y;\n double z = pos->tran.z;\n\n if (x >= 0 && y >= 0) nowquad = 1;\n else if (x < 0 && y >= 0) nowquad = 2;\n else if (x < 0 && y < 0) nowquad = 3;\n else if (x >= 0 && y < 0) nowquad = 4;\n\n if (oldquad == 2 && nowquad == 3) {revolutions += 1;}\n if (oldquad == 3 && nowquad == 2) {revolutions -= 1;}\n\n theta = atan2(y,x);\n bigtheta = theta + PM_2_PI * revolutions;\n\n *(haldata->revolutions) = revolutions;\n *(haldata->theta_degrees) = theta * TO_DEG;\n *(haldata->bigtheta_degrees) = bigtheta * TO_DEG;\n\n joints[0] = hypot(x,y);\n joints[1] = z;\n joints[2] = TO_DEG * bigtheta;\n joints[3] = 0;\n joints[4] = 0;\n joints[5] = 0;\n joints[6] = 0;\n joints[7] = 0;\n joints[8] = 0;\n\n oldquad = nowquad;\n return 0;\n}\n\nKINEMATICS_TYPE kinematicsType()\n{\n return KINEMATICS_BOTH;\n}\n\nstatic int comp_id;\n\nvoid rtapi_app_exit(void) { hal_exit(comp_id); }\n\nint rtapi_app_main(void) {\n int ans;\n comp_id = hal_init(\"rosekins\");\n if(comp_id < 0) return comp_id;\n\n haldata = hal_malloc(sizeof(struct haldata));\n\n if((ans = hal_pin_float_new(\"rosekins.revolutions\",\n HAL_OUT, &(haldata->revolutions), comp_id)) < 0) goto error;\n if((ans = hal_pin_float_new(\"rosekins.theta_degrees\",\n HAL_OUT, &(haldata->theta_degrees), comp_id)) < 0) goto error;\n if((ans = hal_pin_float_new(\"rosekins.bigtheta_degrees\",\n HAL_OUT, &(haldata->bigtheta_degrees), comp_id)) < 0) goto error;\n\n hal_ready(comp_id);\n return 0;\n\nerror:\n return ans;\n}\n"} {"id": "linuxcnc-source:src/emc/kinematics/xyzbc-trt-kins.c", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/kinematics/xyzbc-trt-kins.c", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/kinematics/xyzbc-trt-kins.c", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "d79c06db82930ef685809a87c7207398f7893f56a6a0dfe382df2c81eaeb9562", "bytes": 1896, "tokens": 712, "text": "/********************************************************************\n* xyzbc-trt-kins.c employing switchkins.[ch]\n* License: GPL Version 2\n*\n* NOTEs:\n* 1) specify all kparms items\n* 2) specify 3 KS,KF,KI functions for switchkins_type=0,1,2\n* 3) the 0th switchkins_type is the startup default\n* 4) sparm is a module string parameter for configuration\n* 5) The directions of the rotational axes are the opposite of the \n* conventional axis directions.\n*/\n\n#include \"motion.h\"\n#include \"switchkins.h\"\n#include \"rtapi_string.h\"\n#include \"rtapi.h\"\n\nint switchkinsSetup(kparms* kp,\n KS* kset0, KS* kset1, KS* kset2,\n KF* kfwd0, KF* kfwd1, KF* kfwd2,\n KI* kinv0, KI* kinv1, KI* kinv2\n )\n{\n kp->kinsname = \"xyzbc-trt-kins\"; // !!! must agree with filename\n kp->halprefix = \"xyzbc-trt-kins\"; // hal pin names\n kp->required_coordinates = \"xyzbc\";\n kp->allow_duplicates = 1;\n kp->max_joints = EMCMOT_MAX_JOINTS;\n\n if (kp->sparm && strstr(kp->sparm,\"identityfirst\")) {\n rtapi_print(\"\\n!!! switchkins-type 0 is IDENTITY\\n\");\n *kset0 = identityKinematicsSetup;\n *kfwd0 = identityKinematicsForward;\n *kinv0 = identityKinematicsInverse;\n\n *kset1 = trtKinematicsSetup; // trt: xyzac,xyzbc\n *kfwd1 = xyzbcKinematicsForward;\n *kinv1 = xyzbcKinematicsInverse;\n } else {\n rtapi_print(\"\\n!!! switchkins-type 0 is %s\\n\",kp->kinsname);\n *kset0 = trtKinematicsSetup; // trt: xyzac,xyzbc\n *kfwd0 = xyzbcKinematicsForward;\n *kinv0 = xyzbcKinematicsInverse;\n\n *kset1 = identityKinematicsSetup;\n *kfwd1 = identityKinematicsForward;\n *kinv1 = identityKinematicsInverse;\n }\n\n *kset2 = userkKinematicsSetup;\n *kfwd2 = userkKinematicsForward;\n *kinv2 = userkKinematicsInverse;\n\n return 0;\n}\n"} {"id": "linuxcnc-source:src/emc/motion/axis.c", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/motion/axis.c", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/motion/axis.c", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "5c3fe99e672a72cc81c2ce74e36e225ff9e10a115c51f46729b135fd134922d8", "bytes": 23244, "tokens": 8920, "text": "#include \"axis.h\"\n#include \"emcmotcfg.h\" // EMCMOT_MAX_AXIS\n#include \"rtapi.h\"\n#include \"rtapi_math.h\"\n#include \"simple_tp.h\"\n\ntypedef struct {\n double pos_cmd; /* commanded axis position */\n double teleop_vel_cmd; /* commanded axis velocity */\n double max_pos_limit; /* upper soft limit on axis pos */\n double min_pos_limit; /* lower soft limit on axis pos */\n double vel_limit; /* upper limit of axis speed */\n double acc_limit; /* upper limit of axis accel */\n simple_tp_t teleop_tp; /* planner for teleop mode motion */\n\n int old_ajog_counts; /* prior value, used for deltas */\n int kb_ajog_active; /* non-zero during a keyboard jog */\n int wheel_ajog_active; /* non-zero during a wheel jog */\n int locking_joint; /* locking_joint number, -1 ==> notused */\n\n double ext_offset_vel_limit; /* upper limit of axis speed for ext offset */\n double ext_offset_acc_limit; /* upper limit of axis accel for ext offset */\n int old_eoffset_counts;\n simple_tp_t ext_offset_tp; /* planner for external coordinate offsets*/\n} emcmot_axis_t;\n\ntypedef struct {\n hal_float_t *pos_cmd; /* RPI: commanded position */\n hal_float_t *teleop_vel_cmd; /* RPI: commanded velocity */\n hal_float_t *teleop_pos_cmd; /* RPI: teleop traj planner pos cmd */\n hal_float_t *teleop_vel_lim; /* RPI: teleop traj planner vel limit */\n hal_bit_t *teleop_tp_enable; /* RPI: teleop traj planner is running */\n\n hal_s32_t *ajog_counts; /* WPI: jogwheel position input */\n hal_bit_t *ajog_enable; /* RPI: enable jogwheel */\n hal_float_t *ajog_scale; /* RPI: distance to jog on each count */\n hal_float_t *ajog_accel_fraction; /* RPI: to limit wheel jog accel */\n hal_bit_t *ajog_vel_mode; /* RPI: true for \"velocity mode\" jogwheel */\n hal_bit_t *kb_ajog_active; /* RPI: executing keyboard jog */\n hal_bit_t *wheel_ajog_active; /* RPI: executing handwheel jog */\n\n hal_bit_t *eoffset_enable;\n hal_bit_t *eoffset_clear;\n hal_s32_t *eoffset_counts;\n hal_float_t *eoffset_scale;\n hal_float_t *external_offset;\n hal_float_t *external_offset_requested;\n} axis_hal_t;\n\n\ntypedef struct {\n axis_hal_t axis[EMCMOT_MAX_AXIS]; /* data for each axis */\n} axis_hal_data_t;\n\nstatic emcmot_axis_t axis_array[EMCMOT_MAX_AXIS];\nstatic axis_hal_data_t *hal_data = NULL;\n\n\n// Mark strings for translation, but defer translation to userspace\n#define _(s) (s)\n\nvoid axis_init_all(void)\n{\n int n;\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n emcmot_axis_t *axis = &axis_array[n];\n axis->locking_joint = -1;\n }\n}\n\nvoid axis_initialize_external_offsets(void)\n{\n int n;\n axis_hal_t *axis_data;\n\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n axis_data = &hal_data->axis[n];\n\n *(axis_data->external_offset) = 0;\n *(axis_data->external_offset_requested) = 0;\n axis_array[n].ext_offset_tp.pos_cmd = 0;\n axis_array[n].ext_offset_tp.curr_pos = 0;\n axis_array[n].ext_offset_tp.curr_vel = 0;\n }\n}\n\n#define CALL_CHECK(expr) do { \\\n int _retval; \\\n _retval = expr; \\\n if (_retval) return _retval; \\\n } while (0);\n\nstatic int export_axis(int mot_comp_id, char c, axis_hal_t * addr)\n{\n int msg;\n\n msg = rtapi_get_msg_level();\n rtapi_set_msg_level(RTAPI_MSG_WARN);\n\n CALL_CHECK(hal_pin_bit_newf(HAL_IN, &(addr->ajog_enable), mot_comp_id,\"axis.%c.jog-enable\", c));\n CALL_CHECK(hal_pin_float_newf(HAL_IN, &(addr->ajog_scale), mot_comp_id,\"axis.%c.jog-scale\", c));\n CALL_CHECK(hal_pin_s32_newf(HAL_IN, &(addr->ajog_counts), mot_comp_id,\"axis.%c.jog-counts\", c));\n CALL_CHECK(hal_pin_bit_newf(HAL_IN, &(addr->ajog_vel_mode), mot_comp_id,\"axis.%c.jog-vel-mode\", c));\n CALL_CHECK(hal_pin_bit_newf(HAL_OUT, &(addr->kb_ajog_active), mot_comp_id,\"axis.%c.kb-jog-active\", c));\n CALL_CHECK(hal_pin_bit_newf(HAL_OUT, &(addr->wheel_ajog_active), mot_comp_id,\"axis.%c.wheel-jog-active\", c));\n\n CALL_CHECK(hal_pin_float_newf(HAL_IN,&(addr->ajog_accel_fraction), mot_comp_id,\"axis.%c.jog-accel-fraction\", c));\n *addr->ajog_accel_fraction = 1.0; // fraction of accel for wheel ajogs\n\n rtapi_set_msg_level(msg);\n return 0;\n}\n\nint axis_init_hal_io(int mot_comp_id)\n{\n int n, retval;\n\n hal_data = hal_malloc(sizeof(axis_hal_data_t));\n if (!hal_data) {\n rtapi_print_msg(RTAPI_MSG_ERR, _(\"MOTION: axis_hal_data hal_malloc() failed\\n\"));\n return -1;\n }\n\n // export axis pins and parameters\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n char c = \"xyzabcuvw\"[n];\n axis_hal_t *axis_data = &(hal_data->axis[n]);\n CALL_CHECK(hal_pin_float_newf(HAL_OUT, &axis_data->pos_cmd, mot_comp_id, \"axis.%c.pos-cmd\", c));\n CALL_CHECK(hal_pin_float_newf(HAL_OUT, &axis_data->teleop_vel_cmd, mot_comp_id, \"axis.%c.teleop-vel-cmd\", c));\n CALL_CHECK(hal_pin_float_newf(HAL_OUT, &axis_data->teleop_pos_cmd, mot_comp_id, \"axis.%c.teleop-pos-cmd\", c));\n CALL_CHECK(hal_pin_float_newf(HAL_OUT, &axis_data->teleop_vel_lim, mot_comp_id, \"axis.%c.teleop-vel-lim\", c));\n CALL_CHECK(hal_pin_bit_newf(HAL_OUT, &axis_data->teleop_tp_enable, mot_comp_id, \"axis.%c.teleop-tp-enable\",c));\n CALL_CHECK(hal_pin_bit_newf(HAL_IN, &axis_data->eoffset_enable, mot_comp_id, \"axis.%c.eoffset-enable\", c));\n CALL_CHECK(hal_pin_bit_newf(HAL_IN, &axis_data->eoffset_clear, mot_comp_id, \"axis.%c.eoffset-clear\", c));\n CALL_CHECK(hal_pin_s32_newf(HAL_IN, &axis_data->eoffset_counts, mot_comp_id, \"axis.%c.eoffset-counts\", c));\n CALL_CHECK(hal_pin_float_newf(HAL_IN, &axis_data->eoffset_scale, mot_comp_id, \"axis.%c.eoffset-scale\", c));\n CALL_CHECK(hal_pin_float_newf(HAL_OUT, &axis_data->external_offset, mot_comp_id, \"axis.%c.eoffset\", c));\n CALL_CHECK(hal_pin_float_newf(HAL_OUT, &axis_data->external_offset_requested,\n mot_comp_id, \"axis.%c.eoffset-request\", c));\n\n retval = export_axis(mot_comp_id, c, axis_data);\n if (retval) {\n rtapi_print_msg(RTAPI_MSG_ERR, _(\"MOTION: axis %c pin/param export failed\\n\"), c);\n return -1;\n }\n }\n\n return 0;\n}\n\nvoid axis_output_to_hal(double *pcmd_p[])\n{\n int n;\n\n // output axis info to HAL for scoping, etc\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n emcmot_axis_t *axis = &axis_array[n];\n axis_hal_t *axis_data = &hal_data->axis[n];\n *(axis_data->teleop_vel_cmd) = axis->teleop_vel_cmd;\n *(axis_data->teleop_pos_cmd) = axis->teleop_tp.pos_cmd;\n *(axis_data->teleop_vel_lim) = axis->teleop_tp.max_vel;\n *(axis_data->teleop_tp_enable) = axis->teleop_tp.enable;\n *(axis_data->kb_ajog_active) = axis->kb_ajog_active;\n *(axis_data->wheel_ajog_active) = axis->wheel_ajog_active;\n\n // hal pins: axis.L.pos-cmd reported without applied offsets:\n *(axis_data->pos_cmd) = *pcmd_p[n]\n - axis->ext_offset_tp.curr_pos;\n }\n}\n\nvoid axis_set_max_pos_limit(int axis_num, double maxLimit)\n{\n axis_array[axis_num].max_pos_limit = maxLimit;\n}\n\nvoid axis_set_min_pos_limit(int axis_num, double minLimit)\n{\n axis_array[axis_num].min_pos_limit = minLimit;\n}\n\nvoid axis_set_vel_limit(int axis_num, double vel)\n{\n axis_array[axis_num].vel_limit = vel;\n}\n\nvoid axis_set_acc_limit(int axis_num, double acc)\n{\n axis_array[axis_num].acc_limit = acc;\n}\n\nvoid axis_set_ext_offset_vel_limit(int axis_num, double vel)\n{\n axis_array[axis_num].ext_offset_vel_limit = vel;\n}\n\nvoid axis_set_ext_offset_acc_limit(int axis_num, double acc)\n{\n axis_array[axis_num].ext_offset_acc_limit = acc;\n}\n\nvoid axis_set_locking_joint(int axis_num, int joint)\n{\n axis_array[axis_num].locking_joint = joint;\n}\n\n\ndouble axis_get_min_pos_limit(int axis_num)\n{\n return axis_array[axis_num].min_pos_limit;\n}\n\ndouble axis_get_max_pos_limit(int axis_num)\n{\n return axis_array[axis_num].max_pos_limit;\n}\n\ndouble axis_get_vel_limit(int axis_num)\n{\n return axis_array[axis_num].vel_limit;\n}\n\ndouble axis_get_acc_limit(int axis_num)\n{\n return axis_array[axis_num].acc_limit;\n}\n\ndouble axis_get_teleop_vel_cmd(int axis_num)\n{\n return axis_array[axis_num].teleop_vel_cmd;\n}\n\nint axis_get_locking_joint(int axis_num)\n{\n return axis_array[axis_num].locking_joint;\n}\n\ndouble axis_get_compound_velocity(void)\n{\n double v2 = 0.0;\n int n;\n\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n emcmot_axis_t *axis = &axis_array[n];\n if (axis->teleop_tp.active) {\n v2 += axis->teleop_vel_cmd * axis->teleop_vel_cmd;\n }\n }\n\n if (v2 > 0.0)\n return sqrt(v2);\n return 0.0;\n}\n\ndouble axis_get_ext_offset_curr_pos(int axis_num)\n{\n return axis_array[axis_num].ext_offset_tp.curr_pos;\n}\n\n\nvoid axis_jog_cont(int axis_num, double vel, long servo_period)\n{\n emcmot_axis_t *axis = &axis_array[axis_num];\n\n if (vel > 0.0) {\n axis->teleop_tp.pos_cmd = axis->max_pos_limit;\n } else {\n axis->teleop_tp.pos_cmd = axis->min_pos_limit;\n }\n\n axis->teleop_tp.max_vel = fabs(vel);\n axis->teleop_tp.max_acc = axis->acc_limit;\n axis->kb_ajog_active = 1;\n axis->teleop_tp.enable = 1;\n}\n\nvoid axis_jog_incr(int axis_num, double offset, double vel, long servo_period)\n{\n emcmot_axis_t *axis = &axis_array[axis_num];\n double tmp1;\n\n if (vel > 0.0) {\n tmp1 = axis->teleop_tp.pos_cmd + offset;\n } else {\n tmp1 = axis->teleop_tp.pos_cmd - offset;\n }\n\n if (tmp1 > axis->max_pos_limit) { return; }\n if (tmp1 < axis->min_pos_limit) { return; }\n\n axis->teleop_tp.pos_cmd = tmp1;\n axis->teleop_tp.max_vel = fabs(vel);\n axis->teleop_tp.max_acc = axis->acc_limit;\n axis->kb_ajog_active = 1;\n axis->teleop_tp.enable = 1;\n}\n\nvoid axis_jog_abs(int axis_num, double offset, double vel)\n{\n emcmot_axis_t *axis = &axis_array[axis_num];\n double tmp1;\n\n axis->kb_ajog_active = 1;\n if (axis->wheel_ajog_active) { return; }\n if (vel > 0.0) {\n tmp1 = axis->teleop_tp.pos_cmd + offset;\n } else {\n tmp1 = axis->teleop_tp.pos_cmd - offset;\n }\n if (tmp1 > axis->max_pos_limit) { return; }\n if (tmp1 < axis->min_pos_limit) { return; }\n axis->teleop_tp.pos_cmd = tmp1;\n axis->teleop_tp.max_vel = fabs(vel);\n axis->teleop_tp.max_acc = axis->acc_limit;\n axis->kb_ajog_active = 1;\n axis->teleop_tp.enable = 1;\n}\n\nbool axis_jog_abort(int axis_num, bool immediate)\n{\n bool aborted = 0;\n emcmot_axis_t *axis = &axis_array[axis_num];\n if (axis->teleop_tp.enable) {\n aborted = 1;\n }\n axis->teleop_tp.enable = 0;\n axis->kb_ajog_active = 0;\n axis->wheel_ajog_active = 0;\n if (immediate) {\n axis->teleop_tp.curr_vel = 0.0;\n }\n return aborted;\n}\n\nbool axis_jog_abort_all(bool immediate)\n{\n int n;\n bool aborted = 0;\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n if (axis_jog_abort(n, immediate)) {aborted = 1;}\n }\n return aborted;\n}\n\nbool axis_jog_is_active(void)\n{\n int n;\n emcmot_axis_t *axis;\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n axis = &axis_array[n];\n if (axis->kb_ajog_active || axis->wheel_ajog_active) {\n return 1;\n }\n }\n return 0;\n}\n\nvoid axis_handle_jogwheels(bool motion_teleop_flag, bool motion_enable_flag, bool homing_is_active)\n{\n int axis_num;\n emcmot_axis_t *axis;\n axis_hal_t *axis_data;\n int new_ajog_counts, delta;\n double distance, pos, stop_dist;\n static int first_pass = 1;\t/* used to set initial conditions */\n\n for (axis_num = 0; axis_num < EMCMOT_MAX_AXIS; axis_num++) {\n double aaccel_limit;\n axis = &axis_array[axis_num];\n axis_data = &hal_data->axis[axis_num];\n\n // disallow accel bogus fractions\n if ( (*(axis_data->ajog_accel_fraction) > 1)\n || (*(axis_data->ajog_accel_fraction) < 0) ) {\n aaccel_limit = axis->acc_limit;\n } else {\n aaccel_limit = *(axis_data->ajog_accel_fraction) * axis->acc_limit;\n }\n\n new_ajog_counts = *(axis_data->ajog_counts);\n delta = new_ajog_counts - axis->old_ajog_counts;\n axis->old_ajog_counts = new_ajog_counts;\n if ( first_pass ) { continue; }\n if ( delta == 0 ) {\n //just update counts\n continue;\n }\n if (!motion_teleop_flag) {\n axis->teleop_tp.enable = 0;\n return;\n }\n if (!motion_enable_flag) { continue; }\n if ( *(axis_data->ajog_enable) == 0 ) { continue; }\n if (homing_is_active) { continue; }\n if (axis->kb_ajog_active) { continue; }\n\n if (axis->locking_joint >= 0) {\n rtapi_print_msg(RTAPI_MSG_ERR,\n \"Cannot wheel jog a locking indexer AXIS_%c\\n\",\n \"XYZABCUVW\"[axis_num]);\n continue;\n }\n\n distance = delta * *(axis_data->ajog_scale);\n pos = axis->teleop_tp.pos_cmd + distance;\n if ( *(axis_data->ajog_vel_mode) ) {\n double v = axis->vel_limit;\n /* compute stopping distance at max speed */\n stop_dist = v * v / ( 2 * aaccel_limit);\n /* if commanded position leads the actual position by more\n than stopping distance, discard excess command */\n if ( pos > axis->pos_cmd + stop_dist ) {\n pos = axis->pos_cmd + stop_dist;\n } else if ( pos < axis->pos_cmd - stop_dist ) {\n pos = axis->pos_cmd - stop_dist;\n }\n }\n if (pos > axis->max_pos_limit) { break; }\n if (pos < axis->min_pos_limit) { break; }\n axis->teleop_tp.pos_cmd = pos;\n axis->teleop_tp.max_vel = axis->vel_limit;\n axis->teleop_tp.max_acc = aaccel_limit;\n axis->wheel_ajog_active = 1;\n axis->teleop_tp.enable = 1;\n }\n first_pass = 0;\n}\n\nvoid axis_sync_teleop_tp_to_carte_pos(int extfactor, double *pcmd_p[])\n{\n int n;\n // expect extfactor = -1 || 0 || +1\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n axis_array[n].teleop_tp.curr_pos = *pcmd_p[n]\n + extfactor * axis_array[n].ext_offset_tp.curr_pos;\n }\n}\n\nvoid axis_sync_carte_pos_to_teleop_tp(int extfactor, double *pcmd_p[])\n{\n int n;\n // expect extfactor = -1 || 0 || +1\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n *pcmd_p[n] = axis_array[n].teleop_tp.curr_pos\n + extfactor * axis_array[n].ext_offset_tp.curr_pos;\n }\n}\n\nvoid axis_apply_ext_offsets_to_carte_pos(int extfactor, double *pcmd_p[])\n{\n int n;\n // expect extfactor = -1 || 0 || +1\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n *pcmd_p[n] = *pcmd_p[n]\n + extfactor * axis_array[n].ext_offset_tp.curr_pos;\n }\n}\n\nhal_bit_t axis_plan_external_offsets(double servo_period, bool motion_enable_flag, bool all_homed)\n{\n static int first_pass = 1;\n int n;\n emcmot_axis_t *axis;\n axis_hal_t *axis_data;\n int new_eoffset_counts, delta;\n static int last_eoffset_enable[EMCMOT_MAX_AXIS];\n double ext_offset_epsilon;\n hal_bit_t eoffset_active;\n\n eoffset_active = 0;\n\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n axis = &axis_array[n];\n // coord,teleop updates done in get_pos_cmds()\n axis->ext_offset_tp.max_vel = axis->ext_offset_vel_limit;\n axis->ext_offset_tp.max_acc = axis->ext_offset_acc_limit;\n\n axis_data = &hal_data->axis[n];\n\n new_eoffset_counts = *(axis_data->eoffset_counts);\n delta = new_eoffset_counts - axis->old_eoffset_counts;\n axis->old_eoffset_counts = new_eoffset_counts;\n\n *(axis_data->external_offset) = axis->ext_offset_tp.curr_pos;\n axis->ext_offset_tp.enable = 1;\n if ( first_pass ) {\n *(axis_data->external_offset) = 0;\n continue;\n }\n\n // Use stopping criterion of simple_tp.c:\n ext_offset_epsilon = TINY_DP(axis->ext_offset_tp.max_acc, servo_period);\n if (fabs(*(axis_data->external_offset)) > ext_offset_epsilon) {\n eoffset_active = 1;\n }\n if ( !*(axis_data->eoffset_enable) ) {\n axis->ext_offset_tp.enable = 0;\n // Detect disabling of eoffsets:\n // At very high accel, simple planner may terminate with\n // a larger position value than occurs at more realistic accels.\n if (last_eoffset_enable[n]\n && (fabs(*(axis_data->external_offset)) > ext_offset_epsilon)\n && motion_enable_flag\n && axis->ext_offset_tp.enable) {\n // to stdout only:\n rtapi_print_msg(RTAPI_MSG_NONE,\n \"*** Axis_%c External Offset=%.4g eps=%.4g\\n\"\n \"*** External Offset disabled while NON-zero\\n\"\n \"*** To clear: re-enable & zero or use Machine-Off\\n\",\n \"XYZABCUVW\"[n],\n *(axis_data->external_offset),\n ext_offset_epsilon);\n }\n last_eoffset_enable[n] = 0;\n continue; // Note: if not eoffset_enable\n // then planner disabled and no pos_cmd updates\n // useful for eoffset_pid hold\n }\n last_eoffset_enable[n] = 1;\n if (*(axis_data->eoffset_clear)) {\n axis->ext_offset_tp.pos_cmd = 0;\n *(axis_data->external_offset_requested) = 0;\n continue;\n }\n if (delta == 0) { continue; }\n if (!all_homed) { continue; }\n if (!motion_enable_flag) { continue; }\n\n axis->ext_offset_tp.pos_cmd += delta * *(axis_data->eoffset_scale);\n *(axis_data->external_offset_requested) = axis->ext_offset_tp.pos_cmd;\n } // for n\n first_pass = 0;\n\n return eoffset_active;\n}\n\n/* For each axis, return -1 if over negative limit, 1 if over positive limit,\n or 0 if in range */\nvoid axis_check_constraints(double pos[], int failing_axes[])\n{\n int axis_num;\n double eps = 1e-308;\n\n for (axis_num = 0; axis_num < EMCMOT_MAX_AXIS; axis_num += 1) {\n double nl = axis_array[axis_num].min_pos_limit;\n double pl = axis_array[axis_num].max_pos_limit;\n failing_axes[axis_num] = 0;\n\n if ( (fabs(pos[axis_num]) < eps)\n && (fabs(axis_array[axis_num].min_pos_limit) < eps)\n && (fabs(axis_array[axis_num].max_pos_limit) < eps) ) {\n continue;\n }\n\n if (pos[axis_num] < (nl - 0.000000000001)) { // see pull request #1047\n failing_axes[axis_num] = -1;\n }\n\n if (pos[axis_num] > (pl + 0.000000000001)) { // see pull request #1047\n failing_axes[axis_num] = 1;\n }\n }\n}\n\nint axis_update_coord_with_bound(double *pcmd_p[], double servo_period)\n{\n int n;\n int ans = 0;\n emcmot_axis_t *axis;\n double save_pos_cmd[EMCMOT_MAX_AXIS];\n double save_offset_cmd[EMCMOT_MAX_AXIS];\n\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n axis = &axis_array[n];\n save_pos_cmd[n] = *pcmd_p[n];\n save_offset_cmd[n] = axis->ext_offset_tp.pos_cmd;\n simple_tp_update(&(axis->ext_offset_tp), servo_period);\n }\n axis_apply_ext_offsets_to_carte_pos(+1, pcmd_p); // add external offsets\n\n for (n = 0; n < EMCMOT_MAX_AXIS; n++) {\n axis = &axis_array[n];\n //workaround: axis letters not in [TRAJ]COORDINATES\n // have min_pos_limit == max_pos_lim == 0\n if ( (0 == axis->max_pos_limit) && (0 == axis->min_pos_limit) ) {\n continue;\n }\n if (axis->ext_offset_tp.curr_pos == 0) {\n continue; // don't claim violation if no offset\n }\n\n if (*pcmd_p[n] >= axis->max_pos_limit) {\n // hold carte_pos_cmd at the limit:\n *pcmd_p[n] = axis->max_pos_limit;\n // stop growth of offsetting position:\n axis->ext_offset_tp.curr_pos = axis->max_pos_limit\n - save_pos_cmd[n];\n if (axis->ext_offset_tp.pos_cmd > save_offset_cmd[n]) {\n axis->ext_offset_tp.pos_cmd = save_offset_cmd[n];\n }\n axis->ext_offset_tp.curr_vel = 0;\n ans++;\n continue;\n }\n if (*pcmd_p[n] <= axis->min_pos_limit) {\n *pcmd_p[n] = axis->min_pos_limit;\n axis->ext_offset_tp.curr_pos = axis->min_pos_limit\n - save_pos_cmd[n];\n if (axis->ext_offset_tp.pos_cmd < save_offset_cmd[n]) {\n axis->ext_offset_tp.pos_cmd = save_offset_cmd[n];\n }\n axis->ext_offset_tp.curr_vel = 0;\n ans++;\n }\n }\n if (ans > 0) { return 1; }\n return 0;\n}\n\nstatic int update_teleop_with_check(int axis_num, simple_tp_t *the_tp, double servo_period)\n{\n // 'the_tp' is the planner to update\n // the tests herein apply to the sum of the offsets for both\n // planners (teleop_tp and ext_offset_tp)\n double save_curr_pos;\n emcmot_axis_t *axis = &axis_array[axis_num];\n\n save_curr_pos = the_tp->curr_pos;\n simple_tp_update(the_tp, servo_period);\n\n //workaround: axis letters not in [TRAJ]COORDINATES\n // have min_pos_limit == max_pos_lim == 0\n if ( (0 == axis->max_pos_limit) && (0 == axis->min_pos_limit) ) {\n return 0;\n }\n if ( (axis->ext_offset_tp.curr_pos + axis->teleop_tp.curr_pos)\n >= axis->max_pos_limit) {\n // positive error, restore save_curr_pos\n the_tp->curr_pos = save_curr_pos;\n the_tp->curr_vel = 0;\n return 1;\n }\n if ( (axis->ext_offset_tp.curr_pos + axis->teleop_tp.curr_pos)\n <= axis->min_pos_limit) {\n // negative error, restore save_curr_pos\n the_tp->curr_pos = save_curr_pos;\n the_tp->curr_vel = 0;\n return 1;\n }\n return 0;\n}\n\nint axis_calc_motion(double servo_period)\n{\n int axis_num;\n int violated_teleop_limit = 0;\n emcmot_axis_t *axis;\n\n for (axis_num = 0; axis_num < EMCMOT_MAX_AXIS; axis_num++) {\n axis = &axis_array[axis_num];\n // teleop_tp.max_vel is always positive\n if (axis->teleop_tp.max_vel > axis->vel_limit) {\n axis->teleop_tp.max_vel = axis->vel_limit;\n }\n if (update_teleop_with_check(axis_num, &(axis->teleop_tp), servo_period)) {\n violated_teleop_limit = 1;\n } else {\n axis->teleop_vel_cmd = axis->teleop_tp.curr_vel;\n axis->pos_cmd = axis->teleop_tp.curr_pos;\n }\n\n if (!axis->teleop_tp.active) {\n axis->kb_ajog_active = 0;\n axis->wheel_ajog_active = 0;\n }\n\n if (axis->ext_offset_tp.enable) {\n if (update_teleop_with_check(axis_num, &(axis->ext_offset_tp), servo_period)) {\n violated_teleop_limit = 1;\n }\n }\n }\n return violated_teleop_limit;\n}\n"} {"id": "linuxcnc-source:src/emc/motion/emcmotglb.c", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/motion/emcmotglb.c", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/motion/emcmotglb.c", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "3fe47c93af71036340c517046062b6ce955fdd78c7369bc26aeff2fe51e2c4ab", "bytes": 1112, "tokens": 438, "text": "/********************************************************************\n* Description: emcmotglb.c\n* Compile-time configuration parameters\n*\n* Set the values in emcmotcfg.h; these vars will be set to those values\n* and emcmot.c can reference the variables with their defaults. This file\n* exists to avoid having to recompile emcmot.c every time a default is\n* changed.\n*\n* Derived from a work by Fred Proctor & Will Shackleford\n*\n* Author:\n* License: GPL Version 2\n* System: Linux\n* \n* Copyright (c) 2004 All rights reserved.\n********************************************************************/\n\n#include \"emcmotglb.h\"\t\t/* these decls */\n#include \"emcmotcfg.h\"\t\t/* initial values */\n\nchar EMCMOT_INIFILE[EMCMOT_INIFILE_LEN] = DEFAULT_EMCMOT_INIFILE;\n\n\nunsigned int SHMEM_KEY = DEFAULT_SHMEM_KEY;\n\ndouble EMCMOT_COMM_TIMEOUT = DEFAULT_EMCMOT_COMM_TIMEOUT;\n\ndouble VELOCITY = DEFAULT_VELOCITY;\ndouble ACCELERATION = DEFAULT_ACCELERATION;\n\ndouble MAX_LIMIT = DEFAULT_MAX_LIMIT;\ndouble MIN_LIMIT = DEFAULT_MIN_LIMIT;\n\nint TC_QUEUE_SIZE = DEFAULT_TC_QUEUE_SIZE;\n\ndouble MAX_FERROR = DEFAULT_MAX_FERROR;\n"} {"id": "linuxcnc-source:src/emc/tooldata/tooldata_nml.cc", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/tooldata/tooldata_nml.cc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/tooldata/tooldata_nml.cc", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "da352ba358fddd611e43dc30c343418ba33b7f901e11cecca9a55653fdb51e3c", "bytes": 2925, "tokens": 1162, "text": "/*\n** Copyright: 2021\n** Author: Dewey Garrett \n**\n** This program is free software; you can redistribute it and/or modify\n** it under the terms of the GNU General Public License as published by\n** the Free Software Foundation; either version 2 of the License, or\n** (at your option) any later version.\n**\n** This program is distributed in the hope that it will be useful,\n** but WITHOUT ANY WARRANTY; without even the implied warranty of\n** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n** GNU General Public License for more details.\n**\n** You should have received a copy of the GNU General Public License\n** along with this program; if not, write to the Free Software\n** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n*/\n\n#define UNEXPECTED_MSG fprintf(stderr,\"UNEXPECTED %s %d\\n\",__FILE__,__LINE__);\n\n#include \n#include \n#include \n#include \n#include \"tooldata.hh\"\n\nstatic CANON_TOOL_TABLE *the_table;\n\nint tool_nml_register(CANON_TOOL_TABLE *tblptr)\n{\n if (!tblptr) {\n fprintf(stderr,\"%5d!!!PROBLEM tool_nml_register()\\n\",getpid());\n return -1;\n }\n the_table = tblptr;\n return 0;\n} //tool_nml_register\n\nvoid tooldata_last_index_set(int idx)\n{\n return; //not used with nml\n} //tooldata_last_index_set()\n\nint tooldata_last_index_get(void)\n{\n return CANON_POCKETS_MAX -1;\n} // tooldata_last_index_get()\n\n\ntoolidx_t tooldata_put(CANON_TOOL_TABLE from,int idx)\n{\n if (!the_table) {\n fprintf(stderr,\"%5d!!!tool_nml_put() NOT INITIALIZED\\n\",getpid());\n return IDX_FAIL;\n }\n if (idx < 0 || idx >= CANON_POCKETS_MAX) {\n UNEXPECTED_MSG;\n return IDX_FAIL;\n }\n *(the_table + idx) = from;\n return IDX_OK;\n} // tooldata_put()\n\nvoid tooldata_reset()\n{\n CANON_TOOL_TABLE initdata = tooldata_entry_init();\n int idx;\n for (idx = 0; idx < CANON_POCKETS_MAX; idx++) {\n *(the_table + idx) = initdata;\n }\n} // tooldata_reset()\n\ntoolidx_t tooldata_get(CANON_TOOL_TABLE* pdata,int idx)\n{\n if (idx < 0 || idx >= CANON_POCKETS_MAX) {\n fprintf(stderr,\"!!!%5d PROBLEM tooldata_get(): idx=%d, maxallowed=%d\\n\",\n getpid(),idx,CANON_POCKETS_MAX-1);\n return IDX_FAIL;\n }\n\n if (!the_table) {\n fprintf(stderr,\"!!!%5d PROBLEM tooldata_get(): idx=%d the_table=%p\\n\",\n getpid(),idx,the_table);\n return IDX_FAIL;\n }\n\n *pdata = *(struct CANON_TOOL_TABLE*)(the_table + idx);\n return IDX_OK;\n} // tooldata_get()\n\nint tooldata_find_index_for_tool(int toolno)\n{\n int foundidx = -1;\n if (toolno == -1) {return -1;}\n for(int idx = 0;idx < CANON_POCKETS_MAX;idx++){\n if ((the_table+idx)->toolno == toolno) {\n foundidx = idx;\n if (foundidx==0) continue;\n break;\n }\n }\n return foundidx;\n} //tooldata_find_index_for_tool()\n"} {"id": "linuxcnc-source:src/emc/usr_intf/axis/makeicon.py", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/usr_intf/axis/makeicon.py", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/usr_intf/axis/makeicon.py", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "55d746a9dc771331d56e0dafcc9bb36b581393680e125fa68cbec141c39ea52e", "bytes": 1147, "tokens": 424, "text": "# Copyright 2005 Jeff Epler\n# All Rights Reserved\n#\n# Permission to use, copy, modify, and distribute this software and its\n# documentation for any purpose and without fee is hereby granted, provided that\n# the above copyright notice appear in all copies and that both that copyright\n# notice and this permission notice appear in supporting documentation,\n#\n# JEFF EPLER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL\n# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL JEFF EPLER\n# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF\n# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION\n# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\nimport struct, sys, Image\n\nicon = []\n\nfor f in sys.argv[1:]:\n img = Image.open(f).convert(\"RGBA\")\n icon.append(struct.pack(\"II\", *img.size))\n icon.append(img.tostring())\n\nicon = \"\".join(icon)\n\nicon = icon.encode(\"hex\")\nprint(\"icon = (\")\nfor i in range(0, len(icon), 72):\n print(repr(icon[i:i+72]))\nprint(\").decode('hex')\")\n"} {"id": "linuxcnc-source:src/emc/usr_intf/emcrsh.cc", "source": "linuxcnc-source", "repository": "https://github.com/LinuxCNC/linuxcnc", "revision": "b8ccac8f835c0610233fdf799255c63f2b9738ac", "path": "src/emc/usr_intf/emcrsh.cc", "url": "https://github.com/LinuxCNC/linuxcnc/blob/b8ccac8f835c0610233fdf799255c63f2b9738ac/src/emc/usr_intf/emcrsh.cc", "license": "GPL-2.0/LGPL-2.1; file-level notices govern", "encoding": "utf-8", "sha256": "044bf49eefadef799eacb81b78a6f7d4f506928caa2a66af311891e41414438a", "bytes": 106016, "tokens": 39262, "text": "/********************************************************************\n* Description: emcrsh.cc (source for linuxcncrsh)\n* Extended telnet based LinuxCNC interface\n*\n* Derived from a work by Fred Proctor & Will Shackleford\n* Further derived from work by jmkasunich\n*\n* Author: Eric H. Johnson\n* License: GPL Version 2\n* System: Linux\n*\n* Copyright (c) 2006-2008 All rights reserved.\n*\n* Last change:\n********************************************************************/\n\n#define _REENTRANT\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n\n#include \"rcs.hh\"\n#include \"posemath.h\"\t\t// PM_POSE, TO_RAD\n#include \"emc.hh\"\t\t// EMC NML\n#include \"canon.hh\"\t\t// CANON_UNITS, CANON_UNITS_INCHES,MM,CM\n#include \"emcglb.h\"\t\t// EMC_NMLFILE, TRAJ_MAX_VELOCITY, etc.\n#include \"emccfg.h\"\t\t// DEFAULT_TRAJ_MAX_VELOCITY\n#include \"inifile.hh\"\t\t// INIFILE\n#include \"rcs_print.hh\"\n#include \"timer.hh\" // etime()\n#include \"shcom.hh\" // NML Messaging functions\n#include \t// rtapi_strlcpy()\n\n/*\n Using linuxcncrsh:\n\n linuxcncrsh {-- --port --name --connectpw \n --enablepw --sessions --path \n -ini}\n\n With -- --port Waits for socket connections (Telnet) on specified socket, without port\n uses default port 5007.\n With -- --name Sets the server name to specified name for Hello.\n With -- --connectpw Sets the connection password to 'password'. Default EMC\n With -- --enablepw Sets the enable password to 'password'. Default EMCTOO\n With -- --sessions Sets the maximum number of simultaneous connextions\n to max sessions. Default is no limit (-1).\n With -- --path Sets the base path to program (G-Code) files, default is \"../../nc_files/\".\n Make sure to include the final slash (/).\n With -- -ini , uses specified INI file instead of default emc.ini.\n\n There are six commands supported, Where the commands set and get contain LinuxCNC\n specific sub-commands based on the commands supported by linuxcncrsh, but where the\n usual prefix ( \"emc_\") is omitted. Commands and most parameters are not case sensitive.\n The exceptions are passwords, file paths and text strings.\n\n The supported commands are as follows:\n\n ==> HELLO <==\n\n Hello \n If a valid password was entered the server will respond with\n\n HELLO ACK \n\n Where server name and server version are looked up from the implementation.\n if an invalid password or any other syntax error occurs then the server\n responds with:\n\n HELLO NAK\n\n ==> Get <==\n\n The get command includes one of the LinuxCNC sub-commands, described below and\n zero or more additional parameters.\n\n ==> Set <==\n\n The set command inclides one of the LinuxCNC sub-commands, described below and\n one or more additional parameters.\n\n ==> Quit <==\n\n The quit command disconnects the associated socket connection.\n\n ==> Shutdown <==\n\n The shutdown command tells LinuxCNC to shutdown before quitting the connection. This\n command may only be issued if the Hello has been successfully negotiated and the\n connection has control of the CNC (see enable sub-command below). This command\n has no parameters.\n\n ==> Help <==\n\n The help command will return help information in text format over the telnet\n connection. If no parameters are specified, it will itemize the available commands.\n If a command is specified, it will provide usage information for the specified\n command. Help will respond regardless of whether a \"Hello\" has been\n successfully negotiated.\n\n\n LinuxCNC sub-commands:\n\n echo on | off\n With get will return the current echo state, with set, sets the echo\n state. When echo is on, all commands will be echoed upon receipt. This\n state is local to each connection.\n\n verbose on | off\n With get will return the current verbose state, with set, sets the\n verbose state. When in verbose mode is on, all set commands return\n positive acknowledgement in the form SET ACK. In addition,\n text error messages will be issued when in verbose mode. This state\n is local to each connection.\n\n enable | off\n With get will return On or Off to indicate whether the current connection\n is enabled to perform control functions. With set and a valid password,\n the current connection is enabled for control functions. \"OFF\" may not\n be used as a password and disables control functions for this connection.\n\n config [TBD]\n\n comm_mode ascii | binary\n With get, will return the current communications mode. With set, will\n set the communications mode to the specified mode. The binary protocol\n is TBD.\n\n comm_prot \n With get, returns the current protocol version used by the server,\n with set, sets the server to use the specified protocol version,\n provided it is lower than or equal to the highest version number\n supported by the server implementation.\n\n INIFILE\n Returns the path and file name of the current configuration inifile.\n\n plat\n Returns the platform for which this was compiled, e.g., linux_2_0_36\n\n ini
\n Returns the string value of in section
, in EMC_INIFILE\n\n debug {}\n With get, returns the integer value of EMC_DEBUG, in LinuxCNC. Note that\n it may not be true that the local EMC_DEBUG variable here (in linuxcncrsh and\n the GUIs that use it) is the same as the EMC_DEBUG value in the LinuxCNC. This\n can happen if LinuxCNC is started from one INI file, and the GUI is started\n with another that has a different value for DEBUG.\n With set, sends a command to the LinuxCNC to set the new debug level,\n and sets the EMC_DEBUG global here to the same value. This will make\n the two values the same, since they really ought to be the same.\n\n set_wait none | received | done\n Set the wait for commands to return to be right away (none), after the\n command was sent and received (received), or after the command was\n done (done).\n\n wait received | done\n Force a wait for the previous command to be received, or done. This lets\n you wait in the event that \"emc_set_wait none\" is in effect.\n\n set_timeout \n Set the timeout for commands to return to , in seconds. Timeout\n is a real number. If it's <= 0.0, it means wait forever. Default is 0.0,\n wait forever.\n\n update (none) | none | auto\n With no arg, forces an update of the LinuxCNC status. With \"none\", doesn't\n cause an automatic update of status with other emc_ words. With \"auto\",\n makes emc_ words automatically update status before they return values.\n\n error\n Returns the current LinuxCNC error string, or \"ok\" if no error.\n\n operator_display\n Returns the current LinuxCNC operator display string, or \"ok\" if none.\n\n operator_text\n Returns the current LinuxCNC operator text string, or \"ok\" if none.\n\n time\n Returns the time, in seconds, from the start of the epoch. This starting\n time depends on the platform.\n\n estop (none) | on | off\n With no arg, returns the estop setting as \"on\" or \"off\". Otherwise,\n sends an estop on or off command.\n\n machine (none) | on | off\n With no arg, returns the machine setting as \"on\" or \"off\". Otherwise,\n sends a machine on or off command.\n\n mode (none) | manual | auto | mdi\n With no arg, returns the mode setting as \"manual\", \"auto\", or \"mdi\".\n Otherwise, sends a mode manual, auto, or mdi command.\n\n mist (none) | on | off\n With no arg, returns the mist setting as \"on\" or \"off\". Otherwise,\n sends a mist on or off command.\n\n flood (none) | on | off\n With no arg, returns the flood setting as \"on\" or \"off\". Otherwise,\n sends a flood on or off command.\n\n lube (none) | on | off\n With no arg, returns the lubricant pump setting as \"on\" or \"off\".\n Otherwise, sends a lube on or off command.\n\n lube_level\n Returns the lubricant level sensor reading as \"ok\" or \"low\".\n\n spindle (none) | forward | reverse | increase | decrease | constant | off\n With no arg, returns the value of the spindle state as \"forward\",\n \"reverse\", \"increase\", \"decrease\", or \"off\". With arg, sends the spindle\n command. Note that \"increase\" and \"decrease\" will cause a speed change in\n the corresponding direction until a \"constant\" command is sent.\n\n brake (none) | on | off\n With no arg, returns the brake setting. Otherwise sets the brake.\n\n tool\n Returns the id of the currently loaded tool\n\n tool_offset\n Returns the currently applied tool length offset\n\n load_tool_table \n Loads the tool table specified by \n\n home 0 | 1 | 2 | ...\n Homes the indicated joint.\n\n jog_stop joint_number|axis_letter\n Stop the axis or joint jog\n\n jog joint_number|axis_letter speed\n Jog the indicated joint or axis at ; sign of speed is direction\n\n jog_incr joint_number|axis_letter \n Jog the indicated joint or axis by increment at the ; sign of\n speed is direction\n\n feed_override {}\n With no args, returns the current feed override, as a percent. With\n argument, set the feed override to be the percent value\n\n spindle_override {}\n With no args, returns the current spindle override, as a percent. With\n argument, set the spindle override to be the percent value\n\n abs_cmd_pos 0 | 1 | ...\n Returns double obj containing the XYZ-SXYZ commanded pos in abs coords,\n at given index, 0 = X, etc.\n\n abs_act_pos\n Returns double objs containing the XYZ-SXYZ actual pos in abs coords\n\n rel_cmd_pos 0 | 1 | ...\n Returns double obj containing the XYZ-SXYZ commanded pos in rel coords,\n at given index, 0 = X, etc., including tool length offset\n\n rel_act_pos\n Returns double objs containing the XYZ-SXYZ actual pos in rel coords,\n including tool length offset\n\n joint_pos\n Returns double objs containing the actual pos in absolute coords of individual\n joint/slider positions, excludes tool length offset\n\n pos_offset X | Y | Z | R | P | W\n Returns the position offset associated with the world coordinate provided\n\n joint_limit 0 | 1 | ...\n Returns \"ok\", \"minsoft\", \"minhard\", \"maxsoft\", \"maxhard\"\n\n joint_fault 0 | 1 | ...\n Returns \"ok\" or \"fault\"\n\n joint_homed 0 | 1 | ...\n Returns \"homed\", \"not\"\n\n mdi \n Sends the as an MDI command\n\n task_plan_init\n Initializes the program interpreter\n\n open \n Opens the named file\n\n run {}\n Without start line, runs the opened program from the beginning. With\n start line, runs from that line. A start line of -1 runs in verify mode.\n\n pause\n Pause program execution\n\n resume\n Resume program execution\n\n step\n Step the program one line\n\n program\n Returns the name of the currently opened program, or \"none\"\n\n program_line\n Returns the currently executing line of the program\n\n program_status\n Returns \"idle\", \"running\", or \"paused\"\n\n program_codes\n Returns the string for the currently active program codes\n\n joint_type \n Returns \"linear\", \"angular\", or \"custom\" for the type of the specified joint\n\n joint_units \n Returns \"inch\", \"mm\", \"cm\", or \"deg\", \"rad\", \"grad\", or \"custom\",\n for the corresponding native units of the specified axis. The type\n of the axis (linear or angular) is used to resolve which type of units\n are returned. The units are obtained heuristically, based on the\n EMC_AXIS_STAT::units numerical value of user units per mm or deg.\n For linear joints, something close to 0.03937 is deemed \"inch\",\n 1.000 is \"mm\", 0.1 is \"cm\", otherwise it's \"custom\".\n For angular joints, something close to 1.000 is deemed \"deg\",\n PI/180 is \"rad\", 100/90 is \"grad\", otherwise it's \"custom\".\n\n program_units\n program_linear_units\n Returns \"inch\", \"mm\", \"cm\", or \"none\", for the corresponding linear\n units that are active in the program interpreter.\n\n program_angular_units\n Returns \"deg\", \"rad\", \"grad\", or \"none\" for the corresponding angular\n units that are active in the program interpreter.\n\n user_linear_units\n Returns \"inch\", \"mm\", \"cm\", or \"custom\", for the\n corresponding native user linear units of the LinuxCNC trajectory\n level. This is obtained heuristically, based on the\n EMC_TRAJ_STAT::linearUnits numerical value of user units per mm.\n Something close to 0.03937 is deemed \"inch\", 1.000 is \"mm\", 0.1 is\n \"cm\", otherwise it's \"custom\".\n\n user_angular_units\n Returns \"deg\", \"rad\", \"grad\", or \"custom\" for the corresponding native\n user angular units of the LinuxCNC trajectory level. Like with linear units,\n this is obtained heuristically.\n\n display_linear_units\n display_angular_units\n Returns \"inch\", \"mm\", \"cm\", or \"deg\", \"rad\", \"grad\", or \"custom\",\n for the linear or angular units that are active in the display.\n This is effectively the value of linearUnitConversion or\n angularUnitConversion, resp.\n\n linear_unit_conversion {inch | mm | cm | auto}\n With no args, returns the unit conversion active. With arg, sets the\n units to be displayed. If it's \"auto\", the units to be displayed match\n the program units.\n\n angular_unit_conversion {deg | rad | grad | auto}\n With no args, returns the unit conversion active. With arg, sets the\n units to be displayed. If it's \"auto\", the units to be displayed match\n the program units.\n\n probe_clear\n Clear the probe tripped flag.\n\n probe_tripped\n Has the probe been tripped since the last clear.\n\n probe_value\n Value of current probe signal. (read-only)\n\n probe\n Move toward a certain location. If the probe is tripped on the way stop\n motion, record the position and raise the probe tripped flag.\n\n teleop_enable\n Should motion run in teleop mode? (No args\n gets it, one arg sets it.)\n\n kinematics_type\n returns the type of kinematics functions used identity=1, serial=2,\n parallel=3, custom=4\n\n override_limits on | off\n If parameter is on, disables end of travel hardware limits to allow\n jogging off of a limit. If parameters is off, then hardware limits\n are enabled.\n\n optional_stop none | 0 | 1\n returns state of optional setop, sets it or deactivates it (used to stop/continue on M1)\n\n <------------------------------------------------>\n\n To Do:\n\n 1> Load / save connect and enable passwords to file.\n 2> Implement commands to set / get passwords\n 3> Get enable to tell peer connections which connection has control.\n 4> Get shutdown to notify LinuxCNC to actually shutdown.\n*/\n\n// EMC_STAT *emcStatus;\n\ntypedef enum {\n cmdHello, cmdSet, cmdGet, cmdQuit, cmdShutdown, cmdHelp, cmdUnknown} commandTokenType;\n\ntypedef enum {\n scEcho, scVerbose, scEnable, scConfig, scCommMode, scCommProt, scIniFile,\n scPlat, scIni, scDebug, scSetWait, scWait, scSetTimeout, scUpdate, scError,\n scOperatorDisplay, scOperatorText, scTime, scEStop, scMachine, scMode,\n scMist, scFlood, scLube, scLubeLevel, scSpindle, scBrake, scTool, scToolOffset,\n scLoadToolTable, scHome, scJogStop, scJog, scJogIncr, scFeedOverride,\n scAbsCmdPos, scAbsActPos, scRelCmdPos, scRelActPos, scJointPos, scPosOffset,\n scJointLimit, scJointFault, scJointHomed, scMDI, scTskPlanInit, scOpen, scRun,\n scPause, scResume, scStep, scAbort, scProgram, scProgramLine, scProgramStatus,\n scProgramCodes, scJointType, scJointUnits, scProgramUnits, scProgramLinearUnits,\n scProgramAngularUnits, scUserLinearUnits, scUserAngularUnits, scDisplayLinearUnits,\n scDisplayAngularUnits, scLinearUnitConversion, scAngularUnitConversion, scProbeClear,\n scProbeTripped, scProbeValue, scProbe, scTeleopEnable, scKinematicsType, scOverrideLimits,\n scSpindleOverride, scOptionalStop, scUnknown\n } setCommandType;\n\ntypedef enum {\n rtNoError, rtHandledNoError, rtStandardError, rtCustomError, rtCustomHandledError\n } cmdResponseType;\n\ntypedef struct {\n int cliSock;\n char hostName[80];\n char version[8];\n bool linked;\n bool echo;\n bool verbose;\n bool enabled;\n int commMode;\n int commProt;\n char inBuf[256];\n char outBuf[4096];\n char progName[PATH_MAX];} connectionRecType;\n\nint port = 5007;\nint server_sockfd;\nsocklen_t server_len, client_len;\nstruct sockaddr_in server_address;\nstruct sockaddr_in client_address;\nbool useSockets = true;\nint tokenIdx;\nconst char *delims = \" \\n\\r\\0\";\nint enabledConn = -1;\nchar pwd[16] = \"EMC\\0\";\nchar enablePWD[16] = \"EMCTOO\\0\";\nchar serverName[24] = \"EMCNETSVR\\0\";\nint sessions = 0;\nint maxSessions = -1;\n\nconst char *setCommands[] = {\n \"ECHO\", \"VERBOSE\", \"ENABLE\", \"CONFIG\", \"COMM_MODE\", \"COMM_PROT\", \"INIFILE\", \"PLAT\", \"INI\", \"DEBUG\",\n \"SET_WAIT\", \"WAIT\", \"TIMEOUT\", \"UPDATE\", \"ERROR\", \"OPERATOR_DISPLAY\", \"OPERATOR_TEXT\",\n \"TIME\", \"ESTOP\", \"MACHINE\", \"MODE\", \"MIST\", \"FLOOD\", \"LUBE\", \"LUBE_LEVEL\",\n \"SPINDLE\", \"BRAKE\", \"TOOL\", \"TOOL_OFFSET\", \"LOAD_TOOL_TABLE\", \"HOME\",\n \"JOG_STOP\", \"JOG\", \"JOG_INCR\", \"FEED_OVERRIDE\", \"ABS_CMD_POS\", \"ABS_ACT_POS\",\n \"REL_CMD_POS\", \"REL_ACT_POS\", \"JOINT_POS\", \"POS_OFFSET\", \"JOINT_LIMIT\",\n \"JOINT_FAULT\", \"JOINT_HOMED\", \"MDI\", \"TASK_PLAN_INIT\", \"OPEN\", \"RUN\", \"PAUSE\",\n \"RESUME\", \"STEP\", \"ABORT\", \"PROGRAM\", \"PROGRAM_LINE\", \"PROGRAM_STATUS\", \"PROGRAM_CODES\",\n \"JOINT_TYPE\", \"JOINT_UNITS\", \"PROGRAM_UNITS\", \"PROGRAM_LINEAR_UNITS\", \"PROGRAM_ANGULAR_UNITS\",\n \"USER_LINEAR_UNITS\", \"USER_ANGULAR_UNITS\", \"DISPLAY_LINEAR_UNITS\", \"DISPLAY_ANGULAR_UNITS\",\n \"LINEAR_UNIT_CONVERSION\", \"ANGULAR_UNIT_CONVERSION\", \"PROBE_CLEAR\", \"PROBE_TRIPPED\",\n \"PROBE_VALUE\", \"PROBE\", \"TELEOP_ENABLE\", \"KINEMATICS_TYPE\", \"OVERRIDE_LIMITS\",\n \"SPINDLE_OVERRIDE\", \"OPTIONAL_STOP\", \"\"};\n\nconst char *commands[] = {\"HELLO\", \"SET\", \"GET\", \"QUIT\", \"SHUTDOWN\", \"HELP\", \"\"};\n\nstruct option longopts[] = {\n {\"help\", 0, NULL, 'h'},\n {\"port\", 1, NULL, 'p'},\n {\"name\", 1, NULL, 'n'},\n {\"sessions\", 1, NULL, 's'},\n {\"connectpw\", 1, NULL, 'w'},\n {\"enablepw\", 1, NULL, 'e'},\n {\"path\", 1, NULL, 'd'},\n {0,0,0,0}};\n\n/* static char *skipWhite(char *s)\n{\n while (isspace(*s)) {\n\ts++;\n }\n return s;\n} */\n\nstatic void thisQuit()\n{\n EMC_NULL emc_null_msg;\n\n if (emcStatusBuffer != 0) {\n\t// wait until current message has been received\n\temcCommandWaitReceived();\n }\n\n // clean up NML buffers\n\n if (emcErrorBuffer != 0) {\n\tdelete emcErrorBuffer;\n\temcErrorBuffer = 0;\n }\n\n if (emcStatusBuffer != 0) {\n\tdelete emcStatusBuffer;\n\temcStatusBuffer = 0;\n\temcStatus = 0;\n }\n\n if (emcCommandBuffer != 0) {\n\tdelete emcCommandBuffer;\n\temcCommandBuffer = 0;\n }\n\n exit(0);\n}\n\nstatic int initSockets()\n{\n int optval = 1;\n int err;\n\n server_sockfd = socket(AF_INET, SOCK_STREAM, 0);\n setsockopt(server_sockfd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));\n server_address.sin_family = AF_INET;\n server_address.sin_addr.s_addr = htonl(INADDR_ANY);\n server_address.sin_port = htons(port);\n server_len = sizeof(server_address);\n err = bind(server_sockfd, (struct sockaddr *)&server_address, server_len);\n if (err) {\n rcs_print_error(\"error initializing sockets: %s\\n\", strerror(errno));\n return err;\n }\n\n err = listen(server_sockfd, 5);\n if (err) {\n rcs_print_error(\"error listening on socket: %s\\n\", strerror(errno));\n return err;\n }\n\n // ignore SIGCHLD\n {\n struct sigaction act;\n act.sa_handler = SIG_IGN;\n sigemptyset(&act.sa_mask);\n act.sa_flags = 0;\n sigaction(SIGCHLD, &act, NULL);\n }\n\n return 0;\n}\n\nstatic void sigQuit(int sig)\n{\n thisQuit();\n}\n\nstatic int sockWrite(connectionRecType *context)\n{\n rtapi_strxcat(context->outBuf, \"\\r\\n\");\n return write(context->cliSock, context->outBuf, strlen(context->outBuf));\n}\n\nstatic setCommandType lookupSetCommand(char *s)\n{\n setCommandType i = scEcho;\n int temp;\n\n while (i < scUnknown) {\n if (strcmp(setCommands[i], s) == 0) return i;\n// (int)i += 1;\n temp = i;\n temp++;\n i = (setCommandType) temp;\n }\n return i;\n}\n\nstatic int commandHello(connectionRecType *context)\n{\n char *pch;\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return -1;\n if (strcmp(pch, pwd) != 0) return -1;\n\n pch = strtok(NULL, delims);\n if (pch == NULL || strlen(pch) >= sizeof(context->hostName)) return -1;\n rtapi_strlcpy(context->hostName, pch, sizeof(context->hostName));\n\n pch = strtok(NULL, delims);\n if (pch == NULL|| strlen(pch) >= sizeof(context->version)) return -1;\n rtapi_strlcpy(context->version, pch, sizeof(context->version));\n\n context->linked = true;\n printf(\"Connected to %s\\n\", context->hostName);\n return 0;\n}\n\nstatic int checkOnOff(char *s)\n{\n static const char *onStr = \"ON\";\n static const char *offStr = \"OFF\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, onStr) == 0) return 0;\n if (strcmp(s, offStr) == 0) return 1;\n return -1;\n}\n\nstatic int checkBinaryASCII(char *s)\n{\n static const char *binaryStr = \"BINARY\";\n static const char *ASCIIStr = \"ASCII\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, ASCIIStr) == 0) return 0;\n if (strcmp(s, binaryStr) == 0) return 1;\n return -1;\n}\n\nstatic int checkReceivedDoneNone(char *s)\n{\n static const char *receivedStr = \"RECEIVED\";\n static const char *doneStr = \"DONE\";\n static const char *noneStr = \"NONE\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, receivedStr) == 0) return 0;\n if (strcmp(s, doneStr) == 0) return 1;\n if (strcmp(s, noneStr) == 0) return 2;\n return -1;\n}\n\nstatic int checkNoneAuto(char *s)\n{\n static const char *noneStr = \"NONE\";\n static const char *autoStr = \"AUTO\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, noneStr) == 0) return 0;\n if (strcmp(s, autoStr) == 0) return 1;\n return -1;\n}\n\nstatic int checkManualAutoMDI(char *s)\n{\n static const char *manualStr = \"MANUAL\";\n static const char *autoStr = \"AUTO\";\n static const char *mDIStr = \"MDI\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, manualStr) == 0) return 0;\n if (strcmp(s, autoStr) == 0) return 1;\n if (strcmp(s, mDIStr) == 0) return 2;\n return -1;\n}\n\nstatic int checkSpindleStr(char *s)\n{\n static const char *forwardStr = \"FORWARD\";\n static const char *reverseStr = \"REVERSE\";\n static const char *increaseStr = \"INCREASE\";\n static const char *decreaseStr = \"DECREASE\";\n static const char *constantStr = \"CONSTANT\";\n static const char *offStr = \"OFF\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, forwardStr) == 0) return 0;\n if (strcmp(s, reverseStr) == 0) return 1;\n if (strcmp(s, increaseStr) == 0) return 2;\n if (strcmp(s, decreaseStr) == 0) return 3;\n if (strcmp(s, constantStr) == 0) return 4;\n if (strcmp(s, offStr) == 0) return 5;\n return -1;\n}\n\nstatic int checkConversionStr(char *s)\n{\n static const char *inchStr = \"INCH\";\n static const char *mmStr = \"MM\";\n static const char *cmStr = \"CM\";\n static const char *autoStr = \"AUTO\";\n static const char *customStr = \"CUSTOM\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, inchStr) == 0) return 0;\n if (strcmp(s, mmStr) == 0) return 1;\n if (strcmp(s, cmStr) == 0) return 2;\n if (strcmp(s, autoStr) == 0) return 3;\n if (strcmp(s, customStr) == 0) return 4;\n return -1;\n}\n\nstatic int checkAngularConversionStr(char *s)\n{\n static const char *degStr = \"DEG\";\n static const char *radStr = \"RAD\";\n static const char *gradStr = \"GRAD\";\n static const char *autoStr = \"AUTO\";\n static const char *customStr = \"CUSTOM\";\n\n if (s == NULL) return -1;\n strupr(s);\n if (strcmp(s, degStr) == 0) return 0;\n if (strcmp(s, radStr) == 0) return 1;\n if (strcmp(s, gradStr) == 0) return 2;\n if (strcmp(s, autoStr) == 0) return 3;\n if (strcmp(s, customStr) == 0) return 4;\n return -1;\n}\n\nstatic cmdResponseType setEcho(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: context->echo = true; break;\n case 1: context->echo = false;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setVerbose(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: context->verbose = true; break;\n case 1: context->verbose = false;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setEnable(char *s, connectionRecType *context)\n{\n\n if (s && (strcmp(s, enablePWD) == 0) ) {\n enabledConn = context->cliSock;\n context->enabled = true;\n return rtNoError;\n }\n else\n if (checkOnOff(s) == 1) {\n context->enabled = false;\n enabledConn = -1;\n return rtNoError;\n }\n else return rtStandardError;\n}\n\nstatic cmdResponseType setConfig(char *s, connectionRecType *context)\n{\n return rtNoError;\n}\n\nstatic cmdResponseType setCommMode(char *s, connectionRecType *context)\n{\n int ret;\n\n ret = checkBinaryASCII(s);\n if (ret == -1) return rtStandardError;\n context->commMode = ret;\n return rtNoError;\n}\n\nstatic cmdResponseType setCommProt(char *s, connectionRecType *context)\n{\n char *pVersion;\n\n pVersion = strtok(NULL, delims);\n if (pVersion == NULL) return rtStandardError;\n rtapi_strxcpy(context->version, pVersion);\n return rtNoError;\n}\n\nstatic cmdResponseType setDebug(char *s, connectionRecType *context)\n{\n char *pLevel;\n int level;\n\n pLevel = strtok(NULL, delims);\n if (pLevel == NULL) return rtStandardError;\n if (sscanf(pLevel, \"%i\", &level) == -1) return rtStandardError;\n else sendDebug(level);\n return rtNoError;\n}\n\nstatic cmdResponseType setSetWait(char *s, connectionRecType *context)\n{\n switch (checkReceivedDoneNone(s)) {\n case -1: return rtStandardError;\n case 0: {\n emcWaitType = EMC_WAIT_RECEIVED;\n break;\n }\n case 1: {\n emcWaitType = EMC_WAIT_DONE;\n break;\n }\n case 2: {\n fprintf(stderr, \"linuxcncrsh: 'set set_wait' asked for 'none', but that setting has been removed as it may cause commands to be lost\\n\");\n return rtStandardError;\n break;\n }\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setMachine(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: sendMachineOn(); break;\n case 1: sendMachineOff();\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setEStop(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: sendEstop(); break;\n case 1: sendEstopReset();\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setWait(char *s, connectionRecType *context)\n{\n switch (checkReceivedDoneNone(s)) {\n case -1: return rtStandardError;\n case 0:\n if (emcCommandWaitReceived() != 0) return rtStandardError;\n break;\n case 1:\n if (emcCommandWaitDone() != 0) return rtStandardError;\n break;\n case 2: ;\n default: return rtStandardError;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setTimeout(char *s, connectionRecType *context)\n{\n float Timeout;\n\n if (s == NULL) return rtStandardError;\n if (sscanf(s, \"%f\", &Timeout) < 1) return rtStandardError;\n emcTimeout = Timeout;\n return rtNoError;\n}\n\nstatic cmdResponseType setUpdate(char *s, connectionRecType *context)\n{\n switch (checkNoneAuto(s)) {\n case 0: emcUpdateType = EMC_UPDATE_NONE; break;\n case 1: emcUpdateType = EMC_UPDATE_AUTO; break;\n default: return rtStandardError;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setMode(char *s, connectionRecType *context)\n{\n switch (checkManualAutoMDI(s)) {\n case 0: sendManual(); break;\n case 1: sendAuto(); break;\n case 2: sendMdi(); break;\n default: return rtStandardError;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setMist(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: sendMistOn(); break;\n case 1: sendMistOff();\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setFlood(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: sendFloodOn(); break;\n case 1: sendFloodOff();\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setLube(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: sendLubeOn(); break;\n case 1: sendLubeOff();\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setSpindle(char *s, connectionRecType *context)\n{\n\tint spindle = 0;\n\ts = strtok(NULL, delims);\n\tif (sscanf(s, \"%d\", &spindle) > 0){// there is a spindle number\n\t\ts = strtok(NULL, delims);\n\t} else {\n\t\tspindle = -1;\n\t}\n\tswitch (checkSpindleStr(s)) {\n \t case -1: return rtStandardError;\n \t case 0: sendSpindleForward(spindle); break;\n \t case 1: sendSpindleReverse(spindle); break;\n \t case 2: sendSpindleIncrease(spindle); break;\n \t case 3: sendSpindleDecrease(spindle); break;\n \t case 4: sendSpindleConstant(spindle); break;\n \t case 5: sendSpindleOff(spindle);\n\t}\n\treturn rtNoError;\n}\n\nstatic cmdResponseType setBrake(char *s, connectionRecType *context)\n{\n\tint spindle = 0;\n\ts = strtok(NULL, delims);\n\tif (sscanf(s, \"%d\", &spindle) > 0){// there is a spindle number\n\t\tif (spindle < 0 || spindle > EMCMOT_MAX_SPINDLES) return rtStandardError;\n\t\ts = strtok(NULL, delims);\n\t} else {\n\t\tspindle = -1;\n\t}\n\tswitch (checkOnOff(s)) {\n \t case -1: return rtStandardError;\n \t case 0: sendBrakeEngage(spindle); break;\n \t case 1: sendBrakeRelease(spindle);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setLoadToolTable(char *s, connectionRecType *context)\n{\n if (s == NULL) return rtStandardError;\n if (sendLoadToolTable(s) != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setToolOffset(char *s, connectionRecType *context)\n{\n int tool;\n float length, diameter;\n char *pch;\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n if (sscanf(pch, \"%d\", &tool) <= 0) return rtStandardError;\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n if (sscanf(pch, \"%f\", &length) <= 0) return rtStandardError;\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n if (sscanf(pch, \"%f\", &diameter) <= 0) return rtStandardError;\n\n if (sendToolSetOffset(tool, length, diameter) != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setOverrideLimits(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: if (sendOverrideLimits(0) != 0) return rtStandardError; break;\n case 1: if (sendOverrideLimits(-1) != 0) return rtStandardError;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setMDI(char *s, connectionRecType *context)\n{\n char *pch;\n\n pch = strtok(NULL, \"\\n\\r\\0\");\n if (sendMdiCmd(pch) !=0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setHome(char *s, connectionRecType *context)\n{\n int joint;\n\n if (s == NULL) return rtStandardError;\n if (sscanf(s, \"%d\", &joint) <= 0) return rtStandardError;\n // joint == -1 means \"Home All\", any other negative is wrong\n if ((joint < -1) || (joint > EMCMOT_MAX_JOINTS)) return rtStandardError;\n sendHome(joint);\n return rtNoError;\n}\n\nstatic int axisnumber(char letter) {\n switch (letter) {\n case 'x': case 'X': return 0;\n case 'y': case 'Y': return 1;\n case 'z': case 'Z': return 2;\n case 'a': case 'A': return 3;\n case 'b': case 'B': return 4;\n case 'c': case 'C': return 5;\n case 'u': case 'U': return 6;\n case 'v': case 'V': return 7;\n case 'w': case 'W': return 8;\n }\n return -1;\n}\n\nstatic cmdResponseType setJogStop(char *pch, connectionRecType *context)\n{\n int ja,jnum,jjogmode;\n char aletter;\n //parms: jnum|aletter\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n\n if (sscanf(pch, \"%d\", &jnum) > 0) {\n ja = jnum;\n jjogmode = JOGJOINT;\n } else if (sscanf(pch, \"%c\", &aletter) > 0) {\n ja = axisnumber(aletter);\n jjogmode = JOGTELEOP;\n } else {\n return rtStandardError;\n }\n\n if ( (jjogmode == JOGJOINT)\n && ((ja < 0) || (ja > EMCMOT_MAX_JOINTS))\n ) return rtStandardError;\n\n if (sendJogStop(ja,jjogmode) != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setJog(char *s, connectionRecType *context)\n{\n int ja,jnum,jjogmode;\n char aletter;\n float speed;\n char *pch;\n //parms: jnum|aletter speed\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n\n if (sscanf(pch, \"%d\", &jnum) > 0) {\n ja = jnum;\n jjogmode = JOGJOINT;\n } else if (sscanf(pch, \"%c\", &aletter) > 0) {\n ja = axisnumber(aletter);\n jjogmode = JOGTELEOP;\n } else {\n return rtStandardError;\n }\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n if (sscanf(pch, \"%f\", &speed) <= 0) return rtStandardError;\n\n if (sendJogCont(ja, jjogmode, speed) != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setFeedOverride(char *s, connectionRecType *context)\n{\n int percent;\n\n if (s == NULL) return rtStandardError;\n if (sscanf(s, \"%d\", &percent) <= 0) return rtStandardError;\n sendFeedOverride(((double) percent) / 100.0);\n return rtNoError;\n}\n\nstatic cmdResponseType setJogIncr(char *s, connectionRecType *context)\n{\n int jnum,ja,jjogmode;\n char aletter;\n float speed, incr;\n char *pch;\n //parms: jnum|aletter speed distance\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n\n if (sscanf(pch, \"%d\", &jnum) > 0) {\n ja = jnum;\n jjogmode = JOGJOINT;\n } else if (sscanf(pch, \"%c\", &aletter) > 0) {\n ja = axisnumber(aletter);\n jjogmode = JOGTELEOP;\n } else {\n return rtStandardError;\n }\n\n if ( (jjogmode == JOGJOINT)\n && ((ja < 0) || (ja > EMCMOT_MAX_JOINTS))\n ) return rtStandardError;\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\n\n if (sscanf(pch, \"%f\", &speed) <= 0) return rtStandardError;\n pch = strtok(NULL, delims);\n\n if (pch == NULL) return rtStandardError;\n if (sscanf(pch, \"%f\", &incr) <= 0) return rtStandardError;\n\n if (sendJogIncr(ja, jjogmode, speed, incr) != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setTaskPlanInit(char *s, connectionRecType *context)\n{\n if (sendTaskPlanInit() != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setOpen(char *s, connectionRecType *context)\n{\n char *pch;\n\n pch = strtok(NULL, \"\\n\\r\\0\");\n if (pch == NULL) return rtStandardError;\n if (strlen(pch) >= sizeof(context->progName)) {\n fprintf(stderr, \"linuxcncrsh: 'set open' filename too long for context (got %lu bytes, max %lu)\",\n (unsigned long)strlen(pch), (unsigned long)sizeof(context->progName));\n return rtStandardError;\n }\n strncpy(context->progName, pch, sizeof(context->progName));\n\n if (sendProgramOpen(context->progName) != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setRun(char *s, connectionRecType *context)\n{\n int lineNo;\n\n if (s == NULL) // run from beginning\n if (sendProgramRun(0) != 0) return rtStandardError;\n else ;\n else\n { // run from line number\n if (sscanf(s, \"%d\", &lineNo) <= 0) return rtStandardError;\n if (sendProgramRun(lineNo) != 0) return rtStandardError;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setPause(char *s, connectionRecType *context)\n{\n if (sendProgramPause() != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setResume(char *s, connectionRecType *context)\n{\n if (sendProgramResume() != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setStep(char *s, connectionRecType *context)\n{\n if (sendProgramStep() != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setAbort(char *s, connectionRecType *context)\n{\n if (sendAbort() != 0) return rtStandardError;\n return rtNoError;\n}\n\nstatic cmdResponseType setLinearUnitConversion(char *s, connectionRecType *context)\n{\n switch (checkConversionStr(s)) {\n case -1: return rtStandardError;\n case 0: linearUnitConversion = LINEAR_UNITS_INCH; break;\n case 1: linearUnitConversion = LINEAR_UNITS_MM; break;\n case 2: linearUnitConversion = LINEAR_UNITS_CM; break;\n case 3: linearUnitConversion = LINEAR_UNITS_AUTO; break;\n case 4: linearUnitConversion = LINEAR_UNITS_CUSTOM; break;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setAngularUnitConversion(char *s, connectionRecType *context)\n{\n switch (checkAngularConversionStr(s)) {\n case -1: return rtStandardError;\n case 0: angularUnitConversion = ANGULAR_UNITS_DEG; break;\n case 1: angularUnitConversion = ANGULAR_UNITS_RAD; break;\n case 2: angularUnitConversion = ANGULAR_UNITS_GRAD; break;\n case 3: angularUnitConversion = ANGULAR_UNITS_AUTO; break;\n case 4: angularUnitConversion = ANGULAR_UNITS_CUSTOM; break;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setTeleopEnable(char *s, connectionRecType *context)\n{\n switch (checkOnOff(s)) {\n case -1: return rtStandardError;\n case 0: sendSetTeleopEnable(1); break;\n case 1: sendSetTeleopEnable(0);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType setProbe(char *s, connectionRecType *context)\n{\n float x, y, z;\n char *pch;\n\n pch = strtok(NULL, delims);\n if (pch == NULL) return rtStandardError;\nfprintf(stderr,\"0_probe pch=%s\\n\",pch);\n if (sscanf(pch, \"%f\", &x) <= 0) return rtStandardError;\n\n pch = strtok(NULL, delims);\nfprintf(stderr,\"1_probe pch=%s\\n\",pch);\n if (pch == NULL) return rtStandardError;\n if (sscanf(pch, \"%f\", &y) <= 0) return rtStandardError;\n\n pch = strtok(NULL, delims);\nfprintf(stderr,\"2_probe pch=%s\\n\",pch);\n if (pch == NULL) return rtStandardError;\n if (sscanf(pch, \"%f\", &z) <= 0) return rtStandardError;\n\n sendProbe(x, y, z);\n return rtNoError;\n}\n\nstatic cmdResponseType setProbeClear(char *s, connectionRecType *context)\n{\n sendClearProbeTrippedFlag();\n return rtNoError;\n}\n\nstatic cmdResponseType setSpindleOverride(char *s, connectionRecType *context)\n{\n\tint percent;\n\tint spindle = 0;\n\ts = strtok(NULL, delims);\n\tif (sscanf(s, \"%d\", &spindle) > 0){// there is at least one number\n\t\ts = strtok(NULL, delims);\n\t\tif (sscanf(s, \"%d\", &percent) < 0){ // no second number\n\t\t\tpercent = spindle;\n\t\t\tspindle = -1;\n\t\t}\n\t} else {\n\t\treturn rtStandardError;\n\t}\n\tsendSpindleOverride(spindle, ((double) percent) / 100.0);\n\treturn rtNoError;\n}\n\nstatic cmdResponseType setOptionalStop(char *s, connectionRecType *context)\n{\n int value;\n\n sscanf(s, \"%d\", &value);\n if (sendSetOptionalStop(value) != 0) return rtStandardError;\n return rtNoError;\n}\n\nint commandSet(connectionRecType *context)\n{\n static const char *setNakStr = \"SET NAK\\n\\r\";\n static const char *setCmdNakStr = \"SET %s NAK\\n\\r\";\n static const char *ackStr = \"SET %s ACK\\n\\r\";\n setCommandType cmd;\n char *pch;\n cmdResponseType ret = rtNoError;\n\n pch = strtok(NULL, delims);\n if (pch == NULL) {\n return write(context->cliSock, setNakStr, strlen(setNakStr));\n }\n strupr(pch);\n cmd = lookupSetCommand(pch);\n if ((cmd >= scIniFile) && (context->cliSock != enabledConn)) {\n snprintf(context->outBuf, sizeof(context->outBuf), setCmdNakStr, pch);\n return write(context->cliSock, context->outBuf, strlen(context->outBuf));\n }\n if ((cmd > scMachine) && (emcStatus->task.state != EMC_TASK_STATE_ON)) {\n// Extra check in the event of an undetected change in Machine state resulting in\n// sending a set command when the machine state is off. This condition is detected\n// and appropriate error messages are generated, however erratic behavior has been\n// seen when doing certain set commands when the Machine state is other than 'On'.\n snprintf(context->outBuf, sizeof(context->outBuf), setCmdNakStr, pch);\n return write(context->cliSock, context->outBuf, strlen(context->outBuf));\n }\n switch (cmd) {\n case scEcho: ret = setEcho(strtok(NULL, delims), context); break;\n case scVerbose: ret = setVerbose(strtok(NULL, delims), context); break;\n case scEnable: ret = setEnable(strtok(NULL, delims), context); break;\n case scConfig: ret = setConfig(strtok(NULL, delims), context); break;\n case scCommMode: ret = setCommMode(strtok(NULL, delims), context); break;\n case scCommProt: ret = setCommProt(strtok(NULL, delims), context); break;\n case scIniFile: break;\n case scPlat: break;\n case scIni: break;\n case scDebug: ret = setDebug(strtok(NULL, delims), context); break;\n case scSetWait: ret = setSetWait(strtok(NULL, delims), context); break;\n case scWait: ret = setWait(strtok(NULL, delims), context); break;\n case scSetTimeout: ret = setTimeout(strtok(NULL, delims), context); break;\n case scUpdate: ret = setUpdate(strtok(NULL, delims), context); break;\n case scError: ret = rtStandardError; break;\n case scOperatorDisplay: ret = rtStandardError; break;\n case scOperatorText: ret = rtStandardError; break;\n case scTime: ret = rtStandardError; break;\n case scEStop: ret = setEStop(strtok(NULL, delims), context); break;\n case scMachine: ret = setMachine(strtok(NULL, delims), context); break;\n case scMode: ret = setMode(strtok(NULL, delims), context); break;\n case scMist: ret = setMist(strtok(NULL, delims), context); break;\n case scFlood: ret = setFlood(strtok(NULL, delims), context); break;\n case scLube: ret = setLube(strtok(NULL, delims), context); break;\n case scLubeLevel: ret = rtStandardError; break;\n case scSpindle: ret = setSpindle(pch, context); break;\n case scBrake: ret = setBrake(pch, context); break;\n case scTool: ret = rtStandardError; break;\n case scToolOffset: ret = setToolOffset(pch, context); break;\n case scLoadToolTable: ret = setLoadToolTable(strtok(NULL, delims), context); break;\n case scHome: ret = setHome(strtok(NULL, delims), context); break;\n case scJogStop: ret = setJogStop(pch, context); break;\n case scJog: ret = setJog(pch, context); break;\n case scJogIncr: ret = setJogIncr(pch, context); break;\n case scFeedOverride: ret = setFeedOverride(strtok(NULL, delims), context); break;\n case scAbsCmdPos: ret = rtStandardError; break;\n case scAbsActPos: ret = rtStandardError; break;\n case scRelCmdPos: ret = rtStandardError; break;\n case scRelActPos: ret = rtStandardError; break;\n case scJointPos: ret = rtStandardError; break;\n case scPosOffset: ret = rtStandardError; break;\n case scJointLimit: ret = rtStandardError; break;\n case scJointFault: ret = rtStandardError; break;\n case scJointHomed: ret = rtStandardError; break;\n case scMDI: ret = setMDI(pch, context); break;\n case scTskPlanInit: ret = setTaskPlanInit(pch, context); break;\n case scOpen: ret = setOpen(pch, context); break;\n case scRun: ret = setRun(strtok(NULL, delims), context); break;\n case scPause: ret = setPause(pch, context); break;\n case scResume: ret = setResume(pch, context); break;\n case scAbort: ret = setAbort(pch, context); break;\n case scStep: ret = setStep(pch, context); break;\n case scProgram:ret = rtStandardError; break;\n case scProgramLine: ret = rtStandardError; break;\n case scProgramStatus: ret = rtStandardError; break;\n case scProgramCodes: ret = rtStandardError; break;\n case scJointType: ret = rtStandardError; break;\n case scJointUnits: ret = rtStandardError; break;\n case scProgramUnits:\n case scProgramLinearUnits: ret = rtStandardError; break;\n case scProgramAngularUnits: ret = rtStandardError; break;\n case scUserLinearUnits: ret = rtStandardError; break;\n case scUserAngularUnits: ret = rtStandardError; break;\n case scDisplayLinearUnits: ret = rtStandardError; break;\n case scDisplayAngularUnits: ret = rtStandardError; break;\n case scLinearUnitConversion: ret = setLinearUnitConversion(strtok(NULL, delims), context); break;\n case scAngularUnitConversion: ret = setAngularUnitConversion(strtok(NULL, delims), context); break;\n case scProbeClear: ret = setProbeClear(pch, context); break;\n case scProbeTripped: ret = rtStandardError; break;\n case scProbeValue: ret = rtStandardError; break;\n case scProbe: ret = setProbe(pch, context); break;\n case scTeleopEnable: ret = setTeleopEnable(strtok(NULL, delims), context); break;\n case scKinematicsType: ret = rtStandardError; break;\n case scOverrideLimits: ret = setOverrideLimits(strtok(NULL, delims), context); break;\n case scSpindleOverride: ret = setSpindleOverride(pch, context); break;\n case scOptionalStop: ret = setOptionalStop(strtok(NULL, delims), context); break;\n case scUnknown: ret = rtStandardError;\n }\n switch (ret) {\n case rtNoError:\n if (context->verbose) {\n snprintf(context->outBuf, sizeof(context->outBuf), ackStr, pch);\n return write(context->cliSock, context->outBuf, strlen(context->outBuf));\n }\n break;\n case rtHandledNoError: // Custom ok response already handled, take no action\n break;\n case rtStandardError:\n snprintf(context->outBuf, sizeof(context->outBuf), setCmdNakStr, pch);\n return write(context->cliSock, context->outBuf, strlen(context->outBuf));\n break;\n case rtCustomError: // Custom error response entered in buffer\n return write(context->cliSock, context->outBuf, strlen(context->outBuf));\n break;\n case rtCustomHandledError: ;// Custom error response handled, take no action\n }\n return 0;\n}\n\nstatic cmdResponseType getEcho(char *s, connectionRecType *context)\n{\n static const char *pEchoStr = \"ECHO %s\";\n\n if (context->echo) snprintf(context->outBuf, sizeof(context->outBuf), pEchoStr, \"ON\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pEchoStr, \"OFF\");\n return rtNoError;\n}\n\nstatic cmdResponseType getVerbose(char *s, connectionRecType *context)\n{\n const char *pVerboseStr = \"VERBOSE %s\";\n\n if (context->verbose) snprintf(context->outBuf, sizeof(context->outBuf), pVerboseStr, \"ON\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pVerboseStr, \"OFF\");\n return rtNoError;\n}\n\nstatic cmdResponseType getEnable(char *s, connectionRecType *context)\n{\n const char *pEnableStr = \"ENABLE %s\";\n\n if (context->cliSock == enabledConn)\n// if (context->enabled == true)\n snprintf(context->outBuf, sizeof(context->outBuf), pEnableStr, \"ON\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pEnableStr, \"OFF\");\n return rtNoError;\n}\n\nstatic cmdResponseType getConfig(char *s, connectionRecType *context)\n{\n const char *pConfigStr = \"CONFIG\";\n\n rtapi_strxcpy(context->outBuf, pConfigStr);\n return rtNoError;\n}\n\nstatic cmdResponseType getCommMode(char *s, connectionRecType *context)\n{\n const char *pCommModeStr = \"COMM_MODE %s\";\n\n switch (context->commMode) {\n case 0: snprintf(context->outBuf, sizeof(context->outBuf), pCommModeStr, \"ASCII\"); break;\n case 1: snprintf(context->outBuf, sizeof(context->outBuf), pCommModeStr, \"BINARY\"); break;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getCommProt(char *s, connectionRecType *context)\n{\n const char *pCommProtStr = \"COMM_PROT %s\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pCommProtStr, context->version);\n return rtNoError;\n}\n\nstatic cmdResponseType getDebug(char *s, connectionRecType *context)\n{\n const char *pUpdateStr = \"DEBUG %d\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pUpdateStr, emcStatus->debug);\n return rtNoError;\n}\n\nstatic cmdResponseType getSetWait(char *s, connectionRecType *context)\n{\n const char *pSetWaitStr = \"SET_WAIT %s\";\n\n switch (emcWaitType) {\n case EMC_WAIT_RECEIVED: snprintf(context->outBuf, sizeof(context->outBuf), pSetWaitStr, \"RECEIVED\"); break;\n case EMC_WAIT_DONE: snprintf(context->outBuf, sizeof(context->outBuf), pSetWaitStr, \"DONE\"); break;\n default: return rtStandardError;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getPlat(char *s, connectionRecType *context)\n{\n const char *pPlatStr = \"PLAT %s\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pPlatStr, \"Linux\");\n return rtNoError;\n}\n\nstatic cmdResponseType getEStop(char *s, connectionRecType *context)\n{\n const char *pEStopStr = \"ESTOP %s\";\n\n if (emcStatus->task.state == EMC_TASK_STATE_ESTOP)\n snprintf(context->outBuf, sizeof(context->outBuf), pEStopStr, \"ON\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pEStopStr, \"OFF\");\n return rtNoError;\n}\n\nstatic cmdResponseType getTimeout(char *s, connectionRecType *context)\n{\n const char *pTimeoutStr = \"SET_TIMEOUT %f\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pTimeoutStr, emcTimeout);\n return rtNoError;\n}\n\nstatic cmdResponseType getTime(char *s, connectionRecType *context)\n{\n const char *pTimeStr = \"TIME %f\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pTimeStr, etime());\n return rtNoError;\n}\n\nstatic cmdResponseType getError(char *s, connectionRecType *context)\n{\n const char *pErrorStr = \"ERROR %s\";\n\n if (updateError() != 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pErrorStr, \"emc_error: bad status from LinuxCNC\");\n else\n if (error_string[0] == 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pErrorStr, \"OK\");\n else {\n snprintf(context->outBuf, sizeof(context->outBuf), pErrorStr, error_string);\n error_string[0] = 0;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getOperatorDisplay(char *s, connectionRecType *context)\n{\n const char *pOperatorDisplayStr = \"OPERATOR_DISPLAY %s\";\n\n if (updateError() != 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pOperatorDisplayStr, \"emc_operator_display: bad status from LinuxCNC\");\n else\n if (operator_display_string[0] == 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pOperatorDisplayStr, \"OK\");\n else {\n snprintf(context->outBuf, sizeof(context->outBuf), pOperatorDisplayStr, operator_display_string);\n operator_display_string[0] = 0;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getOperatorText(char *s, connectionRecType *context)\n{\n const char *pOperatorTextStr = \"OPERATOR_TEXT %s\";\n\n if (updateError() != 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pOperatorTextStr, \"emc_operator_text: bad status from LinuxCNC\");\n else\n if (operator_text_string[0] == 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pOperatorTextStr, \"OK\");\n else {\n snprintf(context->outBuf, sizeof(context->outBuf), pOperatorTextStr, operator_text_string);\n operator_text_string[0] = 0;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getMachine(char *s, connectionRecType *context)\n{\n const char *pMachineStr = \"MACHINE %s\";\n\n if (emcStatus->task.state == EMC_TASK_STATE_ON)\n snprintf(context->outBuf, sizeof(context->outBuf), pMachineStr, \"ON\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pMachineStr, \"OFF\");\n return rtNoError;\n}\n\nstatic cmdResponseType getMode(char *s, connectionRecType *context)\n{\n const char *pModeStr = \"MODE %s\";\n\n switch (emcStatus->task.mode) {\n case EMC_TASK_MODE_MANUAL: snprintf(context->outBuf, sizeof(context->outBuf), pModeStr, \"MANUAL\"); break;\n case EMC_TASK_MODE_AUTO: snprintf(context->outBuf, sizeof(context->outBuf), pModeStr, \"AUTO\"); break;\n case EMC_TASK_MODE_MDI: snprintf(context->outBuf, sizeof(context->outBuf), pModeStr, \"MDI\"); break;\n default: snprintf(context->outBuf, sizeof(context->outBuf), pModeStr, \"?\");\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getMist(char *s, connectionRecType *context)\n{\n const char *pMistStr = \"MIST %s\";\n\n if (emcStatus->io.coolant.mist == 1)\n snprintf(context->outBuf, sizeof(context->outBuf), pMistStr, \"ON\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pMistStr, \"OFF\");\n return rtNoError;\n}\n\nstatic cmdResponseType getFlood(char *s, connectionRecType *context)\n{\n const char *pFloodStr = \"FLOOD %s\";\n\n if (emcStatus->io.coolant.flood == 1)\n snprintf(context->outBuf, sizeof(context->outBuf), pFloodStr, \"ON\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pFloodStr, \"OFF\");\n return rtNoError;\n}\n\nstatic cmdResponseType getLube(char *s, connectionRecType *context)\n{\n const char *pLubeStr = \"LUBE %s\";\n\n if (emcStatus->io.lube.on == 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pLubeStr, \"OFF\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pLubeStr, \"ON\");\n return rtNoError;\n}\n\nstatic cmdResponseType getLubeLevel(char *s, connectionRecType *context)\n{\n const char *pLubeLevelStr = \"LUBE_LEVEL %s\";\n\n if (emcStatus->io.lube.level == 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pLubeLevelStr, \"LOW\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pLubeLevelStr, \"OK\");\n return rtNoError;\n}\n\nstatic cmdResponseType getSpindle(char *s, connectionRecType *context)\n{\n const char *pSpindleStr = \"SPINDLE %d %s\";\n int spindle = -1;\n int n;\n s = strtok(NULL, delims);\n if (sscanf(s, \"%d\", &spindle) < 0) spindle = -1; // no spindle number given return all\n for (n = 0; n < emcStatus->motion.traj.spindles; n++){\n\t if (n == spindle || spindle == -1){\n\t\t if (emcStatus->motion.spindle[n].increasing > 0)\n\t\t\tsnprintf(context->outBuf, sizeof(context->outBuf), pSpindleStr, n, \"INCREASE\");\n\t\t else\n\t\t\tif (emcStatus->motion.spindle[n].increasing < 0)\n\t\t\t snprintf(context->outBuf, sizeof(context->outBuf), pSpindleStr, n, \"DECREASE\");\n\t\t\telse\n\t\t\t if (emcStatus->motion.spindle[n].direction > 0)\n\t\t\t\tsnprintf(context->outBuf, sizeof(context->outBuf), pSpindleStr, n, \"FORWARD\");\n\t\t\t else\n\t\t\t\tif (emcStatus->motion.spindle[n].direction < 0)\n\t\t\t\t snprintf(context->outBuf, sizeof(context->outBuf), pSpindleStr, n, \"REVERSE\");\n\t\t\telse snprintf(context->outBuf, sizeof(context->outBuf), pSpindleStr, n, \"OFF\");\n\t }\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getBrake(char *s, connectionRecType *context)\n{\n const char *pBrakeStr = \"BRAKE %s\";\n int spindle;\n int n;\n s = strtok(NULL, delims);\n if (sscanf(s, \"%d\", &spindle) < 0) spindle = -1; // no spindle number return all\n for (n = 0; n < emcStatus->motion.traj.spindles; n++){\n\t if (n == spindle || spindle == -1){\n\t\t if (emcStatus->motion.spindle[spindle].brake == 1)\n\t\t\tsnprintf(context->outBuf, sizeof(context->outBuf),pBrakeStr, \"ON\");\n\t\t else snprintf(context->outBuf, sizeof(context->outBuf),pBrakeStr, \"OFF\");\n\t }\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getTool(char *s, connectionRecType *context)\n{\n const char *pToolStr = \"TOOL %d\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pToolStr, emcStatus->io.tool.toolInSpindle);\n return rtNoError;\n}\n\nstatic cmdResponseType getToolOffset(char *s, connectionRecType *context)\n{\n const char *pToolOffsetStr = \"TOOL_OFFSET %f\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pToolOffsetStr, emcStatus->task.toolOffset.tran.z);\n return rtNoError;\n}\n\nstatic cmdResponseType getAbsCmdPos(char *s, connectionRecType *context)\n{\n const char *pAbsCmdPosStr = \"ABS_CMD_POS\";\n char buf[16];\n int axis;\n\n if (s == NULL) axis = -1; // Return all axes\n else axis = atoi(s);\n rtapi_strxcpy(context->outBuf, pAbsCmdPosStr);\n if (axis != -1) {\n snprintf(buf, sizeof(buf), \" %d\", axis);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 0)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.tran.x);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 1)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.tran.y);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 2)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.tran.z);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 3)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.a);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 4)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.b);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 5)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.c);\n rtapi_strxcat(context->outBuf, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getAbsActPos(char *s, connectionRecType *context)\n{\n const char *pAbsActPosStr = \"ABS_ACT_POS\";\n char buf[16];\n int axis;\n\n if (s == NULL) axis = -1; // Return all axes\n else axis = atoi(s);\n rtapi_strxcpy(context->outBuf, pAbsActPosStr);\n if (axis != -1) {\n snprintf(buf, sizeof(buf), \" %d\", axis);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 0)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.tran.x);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 1)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.tran.y);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 2)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.tran.z);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 3)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.a);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 4)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.b);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 5)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.c);\n rtapi_strxcat(context->outBuf, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getRelCmdPos(char *s, connectionRecType *context)\n{\n const char *pRelCmdPosStr = \"REL_CMD_POS\";\n char buf[16];\n int axis;\n\n if (s == NULL) axis = -1; // Return all axes\n else axis = atoi(s);\n rtapi_strxcpy(context->outBuf, pRelCmdPosStr);\n if (axis != -1) {\n snprintf(buf, sizeof(buf), \" %d\", axis);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 0)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.tran.x - emcStatus->task.g5x_offset.tran.x - emcStatus->task.g92_offset.tran.x);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 1)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.tran.y - emcStatus->task.g5x_offset.tran.y - emcStatus->task.g92_offset.tran.y);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 2)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.tran.z - emcStatus->task.g5x_offset.tran.z - emcStatus->task.g92_offset.tran.z);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 3)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.a - emcStatus->task.g5x_offset.a - emcStatus->task.g92_offset.a);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 4)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.b - emcStatus->task.g5x_offset.b - emcStatus->task.g92_offset.b);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 5)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.position.c - emcStatus->task.g5x_offset.c - emcStatus->task.g92_offset.c);\n rtapi_strxcat(context->outBuf, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getRelActPos(char *s, connectionRecType *context)\n{\n const char *pRelActPosStr = \"REL_ACT_POS\";\n char buf[16];\n int axis;\n\n if (s == NULL) axis = -1; // Return all axes\n else axis = atoi(s);\n rtapi_strxcpy(context->outBuf, pRelActPosStr);\n if (axis != -1) {\n snprintf(buf, sizeof(buf), \" %d\", axis);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 0)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.tran.x - emcStatus->task.g5x_offset.tran.x - emcStatus->task.g92_offset.tran.x);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 1)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.tran.y - emcStatus->task.g5x_offset.tran.y - emcStatus->task.g92_offset.tran.y);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 2)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.tran.z - emcStatus->task.g5x_offset.tran.z - emcStatus->task.g92_offset.tran.z);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 3)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.a - emcStatus->task.g5x_offset.a - emcStatus->task.g92_offset.a);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 4)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.b - emcStatus->task.g5x_offset.b - emcStatus->task.g92_offset.b);\n rtapi_strxcat(context->outBuf, buf);\n }\n if ((axis == -1) || (axis == 5)) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.traj.actualPosition.c - emcStatus->task.g5x_offset.c - emcStatus->task.g92_offset.c);\n rtapi_strxcat(context->outBuf, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getJointPos(char *s, connectionRecType *context)\n{\n const char *pJointPos = \"JOINT_POS\";\n int joint, i;\n char buf[16];\n\n if (s == NULL) joint = -1; // Return all axes\n else joint = atoi(s);\n if (joint == -1) {\n rtapi_strxcpy(context->outBuf, pJointPos);\n for (i=0; i<6; i++) {\n snprintf(buf, sizeof(buf), \" %f\", emcStatus->motion.joint[i].input);\n rtapi_strxcat(context->outBuf, buf);\n }\n }\n else\n snprintf(context->outBuf, sizeof(context->outBuf), \"%s %d %f\", pJointPos, joint, emcStatus->motion.joint[joint].input);\n\n return rtNoError;\n}\n\nstatic cmdResponseType getPosOffset(char *s, connectionRecType *context)\n{\n const char *pPosOffset = \"POS_OFFSET\";\n char buf[16];\n\n if (s == NULL) {\n rtapi_strxcpy(context->outBuf, pPosOffset);\n snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.tran.x + emcStatus->task.g92_offset.tran.x));\n rtapi_strxcat(context->outBuf, buf);\n snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.tran.y + emcStatus->task.g92_offset.tran.y));\n rtapi_strxcat(context->outBuf, buf);\n snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.tran.z + emcStatus->task.g92_offset.tran.z));\n rtapi_strxcat(context->outBuf, buf);\n snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.a + emcStatus->task.g92_offset.a));\n rtapi_strxcat(context->outBuf, buf);\n snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.b + emcStatus->task.g92_offset.b));\n rtapi_strxcat(context->outBuf, buf);\n snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.c + emcStatus->task.g92_offset.c));\n rtapi_strxcat(context->outBuf, buf);\n }\n else\n {\n switch (s[0]) {\n case 'X': snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.tran.x + emcStatus->task.g92_offset.tran.x)); break;\n case 'Y': snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.tran.y + emcStatus->task.g92_offset.tran.y)); break;\n case 'Z': snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.tran.z + emcStatus->task.g92_offset.tran.z)); break;\n case 'A':\n case 'R': snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.a + emcStatus->task.g92_offset.a)); break;\n case 'B':\n case 'P': snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.b + emcStatus->task.g92_offset.b)); break;\n case 'C':\n case 'W': snprintf(buf, sizeof(buf), \" %f\", convertLinearUnits(emcStatus->task.g5x_offset.c + emcStatus->task.g92_offset.c));\n }\n snprintf(context->outBuf, sizeof(context->outBuf), \"%s %c %s\", pPosOffset, s[0], buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getJointLimit(char *s, connectionRecType *context)\n{\n const char *pJointLimit = \"JOINT_LIMIT\";\n char buf[16];\n int joint, i;\n\n if (s == NULL) {\n rtapi_strxcpy(context->outBuf, pJointLimit);\n for (i=0; i<6; i++) {\n if (emcStatus->motion.joint[i].minHardLimit)\n rtapi_strxcpy(buf, \" MINHARD\");\n else\n if (emcStatus->motion.joint[i].minSoftLimit)\n\t rtapi_strxcpy(buf, \" MINSOFT\");\n\telse\n\t if (emcStatus->motion.joint[i].maxSoftLimit)\n\t rtapi_strxcpy(buf, \" MAXSOFT\");\n\t else\n\t if (emcStatus->motion.joint[i].maxHardLimit)\n\t rtapi_strxcpy(buf, \" MAXHARD\");\n\t else rtapi_strxcpy(buf, \" OK\");\n rtapi_strxcat(context->outBuf, buf);\n }\n }\n else\n {\n joint = atoi(s);\n if (emcStatus->motion.joint[joint].minHardLimit)\n rtapi_strxcpy(buf, \"MINHARD\");\n else\n if (emcStatus->motion.joint[joint].minSoftLimit)\n\t rtapi_strxcpy(buf, \"MINSOFT\");\n\telse\n\t if (emcStatus->motion.joint[joint].maxSoftLimit)\n\t rtapi_strxcpy(buf, \"MAXSOFT\");\n\t else\n\t if (emcStatus->motion.joint[joint].maxHardLimit)\n\t rtapi_strxcpy(buf, \"MAXHARD\");\n\t else rtapi_strxcpy(buf, \"OK\");\n snprintf(context->outBuf, sizeof(context->outBuf), \"%s %d %s\", pJointLimit, joint, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getJointFault(char *s, connectionRecType *context)\n{\n const char *pJointFault = \"JOINT_FAULT\";\n char buf[16];\n int joint, i;\n\n if (s == NULL) {\n rtapi_strxcpy(context->outBuf, pJointFault);\n for (i=0; i<6; i++) {\n if (emcStatus->motion.joint[i].fault)\n rtapi_strxcat(context->outBuf, \" FAULT\");\n else rtapi_strxcat(context->outBuf, \" OK\");\n }\n }\n else {\n joint = atoi(s);\n if (emcStatus->motion.joint[joint].fault)\n rtapi_strxcpy(buf, \"FAULT\");\n else rtapi_strxcpy(buf, \"OK\");\n snprintf(context->outBuf, sizeof(context->outBuf), \"%s %d %s\", pJointFault, joint, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getOverrideLimits(char *s, connectionRecType *context)\n{\n const char *pOverrideLimits = \"OVERRIDE_LIMITS %d\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pOverrideLimits, emcStatus->motion.joint[0].overrideLimits);\n return rtNoError;\n}\n\nstatic cmdResponseType getJointHomed(char *s, connectionRecType *context)\n{\n const char *pJointHomed = \"JOINT_HOMED\";\n char buf[16];\n int joint, i;\n\n if (s == NULL) {\n rtapi_strxcpy(context->outBuf, pJointHomed);\n for (i=0; i<6; i++) {\n if (emcStatus->motion.joint[i].homed)\n rtapi_strxcat(context->outBuf, \" YES\");\n else rtapi_strxcat(context->outBuf, \" NO\");\n }\n }\n else {\n joint = atoi(s);\n if (emcStatus->motion.joint[joint].homed)\n rtapi_strxcpy(buf, \"YES\");\n else rtapi_strxcpy(buf, \"NO\");\n snprintf(context->outBuf, sizeof(context->outBuf), \"%s %d %s\", pJointHomed, joint, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getProgram(char *s, connectionRecType *context)\n{\n const char *pProgram = \"PROGRAM %s\";\n\n if (emcStatus->task.file[0] != 0)\n snprintf(context->outBuf, sizeof(context->outBuf), pProgram, emcStatus->task.file);\n else\n snprintf(context->outBuf, sizeof(context->outBuf), pProgram, \"NONE\");\n return rtNoError;\n}\n\nstatic cmdResponseType getProgramLine(char *s, connectionRecType *context)\n{\n const char *pProgramLine = \"PROGRAM_LINE %d\";\n int lineNo;\n\n if ((programStartLine< 0) || (emcStatus->task.readLine < programStartLine))\n lineNo = emcStatus->task.readLine;\n else\n if (emcStatus->task.currentLine > 0)\n if ((emcStatus->task.motionLine > 0) &&\n (emcStatus->task.motionLine < emcStatus->task.currentLine))\n\t lineNo = emcStatus->task.motionLine;\n else lineNo = emcStatus->task.currentLine;\n else lineNo = 0;\n snprintf(context->outBuf, sizeof(context->outBuf), pProgramLine, lineNo);\n return rtNoError;\n}\n\nstatic cmdResponseType getProgramStatus(char *s, connectionRecType *context)\n{\n const char *pProgramStatus = \"PROGRAM_STATUS %s\";\n\n switch (emcStatus->task.interpState) {\n case EMC_TASK_INTERP_READING:\n case EMC_TASK_INTERP_WAITING: snprintf(context->outBuf, sizeof(context->outBuf), pProgramStatus, \"RUNNING\"); break;\n case EMC_TASK_INTERP_PAUSED: snprintf(context->outBuf, sizeof(context->outBuf), pProgramStatus, \"PAUSED\"); break;\n default: snprintf(context->outBuf, sizeof(context->outBuf), pProgramStatus, \"IDLE\"); break;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getProgramCodes(char *s, connectionRecType *context)\n{\n const char *pProgramCodes = \"PROGRAM_CODES \";\n char buf[256];\n int code, i;\n\n buf[0] = 0;\n rtapi_strxcpy(context->outBuf, pProgramCodes);\n for (i=1; itask.activeGCodes[i];\n if (code == -1) continue;\n if (code % 10) snprintf(buf, sizeof(buf), \"G%.1f \", (double) code / 10.0);\n else snprintf(buf, sizeof(buf), \"G%d \", code / 10);\n rtapi_strxcat(context->outBuf, buf);\n }\n snprintf(buf, sizeof(buf), \"F%.0f \", emcStatus->task.activeSettings[1]);\n rtapi_strxcat(context->outBuf, buf);\n snprintf(buf, sizeof(buf), \"S%.0f\", fabs(emcStatus->task.activeSettings[2]));\n rtapi_strxcat(context->outBuf, buf);\n return rtNoError;\n}\n\nstatic cmdResponseType getJointType(char *s, connectionRecType *context)\n{\n const char *pJointType = \"JOINT_TYPE\";\n char buf[16];\n int joint, i;\n\n if (s == NULL) {\n rtapi_strxcpy(context->outBuf, pJointType);\n for (i=0; i<6; i++) {\n switch (emcStatus->motion.joint[i].jointType) {\n case EMC_LINEAR: rtapi_strxcat(context->outBuf, \" LINEAR\"); break;\n\tcase EMC_ANGULAR: rtapi_strxcat(context->outBuf, \" ANGULAR\"); break;\n\tdefault: rtapi_strxcat(context->outBuf, \"CUSTOM\");\n\t}\n }\n }\n else {\n joint = atoi(s);\n switch (emcStatus->motion.joint[joint].jointType) {\n case EMC_LINEAR: rtapi_strxcpy(buf, \" LINEAR\"); break;\n\tcase EMC_ANGULAR: rtapi_strxcpy(buf, \" ANGULAR\"); break;\n\tdefault: rtapi_strxcpy(buf, \"CUSTOM\");\n\t}\n snprintf(context->outBuf, sizeof(context->outBuf), \"%s %d %s\", pJointType, joint, buf);\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getJointUnits(char *s, connectionRecType *context)\n{\n const char *pJointUnits = \"JOINT_UNITS\";\n char buf[16];\n int joint, i;\n\n if (s == NULL) {\n rtapi_strxcpy(context->outBuf, pJointUnits);\n for (i=0; i<6; i++) {\n switch (emcStatus->motion.joint[i].jointType) {\n case EMC_LINEAR:\n\t if (CLOSE(emcStatus->motion.joint[i].units, 1.0, LINEAR_CLOSENESS))\n\t rtapi_strxcat(context->outBuf, \" MM\");\n\t else\n\t if (CLOSE(emcStatus->motion.joint[i].units, INCH_PER_MM,\n\t LINEAR_CLOSENESS)) rtapi_strxcat(context->outBuf, \" INCH\");\n\t else\n\t if (CLOSE(emcStatus->motion.joint[i].units, CM_PER_MM,\n\t LINEAR_CLOSENESS)) rtapi_strxcat(context->outBuf, \" CM\");\n\t else rtapi_strxcat(context->outBuf, \" CUSTOM\");\n\t break;\n\tcase EMC_ANGULAR:\n\t if (CLOSE(emcStatus->motion.joint[i].units, 1.0, ANGULAR_CLOSENESS))\n\t rtapi_strxcat(context->outBuf, \" DEG\");\n\t else\n \t if (CLOSE(emcStatus->motion.joint[i].units, RAD_PER_DEG, ANGULAR_CLOSENESS))\n\t rtapi_strxcat(context->outBuf, \" RAD\");\n\t else\n\t if (CLOSE(emcStatus->motion.joint[i].units, GRAD_PER_DEG, ANGULAR_CLOSENESS))\n\t rtapi_strxcat(context->outBuf, \" GRAD\");\n\t else rtapi_strxcat(context->outBuf, \" CUSTOM\");\n\t break;\n\tdefault: rtapi_strxcat(context->outBuf, \" CUSTOM\");\n\t}\n }\n }\n else {\n joint = atoi(s);\n switch (emcStatus->motion.joint[joint].jointType) {\n case EMC_LINEAR:\n\t if (CLOSE(emcStatus->motion.joint[joint].units, 1.0, LINEAR_CLOSENESS))\n\t rtapi_strxcpy(buf, \"MM\");\n\t else\n\t if (CLOSE(emcStatus->motion.joint[joint].units, INCH_PER_MM,\n\t LINEAR_CLOSENESS)) rtapi_strxcpy(buf, \"INCH\");\n\t else\n\t if (CLOSE(emcStatus->motion.joint[joint].units, CM_PER_MM,\n\t LINEAR_CLOSENESS)) rtapi_strxcpy(buf, \"CM\");\n\t else rtapi_strxcpy(buf, \"CUSTOM\");\n\t break;\n\tcase EMC_ANGULAR:\n\t if (CLOSE(emcStatus->motion.joint[joint].units, 1.0, ANGULAR_CLOSENESS))\n\t rtapi_strxcpy(buf, \"DEG\");\n\t else\n \t if (CLOSE(emcStatus->motion.joint[joint].units, RAD_PER_DEG, ANGULAR_CLOSENESS))\n\t rtapi_strxcpy(buf, \"RAD\");\n\t else\n\t if (CLOSE(emcStatus->motion.joint[joint].units, GRAD_PER_DEG, ANGULAR_CLOSENESS))\n\t rtapi_strxcpy(buf, \"GRAD\");\n\t else rtapi_strxcpy(buf, \"CUSTOM\");\n\t break;\n\tdefault: rtapi_strxcpy(buf, \"CUSTOM\");\n snprintf(context->outBuf, sizeof(context->outBuf), \"%s %d %s\", pJointUnits, joint, buf);\n }\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getProgramLinearUnits(char *s, connectionRecType *context)\n{\n const char *programUnits = \"PROGRAM_UNITS %s\";\n\n switch (emcStatus->task.programUnits) {\n case CANON_UNITS_INCHES: snprintf(context->outBuf, sizeof(context->outBuf), programUnits, \"INCH\"); break;\n case CANON_UNITS_MM: snprintf(context->outBuf, sizeof(context->outBuf), programUnits, \"MM\"); break;\n case CANON_UNITS_CM: snprintf(context->outBuf, sizeof(context->outBuf), programUnits, \"CM\"); break;\n default: snprintf(context->outBuf, sizeof(context->outBuf), programUnits, \"CUSTOM\"); break;\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getProgramAngularUnits(char *s, connectionRecType *context)\n{\n const char *programAngularUnits = \"PROGRAM_ANGULAR_UNITS %s\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), programAngularUnits, \"DEG\");\n return rtNoError;\n}\n\nstatic cmdResponseType getUserLinearUnits(char *s, connectionRecType *context)\n{\n const char *userLinearUnits = \"USER_LINEAR_UNITS %s\";\n\n if (CLOSE(emcStatus->motion.traj.linearUnits, 1.0, LINEAR_CLOSENESS))\n snprintf(context->outBuf, sizeof(context->outBuf), userLinearUnits, \"MM\");\n else\n if (CLOSE(emcStatus->motion.traj.linearUnits, INCH_PER_MM, LINEAR_CLOSENESS))\n snprintf(context->outBuf, sizeof(context->outBuf), userLinearUnits, \"INCH\");\n else\n if (CLOSE(emcStatus->motion.traj.linearUnits, CM_PER_MM, LINEAR_CLOSENESS))\n snprintf(context->outBuf, sizeof(context->outBuf), userLinearUnits, \"CM\");\n else\n snprintf(context->outBuf, sizeof(context->outBuf), userLinearUnits, \"CUSTOM\");\n return rtNoError;\n}\n\nstatic cmdResponseType getUserAngularUnits(char *s, connectionRecType *context)\n{\n const char *pUserAngularUnits = \"USER_ANGULAR_UNITS %s\";\n\n if (CLOSE(emcStatus->motion.traj.angularUnits, 1.0, ANGULAR_CLOSENESS))\n snprintf(context->outBuf, sizeof(context->outBuf), pUserAngularUnits, \"DEG\");\n else\n if (CLOSE(emcStatus->motion.traj.angularUnits, RAD_PER_DEG, ANGULAR_CLOSENESS))\n snprintf(context->outBuf, sizeof(context->outBuf), pUserAngularUnits, \"RAD\");\n else\n if (CLOSE(emcStatus->motion.traj.angularUnits, GRAD_PER_DEG, ANGULAR_CLOSENESS))\n snprintf(context->outBuf, sizeof(context->outBuf), pUserAngularUnits, \"GRAD\");\n else\n snprintf(context->outBuf, sizeof(context->outBuf), pUserAngularUnits, \"CUSTOM\");\n return rtNoError;\n}\n\nstatic cmdResponseType getDisplayLinearUnits(char *s, connectionRecType *context)\n{\n const char *pDisplayLinearUnits = \"DISPLAY_LINEAR_UNITS %s\";\n\n switch (linearUnitConversion) {\n case LINEAR_UNITS_INCH: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"INCH\"); break;\n case LINEAR_UNITS_MM: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"MM\"); break;\n case LINEAR_UNITS_CM: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"CM\"); break;\n case LINEAR_UNITS_AUTO:\n switch (emcStatus->task.programUnits) {\n\t case CANON_UNITS_MM: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"MM\"); break;\n\t case CANON_UNITS_INCHES: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"INCH\"); break;\n\t case CANON_UNITS_CM: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"\"); break;\n\t default: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"CUSTOM\");\n\t }\n break;\n default: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayLinearUnits, \"CUSTOM\");\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getDisplayAngularUnits(char *s, connectionRecType *context)\n{\n const char *pDisplayAngularUnits = \"DISPLAY_ANGULAR_UNITS %s\";\n\n switch (angularUnitConversion) {\n case ANGULAR_UNITS_DEG: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayAngularUnits, \"DEG\"); break;\n case ANGULAR_UNITS_RAD: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayAngularUnits, \"RAD\"); break;\n case ANGULAR_UNITS_GRAD: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayAngularUnits, \"GRAD\"); break;\n case ANGULAR_UNITS_AUTO: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayAngularUnits, \"DEG\"); break;\n default: snprintf(context->outBuf, sizeof(context->outBuf), pDisplayAngularUnits, \"CUSTOM\");\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getLinearUnitConversion(char *s, connectionRecType *context)\n{\n const char *pLinearUnitConversion = \"LINEAR_UNIT_CONVERSION %s\";\n\n switch (linearUnitConversion) {\n case LINEAR_UNITS_INCH: snprintf(context->outBuf, sizeof(context->outBuf), pLinearUnitConversion, \"INCH\"); break;\n case LINEAR_UNITS_MM: snprintf(context->outBuf, sizeof(context->outBuf), pLinearUnitConversion, \"MM\"); break;\n case LINEAR_UNITS_CM: snprintf(context->outBuf, sizeof(context->outBuf), pLinearUnitConversion, \"CM\"); break;\n case LINEAR_UNITS_AUTO: snprintf(context->outBuf, sizeof(context->outBuf), pLinearUnitConversion, \"AUTO\"); break;\n default: snprintf(context->outBuf, sizeof(context->outBuf), pLinearUnitConversion, \"CUSTOM\");\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getAngularUnitConversion(char *s, connectionRecType *context)\n{\n const char *pAngularUnitConversion = \"ANGULAR_UNIT_CONVERSION %s\";\n\n switch (angularUnitConversion) {\n case ANGULAR_UNITS_DEG: snprintf(context->outBuf, sizeof(context->outBuf), pAngularUnitConversion, \"DEG\"); break;\n case ANGULAR_UNITS_RAD: snprintf(context->outBuf, sizeof(context->outBuf), pAngularUnitConversion, \"RAD\"); break;\n case ANGULAR_UNITS_GRAD: snprintf(context->outBuf, sizeof(context->outBuf), pAngularUnitConversion, \"GRAD\"); break;\n case ANGULAR_UNITS_AUTO: snprintf(context->outBuf, sizeof(context->outBuf), pAngularUnitConversion, \"AUTO\"); break;\n default: snprintf(context->outBuf, sizeof(context->outBuf), pAngularUnitConversion, \"CUSTOM\");\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getProbeValue(char *s, connectionRecType *context)\n{\n const char *pProbeValue = \"PROBE_VALUE %d\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pProbeValue, emcStatus->motion.traj.probeval);\n return rtNoError;\n}\n\nstatic cmdResponseType getProbeTripped(char *s, connectionRecType *context)\n{\n const char *pProbeTripped = \"PROBE_TRIPPED %d\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pProbeTripped, emcStatus->motion.traj.probe_tripped);\n return rtNoError;\n}\n\nstatic cmdResponseType getTeleopEnable(char *s, connectionRecType *context)\n{\n const char *pTeleopEnable = \"TELEOP_ENABLE %s\";\n\n if (emcStatus->motion.traj.mode == EMC_TRAJ_MODE_TELEOP)\n snprintf(context->outBuf, sizeof(context->outBuf), pTeleopEnable, \"YES\");\n else snprintf(context->outBuf, sizeof(context->outBuf), pTeleopEnable, \"NO\");\n return rtNoError;\n}\n\nstatic cmdResponseType getKinematicsType(char *s, connectionRecType *context)\n{\n const char *pKinematicsType = \"KINEMATICS_TYPE %d\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pKinematicsType, emcStatus->motion.traj.kinematics_type);\n return rtNoError;\n}\n\nstatic cmdResponseType getFeedOverride(char *s, connectionRecType *context)\n{\n const char *pFeedOverride = \"FEED_OVERRIDE %d\";\n int percent;\n\n percent = (int)floor(emcStatus->motion.traj.scale * 100.0 + 0.5);\n snprintf(context->outBuf, sizeof(context->outBuf), pFeedOverride, percent);\n return rtNoError;\n}\n\nstatic cmdResponseType getIniFile(char *s, connectionRecType *context)\n{\n const char *pIniFile = \"INIFILE %s\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pIniFile, emc_inifile);\n return rtNoError;\n}\n\nstatic cmdResponseType getSpindleOverride(char *s, connectionRecType *context)\n{\n const char *pSpindleOverride = \"SPINDLE_OVERRIDE %d %d\";\n int percent;\n int spindle;\n int n;\n s = strtok(NULL, delims);\n if (sscanf(s, \"%d\", &spindle) < 0) spindle = -1; // no spindle number return all\n for (n = 0; n < emcStatus->motion.traj.spindles; n++){\n\t if (n == spindle || spindle == -1){\n\t\t percent = (int)floor(emcStatus->motion.spindle[n].spindle_scale * 100.0 + 0.5);\n\t\t snprintf(context->outBuf, sizeof(context->outBuf),pSpindleOverride, n, percent);\n\t }\n }\n return rtNoError;\n}\n\nstatic cmdResponseType getOptionalStop(char *s, connectionRecType *context)\n{\n const char *pOptionalStop = \"OPTIONAL_STOP %d\";\n\n snprintf(context->outBuf, sizeof(context->outBuf), pOptionalStop, emcStatus->task.optional_stop_state);\n return rtNoError;\n}\n\nint commandGet(connectionRecType *context)\n{\n const static char *setNakStr = \"GET NAK\\r\\n\";\n const static char *setCmdNakStr = \"GET %s NAK\\r\\n\";\n setCommandType cmd;\n char *pch;\n cmdResponseType ret = rtNoError;\n\n pch = strtok(NULL, delims);\n if (pch == NULL) {\n return write(context->cliSock, setNakStr, strlen(setNakStr));\n }\n if (emcUpdateType == EMC_UPDATE_AUTO) updateStatus();\n strupr(pch);\n cmd = lookupSetCommand(pch);\n if (cmd > scIni)\n if (emcUpdateType == EMC_UPDATE_AUTO) updateStatus();\n switch (cmd) {\n case scEcho: ret = getEcho(pch, context); break;\n case scVerbose: ret = getVerbose(pch, context); break;\n case scEnable: ret = getEnable(pch, context); break;\n case scConfig: ret = getConfig(pch, context); break;\n case scCommMode: ret = getCommMode(pch, context); break;\n case scCommProt: ret = getCommProt(pch, context); break;\n case scIniFile: getIniFile(pch, context); break;\n case scPlat: ret = getPlat(pch, context); break;\n case scIni: break;\n case scDebug: ret = getDebug(pch, context); break;\n case scSetWait: ret = getSetWait(pch, context); break;\n case scWait: break;\n case scSetTimeout: ret = getTimeout(pch, context); break;\n case scUpdate: break;\n case scError: ret = getError(pch, context); break;\n case scOperatorDisplay: ret = getOperatorDisplay(pch, context); break;\n case scOperatorText: ret = getOperatorText(pch, context); break;\n case scTime: ret = getTime(pch, context); break;\n case scEStop: ret = getEStop(pch, context); break;\n case scMachine: ret = getMachine(pch, context); break;\n case scMode: ret = getMode(pch, context); break;\n case scMist: ret = getMist(pch, context); break;\n case scFlood: ret = getFlood(pch, context); break;\n case scLube: ret = getLube(pch, context); break;\n case scLubeLevel: ret = getLubeLevel(pch, context); break;\n case scSpindle: ret = getSpindle(pch, context); break;\n case scBrake: ret = getBrake(pch, context); break;\n case scTool: ret = getTool(pch, context); break;\n case scToolOffset: ret = getToolOffset(pch, context); break;\n case scLoadToolTable: ret = rtStandardError; break;\n case scHome: ret = rtStandardError; break;\n case scJogStop: ret = rtStandardError; break;\n case scJog: ret = rtStandardError; break;\n case scJogIncr: ret = rtStandardError; break;\n case scFeedOverride: ret = getFeedOverride(pch, context); break;\n case scAbsCmdPos: ret = getAbsCmdPos(strtok(NULL, delims), context); break;\n case scAbsActPos: ret = getAbsActPos(strtok(NULL, delims), context); break;\n case scRelCmdPos: ret = getRelCmdPos(strtok(NULL, delims), context); break;\n case scRelActPos: ret = getRelActPos(strtok(NULL, delims), context); break;\n case scJointPos: ret = getJointPos(strtok(NULL, delims), context); break;\n case scPosOffset: ret = getPosOffset(strtok(NULL, delims), context); break;\n case scJointLimit: ret = getJointLimit(strtok(NULL, delims), context); break;\n case scJointFault: ret = getJointFault(strtok(NULL, delims), context); break;\n case scJointHomed: ret = getJointHomed(strtok(NULL, delims), context); break;\n case scMDI: ret = rtStandardError; break;\n case scTskPlanInit: ret = rtStandardError; break;\n case scOpen: ret = rtStandardError; break;\n case scRun: ret = rtStandardError; break;\n case scPause: ret = rtStandardError; break;\n case scResume: ret = rtStandardError; break;\n case scStep: ret = rtStandardError; break;\n case scAbort: ret = rtStandardError; break;\n case scProgram: ret = getProgram(pch, context); break;\n case scProgramLine: ret = getProgramLine(pch, context); break;\n case scProgramStatus: ret = getProgramStatus(pch, context); break;\n case scProgramCodes: ret = getProgramCodes(pch, context); break;\n case scJointType: ret = getJointType(strtok(NULL, delims), context); break;\n case scJointUnits: ret = getJointUnits(strtok(NULL, delims), context); break;\n case scProgramUnits:\n case scProgramLinearUnits: ret = getProgramLinearUnits(pch, context); break;\n case scProgramAngularUnits: ret = getProgramAngularUnits(pch, context); break;\n case scUserLinearUnits: ret = getUserLinearUnits(pch, context); break;\n case scUserAngularUnits: ret = getUserAngularUnits(pch, context); break;\n case scDisplayLinearUnits: ret = getDisplayLinearUnits(pch, context); break;\n case scDisplayAngularUnits: ret = getDisplayAngularUnits(pch, context); break;\n case scLinearUnitConversion: ret = getLinearUnitConversion(pch, context); break;\n case scAngularUnitConversion: ret = getAngularUnitConversion(pch, context); break;\n case scProbeClear: break;\n case scProbeTripped: ret = getProbeTripped(pch, context); break;\n case scProbeValue: ret = getProbeValue(pch, context); break;\n case scProbe: break;\n case scTeleopEnable: ret = getTeleopEnable(pch, context); break;\n case scKinematicsType: ret = getKinematicsType(pch, context); break;\n case scOverrideLimits: ret = getOverrideLimits(pch, context); break;\n case scSpindleOverride: ret = getSpindleOverride(pch, context); break;\n case scOptionalStop: ret = getOptionalStop(pch, context); break;\n case scUnknown: ret = rtStandardError;\n }\n switch (ret) {\n case rtNoError: // Standard ok response, just write value in buffer\n sockWrite(context);\n break;\n case rtHandledNoError: // Custom ok response already handled, take no action\n break;\n case rtStandardError: // Standard error response\n snprintf(context->outBuf, sizeof(context->outBuf), setCmdNakStr, pch);\n sockWrite(context);\n break;\n case rtCustomError: // Custom error response entered in buffer\n sockWrite(context);\n break;\n case rtCustomHandledError: ;// Custom error response handled, take no action\n }\n return 0;\n}\n\nint commandQuit(connectionRecType *context)\n{\n printf(\"Closing connection with %s\\n\", context->hostName);\n return -1;\n}\n\nint commandShutdown(connectionRecType *context)\n{\n if (context->cliSock == enabledConn) {\n printf(\"Shutting down\\n\");\n thisQuit();\n return -1;\n }\n else\n return 0;\n}\n\nstatic int helpGeneral(connectionRecType *context)\n{\n snprintf(context->outBuf, sizeof(context->outBuf), \"Available commands:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Hello \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Get \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Set \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Shutdown\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Help \\n\\r\");\n sockWrite(context);\n return 0;\n}\n\nstatic int helpHello(connectionRecType *context)\n{\n snprintf(context->outBuf, sizeof(context->outBuf), \"Usage:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Hello \\n\\rWhere:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Password is the connection password to allow communications with the CNC server.\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Client Name is the name of client trying to connect, typically the network name of the client.\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Protocol Version is the version of the protocol with which the client wishes to use.\\n\\r\\n\\r\");\n rtapi_strxcat(context->outBuf, \" With valid password, server responds with:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Hello Ack \\n\\rWhere:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Ack is acknowledging the connection has been made.\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Server Name is the name of the LinuxCNC Server to which the client has connected.\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Protocol Version is the client requested version or latest version support by server if\");\n rtapi_strxcat(context->outBuf, \" the client requests a version later than that supported by the server.\\n\\r\\n\\r\");\n rtapi_strxcat(context->outBuf, \" With invalid password, the server responds with:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Hello Nak\\n\\r\");\n sockWrite(context);\n return 0;\n}\n\nstatic int helpGet(connectionRecType *context)\n{\n snprintf(context->outBuf, sizeof(context->outBuf), \"Usage:\\n\\rGet \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Get commands require that a hello has been successfully negotiated.\\n\\r\");\n rtapi_strxcat(context->outBuf, \" LinuxCNC command may be one of:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Abs_act_pos\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Abs_cmd_pos\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Angular_unit_conversion\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Brake\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Comm_mode\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Comm_prot\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Debug\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Display_angular_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Display_linear_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Echo\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Enable\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Error\\n\\r\");\n rtapi_strxcat(context->outBuf, \" EStop\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Feed_override\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Flood\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Inifile\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Joint_fault\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Joint_homed\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Joint_limit\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Joint_pos\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Joint_type\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Joint_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Kinematics_type\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Linear_unit_conversion\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Lube\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Lube_level\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Machine\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Mist\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Mode\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Operator_display\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Operator_text\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Optional_stop\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Override_limits\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Plat\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Pos_offset\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Probe_tripped\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Probe_value\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Program\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Program_angular_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Program_codes\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Program_line\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Program_linear_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Program_status\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Program_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Rel_act_pos\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Rel_cmd_pos\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Set_wait\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Spindle\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Spindle_override\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Teleop_enable\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Time\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Timeout\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Tool\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Tool_offset\\n\\r\");\n rtapi_strxcat(context->outBuf, \" User_angular_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" User_linear_units\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Verbose\\n\\r\");\n// rtapi_strxcat(context->outBuf, \"CONFIG\\n\\r\");\n sockWrite(context);\n return 0;\n}\n\nstatic int helpSet(connectionRecType *context)\n{\n snprintf(context->outBuf, sizeof(context->outBuf), \"Usage:\\n\\r Set \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Set commands require that a hello has been successfully negotiated,\\n\\r\");\n rtapi_strxcat(context->outBuf, \" in most instances requires that control be enabled by the connection.\\n\\r\");\n rtapi_strxcat(context->outBuf, \" The set commands not requiring control enabled are:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Comm_mode \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Comm_prot \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Echo \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Enable \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Verbose \\n\\r\\n\\r\");\n rtapi_strxcat(context->outBuf, \" The set commands requiring control enabled are:\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Abort\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Angular_unit_conversion \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Brake \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Debug \\n\\r\");\n rtapi_strxcat(context->outBuf, \" EStop \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Feed_override \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Flood \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Home \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Jog \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Jog_incr \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Jog_stop\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Linear_unit_conversion \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Load_tool_table \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Lube \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Machine \\n\\r\");\n rtapi_strxcat(context->outBuf, \" MDI \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Mist \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Mode \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Open \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Optional_stop \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Override_limits \\n\\r\");\n rtapi_strxcat(context->outBuf, \" Pause\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Probe\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Probe_clear\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Resume\\n\\r\");\n rtapi_strxcat(context->outBuf, \" Run \\n\\r\");\n rtapi_strxcat(context->outBuf, \" SetWait