Jump to content
Toggle sidebar
FreeCAD Documentation
Search
English
Log in
Personal tools
Log in
Index
Overview
Features
Screenshots
Download
FAQ
Forum
Tracker
General usage
User Hub
Manual
Tutorials
Installing
Getting started
Navigation styles
Customizing FreeCAD
Commands list
Workbenches
Workbenches list
Arch
Assembly
CAM/Path
Draft
FEM
Mesh
OpenSCAD
Part
PartDesign
Points
Robot
Sketcher
Spreadsheet
Surface
TechDraw
External workbenches
Python scripting
Powerusers hub
Discovering Python
Python in FreeCAD
Macros
Mesh scripting
Part scripting
Pivy
PySide
Parametric objects
Code examples
Python API
Development
Developers hub
How to contribute
Git repository
Compiling
License details
Organization chart
Startup options
Branding
Translating
Help & Feedback
Forum
Bugs tracker
IRC channel
Facebook
Twitter
Mastodon
Meta
Recent changes
Random page
Links
Tools
Special pages
Printable version
Export translations
Translate
English
Language statistics
Message group statistics
Export
More
Language statistics
Message group statistics
Export
Settings
Group
3D input devices
3D view
3Dconnexion input devices
A2plus Workbench
About FreeCAD
Add Button to FEM Toolbar Tutorial
Add FEM Constraint Tutorial
Add FEM Equation Tutorial
Add Workbench to Addon Manager
Addon
Advanced Attachment OYX
Advanced TechDraw Tutorial
Aeroplane
Analysis of reinforced concrete with FEM
Animation Workbench
ANSI templates
App DocumentObject
App DocumentObjectGroup
App FeaturePython
App GeoFeature
App Link
App OriginGroupExtension
App Part
AppImage
Arch 3DS
Arch 3Views
Arch Add
Arch API
Arch Axis
Arch AxisSystem
Arch Building
Arch BuildingPart
Arch Check
Arch CloneComponent
Arch CloseHoles
Arch CompAxis
Arch Component
Arch CompPanel
Arch CompPipe
Arch CompRebarStraight
Arch CompSetMaterial
Arch CurtainWall
Arch CutLine
Arch CutPlane
Arch DAE
Arch Door
Arch Equipment
Arch Fence
Arch Floor
Arch Frame
Arch Grid
Arch IFC
Arch IfcExplorer
Arch IfcSpreadsheet
Arch JSON
Arch MergeWalls
Arch MeshToShape
Arch MultiMaterial
Arch Nest
Arch OBJ
Arch Panel
Arch Panel Cut
Arch Panel Sheet
Arch panel tutorial
Arch Pipe
Arch PipeConnector
Arch Preferences
Arch Profile
Arch Project
Arch Rebar
Arch Reference
Arch Remove
Arch RemoveShape
Arch Roof
Arch Schedule
Arch SectionPlane
Arch SelectNonSolidMeshes
Arch SetMaterial
Arch SHP
Arch Site
Arch Space
Arch SplitMesh
Arch Stairs
Arch Structure
Arch Survey
Arch templates
Arch ToggleIfcBrepFlag
Arch ToggleSubs
Arch Truss
Arch tutorial
Arch Wall
Arch Window
Arch Workbench
Artwork
Artwork Arch
Artwork Assembly
Artwork Assembly3
Artwork CAM
Artwork Draft
Artwork Fem
Artwork Gui
Artwork Guidelines
Artwork Inspection
Artwork Material
Artwork Mesh
Artwork MeshPart
Artwork OpenSCAD
Artwork Part
Artwork PartDesign
Artwork Plot
Artwork Points
Artwork Reinforcement
Artwork Render
Artwork ReverseEngineering
Artwork Robot
Artwork Ship
Artwork Sketcher
Artwork Splash screen
Artwork Spreadsheet
Artwork Start
Artwork Surface
Artwork TechDraw
Artwork Test
Artwork Tux
Artwork Web
Assembly
Assembly Workbench
Assembly2 Workbench
Assembly3 AddOrigin
Assembly3 AddPlacement
Assembly3 AddWorkplane
Assembly3 AddXZWorkplane
Assembly3 AddZYWorkplane
Assembly3 AutoElementVisibility
Assembly3 AutoFixElement
Assembly3 AutoRecompute
Assembly3 AxialMove
Assembly3 ConstraintAlignment
Assembly3 ConstraintAngle
Assembly3 ConstraintArcLineTangent
Assembly3 ConstraintAttachment
Assembly3 ConstraintAttachmentOffset
Assembly3 ConstraintAxial
Assembly3 ConstraintCoincidence
Assembly3 ConstraintColinear
Assembly3 ConstraintDiameter
Assembly3 ConstraintEqualAngle
Assembly3 ConstraintEqualLength
Assembly3 ConstraintEqualLineArcLength
Assembly3 ConstraintEqualPointLineDistance
Assembly3 ConstraintEqualRadius
Assembly3 ConstraintLengthDifference
Assembly3 ConstraintLengthEqualPointLineDistance
Assembly3 ConstraintLengthRatio
Assembly3 ConstraintLineHorizontal
Assembly3 ConstraintLineLength
Assembly3 ConstraintLineVertical
Assembly3 ConstraintLock
Assembly3 ConstraintMidPoint
Assembly3 ConstraintMore
Assembly3 ConstraintMultiParallel
Assembly3 ConstraintPerpendicular
Assembly3 ConstraintPointDistance
Assembly3 ConstraintPointInPlane
Assembly3 ConstraintPointLineDistance
Assembly3 ConstraintPointOnCircle
Assembly3 ConstraintPointOnLine
Assembly3 ConstraintPointPlaneDistance
Assembly3 ConstraintPointsCoincident
Assembly3 ConstraintPointsDistance
Assembly3 ConstraintPointsHorizontal
Assembly3 ConstraintPointsProjectDistance
Assembly3 ConstraintPointsSymmetric
Assembly3 ConstraintPointsVertical
Assembly3 ConstraintSameOrientation
Assembly3 ConstraintSketchPlane
Assembly3 ConstraintSymmetric
Assembly3 ConstraintSymmetricHorizontal
Assembly3 ConstraintSymmetricLine
Assembly3 ConstraintSymmetricVertical
Assembly3 CreateAssembly
Assembly3 CreateElement
Assembly3 GoToRelation
Assembly3 GroupObjects
Assembly3 ImportFromSTEP
Assembly3 ImportMultiDocument
Assembly3 LockMover
Assembly3 MeasureAngle
Assembly3 MeasurePointLine
Assembly3 MeasurePointPlane
Assembly3 MeasurePoints
Assembly3 MoveItemDown
Assembly3 MoveItemUp
Assembly3 MovePart
Assembly3 MultiplyConstraint
Assembly3 QuickMove
Assembly3 QuickSolve
Assembly3 ResolveConstraints
Assembly3 ShowElementCS
Assembly3 SmartRecompute
Assembly3 TogglePartVisibility
Assembly3 TracePartMove
Assembly3 Workbench
Assembly4 Workbench
Asymptote
B-Splines
Base API
Basic Attachment Tutorial
Basic modeling tutorial
Basic Part Design Tutorial
Basic Part Design Tutorial 019
Basic Sketcher Tutorial
Basic TechDraw Tutorial
BIM application compatibility table
BIM Box
BIM Classification
BIM Clone
BIM Copy
BIM IfcElements
BIM IfcProperties
BIM IfcQuantities
BIM ingame tutorial
BIM Layers
BIM Library
BIM Preflight
BIM Project
BIM Setup
BIM Views
BIM Windows
BIM Workbench
Bitmap
Body
BOLTSFC Workbench
Books
Branding
Builtin modules
CadQuery Workbench
CAM Adaptive
CAM Area
CAM Area Workplane
CAM Array
CAM Comment
CAM Copy
CAM Custom
CAM Deburr
CAM DressupAxisMap
CAM DressupDogbone
CAM DressupDragKnife
CAM DressupLeadInOut
CAM DressupPathBoundary
CAM DressupRampEntry
CAM DressupTag
CAM DressupZCorrect
CAM Drilling
CAM Engrave
CAM experimental
CAM ExportTemplate
CAM FAQ
CAM Fixture
CAM fourth axis
CAM Helix
CAM Inspect
CAM Job
CAM MillFace
CAM OpActiveToggle
CAM Pocket 3D
CAM Pocket Shape
CAM Post
CAM Postprocessor Customization
CAM Preferences
CAM Probe
CAM Profile
CAM Sanity
CAM scripting
CAM SelectLoop
CAM SetupSheet
CAM Shape
CAM SimpleCopy
CAM Simulator
CAM Slot
CAM Stop
CAM Surface
CAM ThreadMilling
CAM ToolBit
CAM ToolBit Library
CAM ToolBitDock
CAM ToolBitLibraryOpen
CAM ToolController
CAM Tools
CAM ToolShape
CAM Vcarve
CAM Walkthrough for the Impatient
CAM Waterline
CAM Workbench
Cfd Workbench
Changelog
Civil Engineering Workbench
Code snippets
Coin3d snippets
Combo view
Command
Common Airfoil Data Import
Compile on Docker
Compile on Linux
Compile on MacOS
Compile on MinGW
Compile on Windows
CompileOnWindows - Reducing Disk Footprint
Compiling
Compiling (Speeding up)
Conda
Console API
Constructive solid geometry
Continuous Integration
Contributors
Copying Objects
Create a FeaturePython object part I
Create a FeaturePython object part II
Creating a simple part with Draft and Part WB
Creating a simple part with Part WB
Creating a simple part with PartDesign
Crowdin Administration
Crowdin Scripts
CurvedShapes CurvedArray
CurvedShapes Workbench
Curves CompressionSpring
Curves Discretize
Curves EditableSpline
Curves ExtendCurve
Curves GordonSurface
Curves Interpolate
Curves IsoCurve
Curves JoinCurve
Curves Line
Curves MultiLoft
Curves ParametricComb
Curves ParametricSolid
Curves PasteSVG
Curves Pipeshell
Curves PipeshellProfile
Curves ProfileSupport
Curves ReflectLines
Curves SegmentSurface
Curves SketchOnSurface
Curves SplitCurve
Curves ToConsole
Curves Workbench
Curves ZebraTool
Custom icon in tree view
Customize Toolbars
DAG view
Datum
Debian development
Debian Unstable
Debugging
Defeaturing
Defeaturing Workbench
Developer hub
Developing FreeCAD with GitKraken
Developing FreeCAD with KDevelop
Development roadmap
Dialog creation
Dialog creation image and animated GIF
Dialog creation reading and writing files
Dialog creation setting colors
Dialog creation with various widgets
Document structure
Donate
Download
Doxygen
Draft AddConstruction
Draft AddNamedGroup
Draft AddToGroup
Draft annotation scale widget
Draft AnnotationStyleEditor
Draft API
Draft ApplyStyle
Draft Arc
Draft Arc 3Points
Draft Array
Draft AutoGroup
Draft BezCurve
Draft BSpline
Draft Circle
Draft CircularArray
Draft Clone
Draft Constrain
Draft CubicBezCurve
Draft DAT
Draft Dimension
Draft Downgrade
Draft Draft2Sketch
Draft Drawing
Draft DXF
Draft Edit
Draft Ellipse
Draft Facebinder
Draft Fillet
Draft FlipDimension
Draft Hatch
Draft Heal
Draft Join
Draft Label
Draft Layer
Draft LayerManager
Draft Line
Draft Mirror
Draft Move
Draft OCA
Draft Offset
Draft OrthoArray
Draft PathArray
Draft PathLinkArray
Draft Pattern
Draft Point
Draft PointArray
Draft PointLinkArray
Draft PolarArray
Draft Polygon
Draft Preferences
Draft Rectangle
Draft Rotate
Draft Scale
Draft SelectGroup
Draft SelectPlane
Draft SetStyle
Draft Shape2DView
Draft ShapeString
Draft ShapeString tutorial
Draft ShowSnapBar
Draft Slope
Draft Snap
Draft Snap Angle
Draft Snap Center
Draft Snap Dimensions
Draft Snap Endpoint
Draft Snap Extension
Draft Snap Grid
Draft Snap Intersection
Draft Snap Lock
Draft Snap Midpoint
Draft Snap Near
Draft Snap Ortho
Draft Snap Parallel
Draft Snap Perpendicular
Draft Snap Special
Draft snap widget
Draft Snap WorkingPlane
Draft Split
Draft Stretch
Draft SubelementHighlight
Draft SVG
Draft Text
Draft ToggleConstructionMode
Draft ToggleContinueMode
Draft ToggleDisplayMode
Draft ToggleGrid
Draft Tray
Draft Trimex
Draft tutorial
Draft Upgrade
Draft Wire
Draft WireToBSpline
Draft Workbench
Draft WorkingPlaneProxy
Drawing
Drawing Annotation
Drawing API example
Drawing Clip
Drawing Dimensioning Addon
Drawing Documentation
Drawing Landscape A3
Drawing Open SVG
Drawing Openbrowser
Drawing Orthoviews
Drawing ProjectShape
Drawing Save
Drawing SpreadsheetView
Drawing Symbol
Drawing Template HowTo
Drawing templates
Drawing tutorial
Drawing View
Drawing Workbench
DXF
DynamicData Workbench
EM FHEquiv
EM FHInputFile
EM FHNode
EM FHPath
EM FHPlane
EM FHPlaneAddRemoveNodeHole
EM FHPlaneHole
EM FHPort
EM FHSegment
EM FHSolver
EM Workbench
Embedding FreeCAD
Embedding FreeCADGui
Engine Block Tutorial
Example Combined Footing
Example Slab Having LShape Rebars Reinforcement Mesh
Example Slab Having Mesh Of Straight Rebars
Example Slab Having UShape Rebars Reinforcement Mesh
Example Slab Spanning in One Direction
Example Slab Spanning in Two Directions
ExplodedAssembly Workbench
Export to STL or OBJ
Expressions
Extend FEM Module
External workbenches
Extra python modules
Fasteners BOM
Fasteners ChamferHole
Fasteners ChangeParameters
Fasteners Flip
Fasteners MatchTypeInner
Fasteners MatchTypeOuter
Fasteners Move
Fasteners ScrewCalculator
Fasteners Simplify
Fasteners Workbench
FCGear BevelGear
FCGear CrownGear
FCGear CycloidGear
FCGear CycloidRack
FCGear GearConnector
FCGear HypoCycloidGear
FCGear InternalInvoluteGear
FCGear InvoluteGear
FCGear InvoluteRack
FCGear LanternGear
FCGear TimingGear
FCGear Workbench
FCGear WormGear
Fcmcua Workbench
Feature
Feature editing
Feature list
FeaturePython Custom Properties
FeaturePython methods
FEM Analysis
FEM CalculiX
FEM CalculiX Cantilever 3D
FEM ClippingPlaneAdd
FEM ClippingPlaneRemoveAll
FEM Concrete
FEM ConstantVacuumPermittivity
FEM ConstraintBearing
FEM ConstraintBodyHeatSource
FEM ConstraintCentrif
FEM ConstraintContact
FEM ConstraintCurrentDensity
FEM ConstraintDisplacement
FEM ConstraintElectrostaticPotential
FEM ConstraintFixed
FEM ConstraintFlowVelocity
FEM ConstraintFluidBoundary
FEM ConstraintForce
FEM ConstraintGear
FEM ConstraintHeatflux
FEM ConstraintInitialFlowVelocity
FEM ConstraintInitialPressure
FEM ConstraintInitialTemperature
FEM ConstraintMagnetization
FEM ConstraintPlaneRotation
FEM ConstraintPressure
FEM ConstraintPulley
FEM ConstraintSectionPrint
FEM ConstraintSelfWeight
FEM ConstraintSpring
FEM ConstraintTemperature
FEM ConstraintTie
FEM ConstraintTransform
FEM CreateNodesSet
FEM Element Types
FEM ElementFluid1D
FEM ElementGeometry1D
FEM ElementGeometry2D
FEM ElementRotation1D
FEM EquationDeformation
FEM EquationElasticity
FEM EquationElectricforce
FEM EquationElectrostatic
FEM EquationFlow
FEM EquationFlux
FEM EquationHeat
FEM EquationMagnetodynamic
FEM EquationMagnetodynamic2D
FEM Example Capacitance Two Balls
FEM Examples
FEM FemMesh2Mesh
FEM FrontISTR Workbench
FEM Geometry Preparation and Meshing
FEM Install
FEM MaterialEditor
FEM MaterialFluid
FEM MaterialMechanicalNonlinear
FEM MaterialReinforced
FEM MaterialSolid
FEM Mesh
FEM Mesh CalculiX
FEM MeshBoundaryLayer
FEM MeshClear
FEM MeshDisplayInfo
FEM MeshGmshFromShape
FEM MeshGroup
FEM MeshNetgenFromShape
FEM MeshRegion
FEM PostApplyChanges
FEM PostCreateFunctionBox
FEM PostCreateFunctionCylinder
FEM PostCreateFunctionPlane
FEM PostCreateFunctionSphere
FEM PostFilterClipRegion
FEM PostFilterClipScalar
FEM PostFilterContours
FEM PostFilterCutFunction
FEM PostFilterDataAlongLine
FEM PostFilterDataAtPoint
FEM PostFilterLinearizedStresses
FEM PostFilterWarp
FEM PostPipelineFromResult
FEM Preferences
FEM ResultShow
FEM ResultsPurge
FEM Shear of a Composite Block
FEM Solver
FEM SolverCalculiX
FEM SolverCalculixCxxtools
FEM SolverControl
FEM SolverElmer
FEM SolverElmer SolverSettings
FEM SolverMystran
FEM SolverRun
FEM SolverZ88
FEM tutorial
FEM Tutorial Python
FEM Workbench
FEMbyGEN Workbench
File Format FCStd
Fine-tuning
Flamingo Workbench
Flatpak
FreeCAD and DWG Import
FreeCAD and DXF Import
FreeCAD and Mesh Import
FreeCAD API
FreeCAD Build Tool
FreeCAD Community Portal
FreeCAD Docker CLI mode
FreeCAD Managing Expectations
FreeCAD Scripting Basics
FreeCAD used in production
FreeCAD vector math library
FreeCAD-SH3D
FreeCAD-Ship s60 tutorial
FreeCAD-Ship s60 tutorial (II)
FreeCADGui API
Frequently asked questions
Getting started
Git buildpackage
Glossary
GlTF
Gui Command
GuiCommand model
Headless FreeCAD
Help
Help FreeCAD
History
How to install additional workbenches
How to install macros
IfcOpenShell
IfcPlusPlus
Image CreateImagePlane
Image Open
Image Scaling
Image Workbench
ImageConv
Import Export
Import Export Preferences
Import from STL or OBJ
Import OpenSCAD code
Import text and geometry from Inkscape
Import/Export IFC - compiling IfcOpenShell
Important information
Importing From Sketchup
InputField
Inspection Workbench
Installing additional components
Installing Helpfile
Installing more workbenches
Installing on Linux
Installing on Mac
Installing on Windows
Interface
Interface creation
Interface Customization
Introduction to Python
Key ASCII
KicadStepUp Workbench
Lattice2 AttachablePlacement
Lattice2 Workbench
LGTM
License
Line drawing function
LinkSub
LinkSubList
Linux packaging
Localisation
Localisation Sidebar
Localization Older Methods
LuxCoreRender
LuxRender
MacOS packaging
Macro 3D Parametric Curve
Macro 3d Printer Slicer
Macro 3d Printer Slicer Individual Parts
Macro 3D Printer Workflow
Macro 3DXML import
Macro AeroFoil
Macro Airfoil Import & Scale
Macro Alias For Table For Object
Macro Alias Manager
Macro Align Camera to Working Plane
Macro Align Face Object to View
Macro Align Object to View
Macro Align View to Face
Macro Align Working Plane to Camera
Macro Animated Constrain
Macro Animator
Macro Apothem Based Prism GUI
Macro Arch Axis System Repartition
Macro ArrayCopy
Macro Assemblage Imprimante 3D
Macro Assembly
Macro at Startup
Macro Automatic drawing
Macro Bevel
Macro BOLTS
Macro BoundingBox Tracing
Macro BSurf from grid
Macro Build Utility
Macro Cabinets32
Macro CartoucheFC
Macro CartoucheFC 2
Macro CartoucheFC Full
Macro Center Align Objects with Faces or Edges
Macro CenterFace
Macro CenterOfMass
Macro Circle
Macro CirclePlus
Macro clone explicit
Macro CloneConvert
Macro Colorize
Macro Compound Plus
Macro Connect And Sweep
Macro Constraint Draft
Macro ConstraintToAlias
Macro Convert 021
Macro Copy3DViewToClipboard
Macro Corner shapes wizard
Macro Corner shapes wizard/update
Macro crank simul
Macro Creating faces from a DXF file
Macro cross section
Macro Cut Circle
Macro Cut Line
Macro DeepCopy
Macro Delta xyz
Macro documentation
Macro Draft Circle 3 Points
Macro Draft Circle 3 Points 3D
Macro Draft Circle Tangent
Macro Draw 2D Function
Macro Draw Parametric 2D Function
Macro Dump Objects
Macro Duplicate Selection
Macro DXF to Face and Sketch
Macro Easy cutouts for Enclosure Design
Macro EasyAlias
Macro EasyReflector
Macro EdgesToArc
Macro Editor Assistant
Macro Ellipse-Center+2Points
Macro ExpandTreeItem
Macro export transient FEM results
Macro Extract Wires from Mesh
Macro FaceToSketch
Macro FC Convert Lines
Macro FC element selector
Macro FCBmpImport
Macro FCCamera
Macro FCCamGroover
Macro FCCircularText
Macro FCGear
Macro FCHoneycombMaker
Macro FCInfo
Macro FCInfo Alternate Linux
Macro FCInfo ToolBar
Macro FCInfoGlass
Macro FCInfoToMouse
Macro FCSpreadSheet Extract
Macro FCSpring Helix Variable
Macro FCSpring On Surface
Macro FCTreeView
Macro FCWire To Volume
Macro FindAliasReferences
Macro findConfigFiles
Macro FlattenWire
Macro FlattenWire3Points
Macro Fonts Win10 PYMP
Macro ForceRecompute
Macro FreeCAD to Kerkythea
Macro GenerateDrawing
Macro GenerateViews
Macro Geneva Wheel
Macro Geneva Wheel GUI
Macro Geodesic Dome
Macro Global Variable Watcher
Macro GMSH
Macro GuiResetToolbars
Macro Guitar fretboard
Macro Guitar Nut
Macro Half turn stairs
Macro Half-Hull Model
Macro HealArcs
Macro HiddenAlls
Macro HighlightCommon
Macro HighlightDifference
Macro HilbertCurve
Macro hinge
Macro Honeycomb
Macro If Selected Stay If Not Then Delete
Macro Iges PyImporter
Macro Image Scaling
Macro ImperialScales
Macro ImportAirfoil
Macro Intersection
Macro Joint
Macro JointWire
Macro Kerkythea
Macro Line Length
Macro Loft
Macro MacroMenu
Macro MacroToolbarManager
Macro Make Arc 3 Points
Macro Make Circle 3 Points
Macro Make Cube
Macro MatrixTransform
Macro MeasureCircle
Macro Megaminx
Macro merge duplicate materials
Macro MeshToPart
Macro MessageBox
Macro Mouse Cross
Macro Mouse over cb
Macro MoveToOrigin
Macro MultiCopy
Macro MultiCuts
Macro Normal Vector
Macro ObjectInfo
Macro Overlap
Macro Parametric Curve FP
Macro Parametric Defeaturing
Macro PartsLibrary
Macro PartToVRML
Macro PCBWay
Macro PDWrapper
Macro Perpendicular To Wire
Macro Pinger
Macro Place Image
Macro PlacementAbsolufy
Macro Polyhedrons
Macro Print SceneGraph
Macro PropertyMemo
Macro Pyramid
Macro Python Assistant Window
Macro Recompute Profiler
Macro Rectellipse
Macro Remove parametric history
Macro Replace Part in Assembly
Macro Repro Wire
Macro Rotate To Point
Macro Rotate View
Macro Rotate View Free
Macro Rotate ViewAxonometric
Macro Rubik Cube
Macro Screen Wiki
Macro screw maker1 2
Macro Section
Macro Select Hovering
Macro SelectVisible
Macro Shake Sketch
Macro Sheet Metal Unfolder
Macro SimpleProperties
Macro Site From Contours
Macro Sketch Constraint From Spreadsheet
Macro SketchUnmap
Macro Snip
Macro Solid Sweep
Macro SplitPropEditor
Macro Spreadsheet2html
Macro SpreadsheetTools
Macro Spring
Macro Stairs
Macro StraightenObject
Macro SuperWire
Macro TemplateHelper
Macro Texture
Macro Texture Objects
Macro TimingGear
Macro TNP Solution
Macro Toggle Drawstyle
Macro Toggle Drawstyle Optimized
Macro Toggle Panels Visibility
Macro Toggle Visibility
Macro Toggle Visibility2 1-2
Macro Toggle Visibility2 2-2
Macro TreeToAscii
Macro Triangle AH
Macro Unbind Numpad Shortcuts
Macro Unfold Box
Macro Unroll Ruled Surface
Macro View Rotation
Macro Visibility Manager
Macro VisibleAlls
Macro Wiki Object Properties List Generator
Macro Wiki Object Properties List Generator Basic Version
Macro WireFilter
Macro WireXYZ
Macro Wiring And Hoses
Macro WorkFeatures
Macro Z Height Map
Macro Zoom1 1
Macros
Macros recipes
Main Page
Main view area
Manipulator Workbench
Manual:A gentle introduction
Manual:All workbenches at a glance
Manual:BIM modeling
Manual:Creating and manipulating geometry
Manual:Creating FEM analyses
Manual:Creating interface tools
Manual:Creating parametric objects
Manual:Creating renderings
Manual:Generating 2D drawings
Manual:Import and export to other filetypes
Manual:Installing
Manual:Introduction
Manual:Modeling for product design
Manual:Navigating in the 3D view
Manual:Parametric objects
Manual:Preparing models for 3D printing
Manual:Summary
Manual:The Community
Manual:The FreeCAD document
Manual:The FreeCAD Interface
Manual:Traditional 2D drafting
Manual:Traditional modeling, the CSG way
Manual:Using spreadsheets
Manual:What is FreeCAD
Matrix API
Measurement Of Angles On Holes
Mesh
Mesh AddFacet
Mesh API
Mesh BoundingBox
Mesh BuildRegularSolid
Mesh CrossSections
Mesh CurvatureInfo
Mesh Decimating
Mesh Difference
Mesh EvaluateFacet
Mesh EvaluateSolid
Mesh Evaluation
Mesh Export
Mesh Feature
Mesh FillInteractiveHole
Mesh FillupHoles
Mesh FlipNormals
Mesh FromPartShape
Mesh HarmonizeNormals
Mesh Import
Mesh Intersection
Mesh Merge
Mesh MeshObject
Mesh PolyCut
Mesh PolyTrim
Mesh RemeshGmsh
Mesh RemoveCompByHand
Mesh RemoveComponents
Mesh Scale
Mesh Scripting
Mesh SectionByPlane
Mesh Segmentation
Mesh SegmentationBestFit
Mesh Smoothing
Mesh SplitComponents
Mesh to Part
Mesh TrimByPlane
Mesh Union
Mesh VertexCurvature
Mesh Workbench
MeshPart CreateFlatFace
MeshPart CreateFlatMesh
MeshRemodel Workbench
MIBA
Migrating to FreeCAD from Fusion360
Migrating to FreeCAD from OnShape
Migrating to FreeCAD from Revit
Migrating to FreeCAD from SolidWorks
Misc templates
Misc templates Full
Model
ModernUI Workbench
MOOC Workbench
Mouse navigation
Multithreading
Navigation Cube
NumPy
O-X-Y Type Attachment Modes
Object API
Object name
Onboarding FEM Devs
Online Help Startpage
Online Help Toc
OpenCamLib
OpenCASCADE
OpenSCAD AddOpenSCADElement
OpenSCAD ColorCodeShape
OpenSCAD CSG
OpenSCAD Edgestofaces
OpenSCAD ExpandPlacements
OpenSCAD ExplodeGroup
OpenSCAD Hull
OpenSCAD IncreaseToleranceFeature
OpenSCAD MeshBoolean
OpenSCAD Minkowski
OpenSCAD MirrorMeshFeature
OpenSCAD Preferences
OpenSCAD RefineShapeFeature
OpenSCAD RemoveSubtree
OpenSCAD ReplaceObject
OpenSCAD ResizeMeshFeature
OpenSCAD ScaleMeshFeature
OpenSCAD Workbench
Organization chart
OSE 3D Printer Workbench
OSE Piping Workbench
Package Metadata
Packaging
Part
Part and PartDesign
Part API
Part Boolean
Part BooleanFragments
Part Box
Part BoxSelection
Part Builder
Part Chamfer
Part CheckGeometry
Part Circle
Part ColorPerFace
Part Common
Part CompCompoundTools
Part CompJoinFeatures
Part CompOffsetTools
Part Compound
Part CompoundFilter
Part CompSplittingTools
Part Cone
Part CrossSections
Part Cut
Part Cylinder
Part Defeaturing
Part EditAttachment
Part ElementCopy
Part Ellipse
Part Ellipsoid
Part ExplodeCompound
Part Export
Part Extrude
Part Feature
Part Fillet
Part Fuse
Part Helix
Part Import
Part JoinConnect
Part JoinCutout
Part JoinEmbed
Part Line
Part Loft
Part Loft Technical Details
Part MakeFace
Part MakeSolid
Part Measure Angular
Part Measure Clear All
Part Measure Linear
Part Measure Refresh
Part Measure Toggle 3D
Part Measure Toggle All
Part Measure Toggle Delta
Part Mirror
Part Module
Part Offset
Part Offset2D
Part Part2DObject
Part Plane
Part Point
Part PointsFromMesh
Part Primitives
Part Prism
Part ProjectionOnSurface
Part RefineShape
Part RegularPolygon
Part ReverseShape
Part Revolve
Part RuledSurface
Part Scale
Part scripting
Part Section
Part SectionCut
Part ShapeFromMesh
Part SimpleCopy
Part Slice
Part SliceApart
Part Sphere
Part Spiral
Part Sweep
Part Thickness
Part TopoShape
Part Torus
Part TransformedCopy
Part Tube
Part Wedge
Part XOR
PartDesign AdditiveBox
PartDesign AdditiveCone
PartDesign AdditiveCylinder
PartDesign AdditiveEllipsoid
PartDesign AdditiveHelix
PartDesign AdditiveLoft
PartDesign AdditivePipe
PartDesign AdditivePrism
PartDesign AdditiveSphere
PartDesign AdditiveTorus
PartDesign AdditiveWedge
PartDesign Bearingholder Tutorial I
PartDesign Bearingholder Tutorial II
PartDesign Body
PartDesign Boolean
PartDesign Chamfer
PartDesign Clone
PartDesign CompPrimitiveAdditive
PartDesign CompPrimitiveSubtractive
PartDesign CoordinateSystem
PartDesign Draft
PartDesign Examples
PartDesign Feature
PartDesign Fillet
PartDesign Groove
PartDesign Hole
PartDesign InvoluteGear
PartDesign Line
PartDesign LinearPattern
PartDesign Migrate
PartDesign Mirrored
PartDesign MoveFeature
PartDesign MoveFeatureInTree
PartDesign MoveTip
PartDesign MultiTransform
PartDesign NewSketch
PartDesign Pad
PartDesign Plane
PartDesign Pocket
PartDesign Point
PartDesign PolarPattern
PartDesign Preferences
PartDesign Revolution
PartDesign Scaled
PartDesign ShapeBinder
PartDesign Sprocket
PartDesign SubShapeBinder
PartDesign SubtractiveBox
PartDesign SubtractiveCone
PartDesign SubtractiveCylinder
PartDesign SubtractiveEllipsoid
PartDesign SubtractiveHelix
PartDesign SubtractiveLoft
PartDesign SubtractivePipe
PartDesign SubtractivePrism
PartDesign SubtractiveSphere
PartDesign SubtractiveTorus
PartDesign SubtractiveWedge
PartDesign Thickness
PartDesign tutorial
PartDesign WizardShaft
PartDesign Workbench
Parts Library Workbench
PCB Workbench
PDF
Pivy
Placement
Placement API
Plot Axes
Plot Basic tutorial
Plot Grid
Plot Labels
Plot Legend
Plot MultiAxes tutorial
Plot Positions
Plot Save
Plot Series
Plot Workbench
Points Convert
Points Export
Points Import
Points Merge
Points PolyCut
Points Structure
Points Workbench
Post-Processing of FEM Results with Paraview
POV-Ray
POV-Ray-Rendering Workbench
Power users hub
Preference Packs
Preferences Editor
Private Preference Packs
Profiling
Property
Property editor
PropertyLink: InList and OutList
Pyramids and polyhedrons Workbench
Pyrate Workbench
PySide
PySide Advanced Examples
PySide Beginner Examples
PySide Intermediate Examples
PySide usage snippets
Python
Python console
Python Development Environment
Python scripting tutorial
PythonOCC
Qt Example
Quantity
Raytracing API example
Raytracing ExportProject
Raytracing InsertPart
Raytracing Lux
Raytracing New
Raytracing Preferences
Raytracing Render
Raytracing ResetCamera
Raytracing templates
Raytracing tutorial
Raytracing Workbench
Raytracing WriteCamera
Raytracing WritePart
Raytracing WriteView
Reinforcement API
Reinforcement BarBendingSchedule
Reinforcement BarShapeCutList
Reinforcement BeamRebars
Reinforcement BentShapeRebar
Reinforcement BillOfMaterial
Reinforcement ColumnRebars
Reinforcement ColumnRebars Circular
Reinforcement ColumnRebars TwoTiesSixRebars
Reinforcement Custom Spacing
Reinforcement DrawingDimensioning
Reinforcement FootingRebars
Reinforcement HelicalRebar
Reinforcement LShapeRebar
Reinforcement SlabRebars
Reinforcement StirrupRebar
Reinforcement StraightRebar
Reinforcement UShapeRebar
Reinforcement Workbench
Release notes 0.13
Release notes 0.14
Release notes 0.15
Release notes 0.16
Release notes 0.17
Release notes 0.18
Release notes 0.19
Release notes 0.20
Release notes 0.21
Release notes 1.0
Render Workbench
Report view
Reverse Engineering Workbench
Robot 6-Axis
Robot API example
Robot CreateRobot
Robot CreateTrajectory
Robot Edge2Trac
Robot Export
Robot InsertWaypoint
Robot InsertWaypointPre
Robot RestoreHomePos
Robot SetDefaultOrientation
Robot SetDefaultValues
Robot SetHomePos
Robot Simulate
Robot TrajectoryCompound
Robot TrajectoryDressUp
Robot tutorial
Robot Workbench
Rocket BodyTube
Rocket Bulkhead
Rocket CenteringRing
Rocket CompLaunchGuide
Rocket Ejection Charge Calculator
Rocket Fin
Rocket FinCan
Rocket LaunchLug
Rocket NoseCone
Rocket Parachute Size Calculator
Rocket RailButton
Rocket RailGuide
Rocket Thrust To Weight Calculator
Rocket Transition
Rocket Vent Hole Size Calculator
Rocket Workbench
Scenegraph
Scientific literature
Screenshots
Scripted objects
Scripted objects migration
Scripted objects saving attributes
Scripted objects with attachment
Scripted Parts: Ball Bearing - Part 1
Scripted Parts: Ball Bearing - Part 2
Scripting and macros
Scripts
SearchBar Mod
Selection API
Selection methods
Selection view
Shape
SheetMetal AddBase
SheetMetal AddBend
SheetMetal AddCornerRelief
SheetMetal AddFoldWall
SheetMetal AddJunction
SheetMetal AddRelief
SheetMetal AddWall
SheetMetal BaseShape
SheetMetal Examples
SheetMetal Extrude
SheetMetal Forming
SheetMetal SketchOnSheet
SheetMetal UnattendedUnfold
SheetMetal Unfold
SheetMetal Workbench
Ship AreasCurve
Ship Capacity
Ship CreateShip
Ship GZ
Ship Hydrostatics
Ship LoadCondition
Ship LoadExample
Ship Tank
Ship Weight
Ship Workbench
Silk Workbench
Sketch
Sketcher ArcOverlay
Sketcher BSplineComb
Sketcher BSplineConvertToNURBS
Sketcher BSplineDecreaseDegree
Sketcher BSplineDecreaseKnotMultiplicity
Sketcher BSplineDegree
Sketcher BSplineIncreaseDegree
Sketcher BSplineIncreaseKnotMultiplicity
Sketcher BSplineInsertKnot
Sketcher BSplineKnotMultiplicity
Sketcher BSplinePoleWeight
Sketcher BSplinePolygon
Sketcher CarbonCopy
Sketcher Clone
Sketcher CloseShape
Sketcher ConnectLines
Sketcher ConstrainAngle
Sketcher ConstrainBlock
Sketcher ConstrainCoincident
Sketcher ConstrainCoincidentUnified
Sketcher ConstrainDiameter
Sketcher ConstrainDistance
Sketcher ConstrainDistanceX
Sketcher ConstrainDistanceY
Sketcher ConstrainEqual
Sketcher ConstrainHorizontal
Sketcher ConstrainHorVer
Sketcher ConstrainLock
Sketcher ConstrainParallel
Sketcher ConstrainPerpendicular
Sketcher ConstrainPointOnObject
Sketcher ConstrainRadiam
Sketcher ConstrainRadius
Sketcher ConstrainSnellsLaw
Sketcher ConstrainSymmetric
Sketcher ConstrainTangent
Sketcher ConstrainVertical
Sketcher Copy
Sketcher Create3PointArc
Sketcher Create3PointCircle
Sketcher CreateArc
Sketcher CreateArcOfEllipse
Sketcher CreateArcOfHyperbola
Sketcher CreateArcOfParabola
Sketcher CreateArcSlot
Sketcher CreateBSpline
Sketcher CreateBSplineByInterpolation
Sketcher CreateChamfer
Sketcher CreateCircle
Sketcher CreateEllipseBy3Points
Sketcher CreateEllipseByCenter
Sketcher CreateFillet
Sketcher CreateHeptagon
Sketcher CreateHexagon
Sketcher CreateLine
Sketcher CreateOblong
Sketcher CreateOctagon
Sketcher CreatePentagon
Sketcher CreatePeriodicBSpline
Sketcher CreatePeriodicBSplineByInterpolation
Sketcher CreatePoint
Sketcher CreatePointFillet
Sketcher CreatePolyline
Sketcher CreateRectangle
Sketcher CreateRectangle Center
Sketcher CreateRegularPolygon
Sketcher CreateSlot
Sketcher CreateSquare
Sketcher CreateTriangle
Sketcher DeleteAllConstraints
Sketcher DeleteAllGeometry
Sketcher Dialog
Sketcher Dimension
Sketcher EditSketch
Sketcher Examples
Sketcher Extend
Sketcher External
Sketcher Grid
Sketcher helper constraint
Sketcher JoinCurves
Sketcher LeaveSketch
Sketcher MapSketch
Sketcher MergeSketches
Sketcher Micro Tutorial - Constraint Practices
Sketcher MirrorSketch
Sketcher Move
Sketcher NewSketch
Sketcher Offset
Sketcher Preferences
Sketcher RectangularArray
Sketcher reference
Sketcher RemoveAxesAlignment
Sketcher RenderingOrder
Sketcher ReorientSketch
Sketcher requirement for a sketch
Sketcher RestoreInternalAlignmentGeometry
Sketcher Rotate
Sketcher Scale
Sketcher scripting
Sketcher SelectConflictingConstraints
Sketcher SelectConstraints
Sketcher SelectElementsAssociatedWithConstraints
Sketcher SelectElementsWithDoFs
Sketcher SelectHorizontalAxis
Sketcher SelectOrigin
Sketcher SelectRedundantConstraints
Sketcher SelectVerticalAxis
Sketcher SketchObject
Sketcher Snap
Sketcher Split
Sketcher StopOperation
Sketcher SwitchVirtualSpace
Sketcher Symmetry
Sketcher ToggleActiveConstraint
Sketcher ToggleConstruction
Sketcher ToggleDrivingConstraint
Sketcher Translate
Sketcher Trimming
Sketcher Tutorial
Sketcher ValidateSketch
Sketcher ViewSection
Sketcher ViewSketch
Sketcher Workbench
Source code management
Source documentation
Sphinx
Splash screen
Spreadsheet
Spreadsheet AlignBottom
Spreadsheet AlignCenter
Spreadsheet AlignLeft
Spreadsheet AlignRight
Spreadsheet AlignTop
Spreadsheet AlignVCenter
Spreadsheet CreateSheet
Spreadsheet CSV
Spreadsheet Export
Spreadsheet Import
Spreadsheet MergeCells
Spreadsheet Preferences
Spreadsheet SetAlias
Spreadsheet SplitCell
Spreadsheet StyleBold
Spreadsheet StyleItalic
Spreadsheet StyleUnderline
Spreadsheet Workbench
Standard Menu
Start Preferences
Start up and Configuration
Start Workbench
Status bar
Std About
Std ActivateNextWindow
Std ActivatePrevWindow
Std AddonMgr
Std Alignment
Std AxisCross
Std Base
Std BoxElementSelection
Std BoxSelection
Std CascadeWindows
Std CloseActiveWindow
Std CloseAllWindows
Std Copy
Std Cut
Std Delete
Std DemoMode
Std DependencyGraph
Std DlgCustomize
Std DlgMacroExecute
Std DlgMacroExecuteDirect
Std DlgMacroRecord
Std DlgParameter
Std DlgPreferences
Std DrawStyle
Std DuplicateSelection
Std Edit
Std Edit Menu
Std Export
Std File Menu
Std FreeCADDonation
Std FreeCADFAQ
Std FreeCADForum
Std FreeCADPowerUserHub
Std FreeCADUserHub
Std FreeCADWebsite
Std FreezeViews
Std Group
Std Help Menu
Std HideObjects
Std HideSelection
Std Import
Std LinkImport
Std LinkImportAll
Std LinkMake
Std LinkMakeRelative
Std LinkReplace
Std LinkSelectAllLinks
Std LinkSelectLinked
Std LinkSelectLinkedFinal
Std LinkUnlink
Std Macro Menu
Std MacroAttachDebugger
Std MacroStartDebug
Std MacroStepInto
Std MacroStepOver
Std MacroStopDebug
Std MacroStopRecord
Std MainFullscreen
Std MeasureDistance
Std MergeProjects
Std New
Std OnlineHelp
Std Open
Std OrthographicCamera
Std Part
Std Paste
Std PerspectiveCamera
Std Placement
Std Print
Std PrintPdf
Std PrintPreview
Std ProjectInfo
Std ProjectUtil
Std PythonHelp
Std Quit
Std RandomColor
Std RecallWorkingView
Std RecentFiles
Std Redo
Std Refresh
Std ReportBug
Std Revert
Std Save
Std SaveAll
Std SaveAs
Std SaveCopy
Std SceneInspector
Std SelBack
Std SelBoundingBox
Std SelectAll
Std SelectVisibleObjects
Std SelForward
Std SendToPythonConsole
Std SetAppearance
Std ShowObjects
Std ShowSelection
Std StoreWorkingView
Std TextDocument
Std TextureMapping
Std TileWindows
Std ToggleBreakpoint
Std ToggleClipPlane
Std ToggleNavigation
Std ToggleObjects
Std ToggleSelectability
Std ToggleVisibility
Std Tools Menu
Std TransformManip
Std TreeCollapseDocument
Std TreeDrag
Std TreeMultiDocument
Std TreePreSelection
Std TreeRecordSelection
Std TreeSelection
Std TreeSingleDocument
Std TreeSyncPlacement
Std TreeSyncSelection
Std TreeSyncView
Std Undo
Std UnitsCalculator
Std UserEditMode
Std View Menu
Std ViewBottom
Std ViewBoxZoom
Std ViewCreate
Std ViewDimetric
Std ViewDockUndockFullscreen
Std ViewFitAll
Std ViewFitSelection
Std ViewFront
Std ViewFullscreen
Std ViewHome
Std ViewIsometric
Std ViewIvIssueCamPos
Std ViewIvStereoInterleavedColumns
Std ViewIvStereoInterleavedRows
Std ViewIvStereoOff
Std ViewIvStereoQuadBuff
Std ViewIvStereoRedGreen
Std ViewLeft
Std ViewLoadImage
Std ViewRear
Std ViewRight
Std ViewRotateLeft
Std ViewRotateRight
Std ViewScreenShot
Std ViewStatusBar
Std ViewTop
Std ViewTrimetric
Std ViewZoomIn
Std ViewZoomOut
Std WhatsThis
Std Windows
Std Windows Menu
Std Workbench
Stemfie Workbench
Surface BlendCurve
Surface CurveOnMesh
Surface ExtendFace
Surface Filling
Surface GeomFillSurface
Surface Sections
Surface Workbench
SVG
Svg Namespace
Swag
SweetHome3D
Symbols Library Workbench
Task panel
Tasks Placement
TechDraw 2LineCenterLine
TechDraw 2PointCenterLine
TechDraw 2PointCosmeticLine
TechDraw 3PtAngleDimension
TechDraw ActiveView
TechDraw AngleDimension
TechDraw Annotation
TechDraw API
TechDraw ArchView
TechDraw AxoLengthDimension
TechDraw Balloon
TechDraw BrokenView
TechDraw ClipGroup
TechDraw ClipGroupAdd
TechDraw ClipGroupRemove
TechDraw CommandAddOffsetVertex
TechDraw ComplexSection
TechDraw CosmeticCircle
TechDraw CosmeticEraser
TechDraw CosmeticVertex
TechDraw DecorateLine
TechDraw DetailView
TechDraw DiameterDimension
TechDraw DimensionRepair
TechDraw DraftView
TechDraw ExportPageDXF
TechDraw ExportPageSVG
TechDraw ExtensionArcLengthAnnotation
TechDraw ExtensionAreaAnnotation
TechDraw ExtensionCascadeHorizDimension
TechDraw ExtensionCascadeObliqueDimension
TechDraw ExtensionCascadeVertDimension
TechDraw ExtensionChangeLineAttributes
TechDraw ExtensionCircleCenterLines
TechDraw ExtensionCreateHorizChainDimension
TechDraw ExtensionCreateHorizChamferDimension
TechDraw ExtensionCreateHorizCoordDimension
TechDraw ExtensionCreateLengthArc
TechDraw ExtensionCreateObliqueChainDimension
TechDraw ExtensionCreateObliqueCoordDimension
TechDraw ExtensionCreateVertChainDimension
TechDraw ExtensionCreateVertChamferDimension
TechDraw ExtensionCreateVertCoordDimension
TechDraw ExtensionCustomizeFormat
TechDraw ExtensionDecreaseDecimal
TechDraw ExtensionDrawCosmArc
TechDraw ExtensionDrawCosmCircle
TechDraw ExtensionDrawCosmCircle3Points
TechDraw ExtensionExtendLine
TechDraw ExtensionHoleCircle
TechDraw ExtensionIncreaseDecimal
TechDraw ExtensionInsertDiameter
TechDraw ExtensionInsertSquare
TechDraw ExtensionLineParallel
TechDraw ExtensionLinePerpendicular
TechDraw ExtensionLockUnlockView
TechDraw ExtensionPosHorizChainDimension
TechDraw ExtensionPositionSectionView
TechDraw ExtensionPosObliqueChainDimension
TechDraw ExtensionPosVertChainDimension
TechDraw ExtensionRemovePrefixChar
TechDraw ExtensionSelectLineAttributes
TechDraw ExtensionShortenLine
TechDraw ExtensionThreadBoltBottom
TechDraw ExtensionThreadBoltSide
TechDraw ExtensionThreadHoleBottom
TechDraw ExtensionThreadHoleSide
TechDraw ExtensionVertexAtIntersection
TechDraw FaceCenterLine
TechDraw General Examples
TechDraw Geometric dimensioning and tolerancing
TechDraw GeometricHatch
TechDraw Hatch
TechDraw Hatching
TechDraw HoleShaftFit
TechDraw HorizontalDimension
TechDraw HorizontalExtentDimension
TechDraw HowTo Page
TechDraw Image
TechDraw LandmarkDimension
TechDraw LeaderLine
TechDraw LengthDimension
TechDraw LineGroup
TechDraw LinkDimension
TechDraw Midpoints
TechDraw MoveView
TechDraw PageDefault
TechDraw PageTemplate
TechDraw Pitch Circle Tutorial
TechDraw Preferences
TechDraw PrintAll
TechDraw ProjectionGroup
TechDraw ProjectShape
TechDraw Quadrants
TechDraw RadiusDimension
TechDraw RedrawPage
TechDraw RichTextAnnotation
TechDraw Section Examples
TechDraw SectionView
TechDraw ShareView
TechDraw ShowAll
TechDraw SpreadsheetView
TechDraw StackBottom
TechDraw StackDown
TechDraw StackTop
TechDraw StackUp
TechDraw SurfaceFinishSymbol
TechDraw Symbol
TechDraw TemplateGenerator
TechDraw TemplateHowTo
TechDraw Templates
TechDraw ToggleFrame
TechDraw VerticalDimension
TechDraw VerticalExtentDimension
TechDraw View
TechDraw WeldSymbol
TechDraw Workbench
TechDrawGui API
Testing
The FreeCAD source code
Third Party Libraries
Third Party Tools
Thread for Screw Tutorial
ThreadProfile Workbench
Timber Workbench
Toothbrush Head Stand
Topological data scripting
Topological naming problem
TopoShape API
Tracker
Transient FEM analysis
Translating an external workbench
Transportation Workbench
Tree view
Tutorial custom placing of windows and doors
Tutorial for open windows
Tutorial FreeCAD POV ray
Tutorial KinematicAssembly
Tutorial KinematicController
Tutorial KinematicSkeleton
Tutorial Render with Blender
Tutorials
Ubuntu Snap
Units
User hub
Vector API
Video tutorials
Video tutorials for architectural design
Video tutorials for product design
View Measure Clear All
View Measure Toggle All
ViewObject API
Viewprovider
VRML Preparation for Robot Simulation
Web BrowserBack
Web BrowserNext
Web BrowserRefresh
Web BrowserSetURL
Web BrowserStop
Web BrowserZoomIn
Web BrowserZoomOut
Web OpenWebsite
Web Workbench
WebTools BimServer
WebTools Git
WebTools Sketchfab
WebTools Workbench
Which workbench should I choose
Whiffle Ball tutorial
Wikihouse porting tutorial
WikiPages
WikiRobots
Windows packaging
Wood Frame Workbench
Workarounds
Workbench creation
Workbenches
Workfeature Workbench
Wrapping a Cplusplus class in Python
Language
aa - Qafár af
ab - аԥсшәа
abs - bahasa ambon
ace - Acèh
ady - адыгабзэ
ady-cyrl - адыгабзэ
aeb - تونسي / Tûnsî
aeb-arab - تونسي
aeb-latn - Tûnsî
af - Afrikaans
ak - Akan
aln - Gegë
alt - алтай тил
am - አማርኛ
ami - Pangcah
an - aragonés
ang - Ænglisc
ann - Obolo
anp - अंगिका
ar - العربية
arc - ܐܪܡܝܐ
arn - mapudungun
arq - جازايرية
ary - الدارجة
arz - مصرى
as - অসমীয়া
ase - American sign language
ast - asturianu
atj - Atikamekw
av - авар
avk - Kotava
awa - अवधी
ay - Aymar aru
az - azərbaycanca
azb - تۆرکجه
ba - башҡортса
ban - Basa Bali
ban-bali - ᬩᬲᬩᬮᬶ
bar - Boarisch
bbc - Batak Toba
bbc-latn - Batak Toba
bcc - جهلسری بلوچی
bci - wawle
bcl - Bikol Central
be - беларуская
be-tarask - беларуская (тарашкевіца)
bg - български
bgn - روچ کپتین بلوچی
bh - भोजपुरी
bho - भोजपुरी
bi - Bislama
bjn - Banjar
blk - ပအိုဝ်ႏဘာႏသာႏ
bm - bamanankan
bn - বাংলা
bo - བོད་ཡིག
bpy - বিষ্ণুপ্রিয়া মণিপুরী
bqi - بختیاری
br - brezhoneg
brh - Bráhuí
bs - bosanski
btm - Batak Mandailing
bto - Iriga Bicolano
bug - ᨅᨔ ᨕᨘᨁᨗ
bxr - буряад
ca - català
cbk-zam - Chavacano de Zamboanga
cdo - 閩東語 / Mìng-dĕ̤ng-ngṳ̄
ce - нохчийн
ceb - Cebuano
ch - Chamoru
cho - Chahta Anumpa
chr - ᏣᎳᎩ
chy - Tsetsêhestâhese
ckb - کوردی
co - corsu
cps - Capiceño
cr - Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ
crh - qırımtatarca
crh-cyrl - къырымтатарджа (Кирилл)
crh-latn - qırımtatarca (Latin)
cs - čeština
csb - kaszëbsczi
cu - словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ
cv - чӑвашла
cy - Cymraeg
da - dansk
dag - dagbanli
de - Deutsch
de-at - Österreichisches Deutsch
de-ch - Schweizer Hochdeutsch
de-formal - Deutsch (Sie-Form)
dga - Dagaare
din - Thuɔŋjäŋ
diq - Zazaki
dsb - dolnoserbski
dtp - Dusun Bundu-liwan
dty - डोटेली
dv - ދިވެހިބަސް
dz - ཇོང་ཁ
ee - eʋegbe
egl - Emiliàn
el - Ελληνικά
eml - emiliàn e rumagnòl
en - English
en-ca - Canadian English
en-gb - British English
eo - Esperanto
es - español
es-419 - español de América Latina
es-formal - español (formal)
et - eesti
eu - euskara
ext - estremeñu
fa - فارسی
fat - mfantse
ff - Fulfulde
fi - suomi
fit - meänkieli
fj - Na Vosa Vakaviti
fo - føroyskt
fon - fɔ̀ngbè
fr - français
frc - français cadien
frp - arpetan
frr - Nordfriisk
fur - furlan
fy - Frysk
ga - Gaeilge
gaa - Ga
gag - Gagauz
gan - 贛語
gan-hans - 赣语(简体)
gan-hant - 贛語(繁體)
gcr - kriyòl gwiyannen
gd - Gàidhlig
gl - galego
gld - на̄ни
glk - گیلکی
gn - Avañe'ẽ
gom - गोंयची कोंकणी / Gõychi Konknni
gom-deva - गोंयची कोंकणी
gom-latn - Gõychi Konknni
gor - Bahasa Hulontalo
got - 𐌲𐌿𐍄𐌹𐍃𐌺
gpe - Ghanaian Pidgin
grc - Ἀρχαία ἑλληνικὴ
gsw - Alemannisch
gu - ગુજરાતી
guc - wayuunaiki
gur - farefare
guw - gungbe
gv - Gaelg
ha - Hausa
hak - 客家語/Hak-kâ-ngî
haw - Hawaiʻi
he - עברית
hi - हिन्दी
hif - Fiji Hindi
hif-latn - Fiji Hindi
hil - Ilonggo
ho - Hiri Motu
hr - hrvatski
hrx - Hunsrik
hsb - hornjoserbsce
hsn - 湘语
ht - Kreyòl ayisyen
hu - magyar
hu-formal - magyar (formal)
hy - հայերեն
hyw - Արեւմտահայերէն
hz - Otsiherero
ia - interlingua
id - Bahasa Indonesia
ie - Interlingue
ig - Igbo
igl - Igala
ii - ꆇꉙ
ik - Iñupiatun
ike-cans - ᐃᓄᒃᑎᑐᑦ
ike-latn - inuktitut
ilo - Ilokano
inh - гӀалгӀай
io - Ido
is - íslenska
it - italiano
iu - ᐃᓄᒃᑎᑐᑦ / inuktitut
ja - 日本語
jam - Patois
jbo - la .lojban.
jut - jysk
jv - Jawa
ka - ქართული
kaa - Qaraqalpaqsha
kab - Taqbaylit
kbd - адыгэбзэ
kbd-cyrl - адыгэбзэ
kbp - Kabɩyɛ
kcg - Tyap
kea - kabuverdianu
kg - Kongo
khw - کھوار
ki - Gĩkũyũ
kiu - Kırmancki
kj - Kwanyama
kjh - хакас
kjp - ဖၠုံလိက်
kk - қазақша
kk-arab - قازاقشا (تٴوتە)
kk-cn - قازاقشا (جۇنگو)
kk-cyrl - қазақша (кирил)
kk-kz - қазақша (Қазақстан)
kk-latn - qazaqşa (latın)
kk-tr - qazaqşa (Türkïya)
kl - kalaallisut
km - ភាសាខ្មែរ
kn - ಕನ್ನಡ
ko - 한국어
ko-kp - 조선말
koi - перем коми
kr - kanuri
krc - къарачай-малкъар
kri - Krio
krj - Kinaray-a
krl - karjal
ks - कॉशुर / کٲشُر
ks-arab - کٲشُر
ks-deva - कॉशुर
ksh - Ripoarisch
ksw - စှီၤ
ku - kurdî
ku-arab - كوردي (عەرەبی)
ku-latn - kurdî (latînî)
kum - къумукъ
kus - Kʋsaal
kv - коми
kw - kernowek
ky - кыргызча
la - Latina
lad - Ladino
lb - Lëtzebuergesch
lbe - лакку
lez - лезги
lfn - Lingua Franca Nova
lg - Luganda
li - Limburgs
lij - Ligure
liv - Līvõ kēļ
lki - لەکی
lld - Ladin
lmo - lombard
ln - lingála
lo - ລາວ
loz - Silozi
lrc - لۊری شومالی
lt - lietuvių
ltg - latgaļu
lus - Mizo ţawng
luz - لئری دوٙمینی
lv - latviešu
lzh - 文言
lzz - Lazuri
mad - Madhurâ
mag - मगही
mai - मैथिली
map-bms - Basa Banyumasan
mdf - мокшень
mg - Malagasy
mh - Ebon
mhr - олык марий
mi - Māori
min - Minangkabau
mk - македонски
ml - മലയാളം
mn - монгол
mni - ꯃꯤꯇꯩ ꯂꯣꯟ
mnw - ဘာသာ မန်
mo - молдовеняскэ
mos - moore
mr - मराठी
mrh - Mara
mrj - кырык мары
ms - Bahasa Melayu
ms-arab - بهاس ملايو
mt - Malti
mus - Mvskoke
mwl - Mirandés
my - မြန်မာဘာသာ
myv - эрзянь
mzn - مازِرونی
na - Dorerin Naoero
nah - Nāhuatl
nan - Bân-lâm-gú
nap - Napulitano
nb - norsk bokmål
nds - Plattdüütsch
nds-nl - Nedersaksies
ne - नेपाली
new - नेपाल भाषा
ng - Oshiwambo
nia - Li Niha
niu - Niuē
nl - Nederlands
nl-informal - Nederlands (informeel)
nmz - nawdm
nn - norsk nynorsk
no - norsk
nod - ᨣᩤᩴᨾᩮᩬᩥᨦ
nog - ногайша
nov - Novial
nqo - ߒߞߏ
nrm - Nouormand
nso - Sesotho sa Leboa
nv - Diné bizaad
ny - Chi-Chewa
nyn - runyankore
nys - Nyunga
oc - occitan
ojb - Ojibwemowin
olo - livvinkarjala
om - Oromoo
or - ଓଡ଼ିଆ
os - ирон
pa - ਪੰਜਾਬੀ
pag - Pangasinan
pam - Kapampangan
pap - Papiamentu
pcd - Picard
pcm - Naijá
pdc - Deitsch
pdt - Plautdietsch
pfl - Pälzisch
pi - पालि
pih - Norfuk / Pitkern
pl - polski
pms - Piemontèis
pnb - پنجابی
pnt - Ποντιακά
prg - prūsiskan
ps - پښتو
pt - português
pt-br - português do Brasil
pwn - pinayuanan
qqq - Message documentation
qu - Runa Simi
qug - Runa shimi
rgn - Rumagnôl
rif - Tarifit
rki - ရခိုင်
rm - rumantsch
rmc - romaňi čhib
rmy - romani čhib
rn - ikirundi
ro - română
roa-tara - tarandíne
rsk - руски
ru - русский
rue - русиньскый
rup - armãneashti
ruq - Vlăheşte
ruq-cyrl - Влахесте
ruq-latn - Vlăheşte
rw - Ikinyarwanda
ryu - うちなーぐち
sa - संस्कृतम्
sah - саха тыла
sat - ᱥᱟᱱᱛᱟᱲᱤ
sc - sardu
scn - sicilianu
sco - Scots
sd - سنڌي
sdc - Sassaresu
sdh - کوردی خوارگ
se - davvisámegiella
se-fi - davvisámegiella (Suoma bealde)
se-no - davvisámegiella (Norgga bealde)
se-se - davvisámegiella (Ruoŧa bealde)
sei - Cmique Itom
ses - Koyraboro Senni
sg - Sängö
sgs - žemaitėška
sh - srpskohrvatski / српскохрватски
sh-cyrl - српскохрватски (ћирилица)
sh-latn - srpskohrvatski (latinica)
shi - Taclḥit
shi-latn - Taclḥit
shi-tfng - ⵜⴰⵛⵍⵃⵉⵜ
shn - ၽႃႇသႃႇတႆး
shy - tacawit
shy-latn - tacawit
si - සිංහල
simple - Simple English
sjd - кӣллт са̄мь кӣлл
sje - bidumsámegiella
sk - slovenčina
skr - سرائیکی
skr-arab - سرائیکی
sl - slovenščina
sli - Schläsch
sm - Gagana Samoa
sma - åarjelsaemien
smn - anarâškielâ
sms - nuõrttsääʹmǩiõll
sn - chiShona
so - Soomaaliga
sq - shqip
sr - српски / srpski
sr-ec - српски (ћирилица)
sr-el - srpski (latinica)
srn - Sranantongo
sro - sardu campidanesu
ss - SiSwati
st - Sesotho
stq - Seeltersk
sty - себертатар
su - Sunda
sv - svenska
sw - Kiswahili
syl - ꠍꠤꠟꠐꠤ
szl - ślůnski
szy - Sakizaya
ta - தமிழ்
tay - Tayal
tcy - ತುಳು
tdd - ᥖᥭᥰᥖᥬᥳᥑᥨᥒᥰ
te - తెలుగు
tet - tetun
tg - тоҷикӣ
tg-cyrl - тоҷикӣ
tg-latn - tojikī
th - ไทย
ti - ትግርኛ
tk - Türkmençe
tl - Tagalog
tly - tolışi
tly-cyrl - толыши
tn - Setswana
to - lea faka-Tonga
tok - toki pona
tpi - Tok Pisin
tr - Türkçe
tru - Ṫuroyo
trv - Seediq
ts - Xitsonga
tt - татарча / tatarça
tt-cyrl - татарча
tt-latn - tatarça
tum - chiTumbuka
tw - Twi
ty - reo tahiti
tyv - тыва дыл
tzm - ⵜⴰⵎⴰⵣⵉⵖⵜ
udm - удмурт
ug - ئۇيغۇرچە / Uyghurche
ug-arab - ئۇيغۇرچە
ug-latn - Uyghurche
uk - українська
ur - اردو
uz - oʻzbekcha / ўзбекча
uz-cyrl - ўзбекча
uz-latn - oʻzbekcha
ve - Tshivenda
vec - vèneto
vep - vepsän kel’
vi - Tiếng Việt
vls - West-Vlams
vmf - Mainfränkisch
vmw - emakhuwa
vo - Volapük
vot - Vaďďa
vro - võro
wa - walon
wal - wolaytta
war - Winaray
wls - Fakaʻuvea
wo - Wolof
wuu - 吴语
xal - хальмг
xh - isiXhosa
xmf - მარგალური
xsy - saisiyat
yi - ייִדיש
yo - Yorùbá
yrl - Nhẽẽgatú
yue - 粵語
za - Vahcuengh
zea - Zeêuws
zgh - ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
zh - 中文
zh-cn - 中文(中国大陆)
zh-hans - 中文(简体)
zh-hant - 中文(繁體)
zh-hk - 中文(香港)
zh-mo - 中文(澳門)
zh-my - 中文(马来西亚)
zh-sg - 中文(新加坡)
zh-tw - 中文(臺灣)
zu - isiZulu
Format
Export for off-line translation
Export in native format
Export in CSV format
Fetch
<languages/> {{Macro |Name=Macro_screw_maker1_2 |Icon=Macro_screw_maker1_2.png |Description=Creates a screw, bolt... with or without thread, according to ISO standards. |Author=Ulrich Brammer |Version=2.3.1 |Date=2018-10-22 |FCVersion=All |Download=[https://wiki.freecad.org/images/0/00/Macro_screw_maker1_2.png ToolBar Icon] }} ==Description== This macro creates a screw with or without thread, according to ISO standards. {{Codeextralink|https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/ObjectCreation/ScrewMaker.FCMacro}} [[File:Macro_screw_maker_01.png|400px]] {{Caption|Screw maker}} ==Usage== # Select the characteristics of the screw and click on the create button. # 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. # There is a message text, that will inform you, when the selected combination of properties is not available. <center> <gallery widths="300" heights="200"> File:Macro_screw_maker_02.png|Interface of '''screw_maker''' and a few types of screws. File:Macro_screw_maker_03.png|A screw with thread </gallery> </center> The creation of the thread takes some time. Be patient and have a look at the CPU-usage. ==Script== The latest version of the macro is to be found at [https://github.com/FreeCAD/FreeCAD-macros/blob/master/ObjectCreation/ScrewMaker.FCMacro ScrewMaker.FCMacro] but the easiest way to install this macro is through the [[Std_AddonMgr|Addon Manager]]. ToolBar Icon [[Image:Macro_screw_maker1_2.png]] '''Macro_screw_maker_2.FCMacro''' {{MacroCode|code= #!/usr/bin/env python # -*- coding: utf-8 -*- # # screw_maker2_0.py # """ Macro to generate screws with FreeCAD. Version 1.4 from 1st of September 2013 Version 1.5 from 23rd of December 2013 Corrected hex-heads above M12 not done. Version 1.6 from 15th of March 2014 Added PySide support Version 1.7 from April 2014 fixed bool type error. (int is not anymore accepted at linux) fixed starting point of real thread at some screw types. Version 1.8 from July 2014 first approch for a faster real thread Version 1.9 / 2.0 July 2015 new calculation of starting point of thread shell-based approach for screw generation added: ISO 14582 Hexalobular socket countersunk head screws, high head ISO 14584 Hexalobular socket raised countersunk head screws ISO 7380-2 Hexagon socket button head screws with collar DIN 967 Cross recessed pan head screws with collar ISO 4032 Hexagon nuts, Style 1 ISO 4033 Hexagon nuts, Style 2 ISO 4035 Hexagon thin nuts, chamfered EN 1661 Hexagon nuts with flange ISO 7094 definitions Plain washers - Extra large series ISO 7092 definitions Plain washers - Small series ISO 7093-1 Plain washer - Large series Screw-tap to drill inner threads in parts with user defined length ScrewMaker can now also used as a python module. The following shows how to generate a screw from a python script: import screw_maker2_0 threadDef = 'M3.5' o = screw_maker2_0.Screw() t = screw_maker2_0.Screw.setThreadType(o,'real') # Creates a Document-Object with label describing the screw d = screw_maker2_0.Screw.createScrew(o, 'ISO1207', threadDef, '20', 'real') # creates a shape in memory t = screw_maker2_0.Screw.setThreadType(o,'real') s = screw_maker1_9d.Screw.makeIso7046(o, 'ISO14582', threadDef, 40.0) Part.show(s) to do: check ISO7380 usage of rs and rt, actual only rs is used check chamfer angle on hexogon heads and nuts *************************************************************************** * Copyright (c) 2013, 2014, 2015 * * Ulrich Brammer <ulrich1a[at]users.sourceforge.net> * * * * This file is a supplement to the FreeCAD CAx development system. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License (LGPL) * * as published by the Free Software Foundation; either version 2 of * * the License, or (at your option) any later version. * * for detail see the LICENCE text file. * * * * This software is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this macro; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * * USA * * * *************************************************************************** """ __author__ = "Ulrich Brammer <ulrich1a@users.sourceforge.net>" import FreeCAD, FreeCADGui, Part, math from FreeCAD import Base import DraftVecUtils try: from PySide import QtCore, QtGui #FreeCAD.Console.PrintMessage("PySide is used" + "\n") except: #FreeCAD.Console.PrintMessage("PyQt4 is needed" + "\n") from PyQt4 import QtCore, QtGui DEBUG = False # set to True to show debug messages; does not work, still todo. # Diameters included in this library/macro # some ISO-standards may include more diameters! # Dictionary used for user messages standard_diameters = { 'ISO4017': ('M1.6', 'M64'), # ISO 4017 Hex-head-screw 'ISO4014': ('M1.6', 'M64'), # ISO 4014 Hex-head-bolt 'EN1662': ('M5', 'M16'), # EN 1662 Hexagon bolts with flange, small series 'EN1665': ('M5', 'M20'), # EN 1665 Hexagon bolts with flange, heavy series 'ISO4762': ('M1.6', 'M64'), # ISO 4762 Hexagon socket head cap screws 'ISO2009': ('M1.6', 'M10'), # ISO 2009 Slotted countersunk flat head screws 'ISO2010': ('M1.6', 'M10'), # ISO 2010 Slotted raised countersunk head screws 'ISO1580': ('M1.6', 'M10'), # ISO 1580 Slotted pan head screws 'ISO7045': ('M1.6', 'M10'), # ISO 7045 Pan head screws type H cross recess 'ISO7046': ('M1.6', 'M10'), 'ISO7047': ('M1.6', 'M10'), 'ISO1207': ('M3', 'M10'), # ISO 1207 Slotted cheese head screws 'ISO7048': ('M2.5', 'M8'), # ISO 7048 Cross-recessed cheese head screws with type H cross recess 'ISO7380-1':('M3', 'M16'), # ISO 7380 Hexagon socket button head screws 'ISO7380-2':('M3', 'M16'), # ISO 7380 Hexagon socket button head screws with collar 'DIN967' :('M3', 'M8'), # DIN 967 Cross recessed pan head screws with collar 'ISO10642':('M3', 'M20'), # ISO 10642 Hexagon socket countersunk head screws 'ISO14579':('M2', 'M20'), # ISO 14579 Hexalobular socket head cap screws 'ISO14580':('M2', 'M10'), # ISO 14580 Hexalobular socket cheese head screws 'ISO14581':('M2', 'M10'), # ISO 14581 Hexalobular socket countersunk flat head screws (to do!!) 'ISO14582':('M3', 'M10'), # ISO 14582 Hexalobular socket countersunk head screws, high head 'ISO14583':('M2', 'M10'), # ISO 14583 Hexalobular socket pan head screws 'ISO14584':('M2', 'M10'), # ISO 14584 Hexalobular socket raised countersunk head screws 'ISO7089': ('M1.6', 'M64'), # Washer 'ISO7090': ('M5', 'M64'), # ISO 7090 definitions Plain washers, chamfered - Normal series 'ISO7091': ('M1.6', 'M64'), # ISO 7091 definitions Plain washer - Normal series Product Grade C 'ISO7092': ('M1.6', 'M36'), # ISO 7092 definitions Plain washers - Small series 'ISO7093-1': ('M3', 'M36'), # ISO 7093-1 Plain washer - Large series 'ISO7094': ('M5', 'M36'), # ISO 7094 definitions Plain washers - Extra large series 'ISO4032': ('M1.6', 'M64'), # ISO 4032 Hexagon nuts, Style 1 'ISO4033': ('M5', 'M36'), # ISO 4033 Hexagon nuts, Style 2 'ISO4035': ('M1.6', 'M64'), # ISO 4035 Hexagon thin nuts, chamfered 'ISO4036': ('M1.6', 'M10'), # ISO 4035 Hexagon thin nuts, unchamfered, todo no function coded 'EN1661': ('M5', 'M20')} # EN 1661 Hexagon nuts with flange # ISO 4017 Hex-head-screw # P, c, dw, e, k, r, s iso4017head={ 'M1.6': (0.35, 0.2, 2.9, 3.4, 1.1, 0.1, 3.2), 'M2': (0.40, 0.2, 3.7, 4.4, 1.4, 0.1, 4.0), 'M2.5': (0.45, 0.2, 4.6, 5.5, 1.7, 0.1, 5.0), 'M3': (0.5, 0.2, 5.2, 6.1, 2.0, 0.1, 5.5), '(M3.5)':(0.6, 0.2, 5.2, 6.6, 2.4, 0.1, 5.5), 'M4': (0.7, 0.2, 6.6, 7.7, 2.8, 0.2, 7.0), 'M5': (0.8, 0.2, 7.5, 8.9, 3.5, 0.2, 8.0), 'M6': (1.0, 0.2, 9.5, 11.05, 4.0, 0.25, 10.0), 'M8': (1.25, 0.3, 11.7, 14.5, 5.3, 0.25, 13.0), 'M10': (1.50, 0.3, 14.7, 17.9, 6.4, 0.4, 16.0), 'M12': (1.75, 0.3, 16.7, 20.1, 7.5, 0.6, 18.0), '(M14)': (2.00, 0.3, 20.5, 24.5, 8.8, 0.6, 22.0), 'M16': (2.00, 0.4, 22.4, 26.9, 10.0, 0.6, 24.0), '(M18)': (2.50, 0.4, 25.4, 30.2, 11.5, 0.6, 27.0), 'M20': (2.50, 0.4, 28.2, 33.7, 12.5, 0.8, 30.0), '(M22)': (2.50, 0.4, 31.8, 37.7, 14.0, 0.8, 34.0), 'M24': (3.00, 0.4, 33.7, 40.1, 15.0, 0.8, 36.0), '(M27)': (3.00, 0.4, 38.0, 45.2, 17.0, 1.0, 41.0), '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 '(M33)': (3.50, 0.4, 46.6, 55.4, 21.0, 1.0, 50.0), '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 '(M39)': (4.00, 0.5, 55.9, 66.5, 25.0, 1.0, 60.0), 'M42': (4.50, 0.7, 60.0, 71.3, 26.0, 1.2, 65.0), '(M45)': (4.50, 0.7, 64.7, 77.0, 28.0, 1.2, 70.0), 'M48': (5.00, 0.7, 69.5, 82.6, 30.0, 1.6, 75.0), '(M52)': (5.00, 0.7, 74.5, 88.3, 33.0, 1.6, 80.0), 'M56': (5.50, 0.7, 78.7, 93.6, 35.0, 2.0, 85.0), '(M60)': (5.50, 0.7, 82.7, 99.2, 38.0, 2.0, 90.0), 'M64': (6.00, 0.7, 88.2,104.9, 40.0, 2.0, 95.0) } iso4017length = { '2': ( 1.8, 2.2), '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '100':(99.3, 100.7), '110':(109.3, 110.7), '120':(119.3, 120.7), '130':(129.2, 130.8), '140':(139.2, 130.8), '150':(149.2, 150.8), '160':(159.2, 160.8), '180':(179.2, 180.8), '200':(199.1, 200.9) } # range of typical srew lengths # min_length, max_length iso4017range = { 'M1.6': ('2', '16'), 'M2': ('4', '20'), 'M2.5': ('5', '25'), 'M3': ('5', '30'), '(M3.5)':('8', '35'), 'M4': ('6', '40'), 'M5': ('8', '50'), 'M6': ('12', '60'), 'M8': ('16', '80'), 'M10': ('20','100'), 'M12': ('25','120'), '(M14)':('25','140'), 'M16': ('30','150'), '(M18)':('35','200'), 'M20': ('40','160'), '(M22)':('45','200'), 'M24': ('50','180'), '(M27)':('50','100'), 'M30': ('60','200'), '(M33)':('65','200'), 'M36': ('70','200'), '(M39)':('80','200'), 'M42': ('70','200'), '(M45)':('90','200'), 'M48': ('100','200'), '(M52)':('100','200'), 'M56': ('110','200'), '(M60)':('120','200'), 'M64': ('120','200') } # ISO 4014 Hex-head-bolt # P, b1, b2, b3, c, dw, e, k, r, s iso4014head={ 'M1.6': (0.35, 9.0, 15.0, 28.0, 0.2, 2.3, 3.4, 1.1, 0.1, 3.2), 'M2': (0.40, 10.0, 16.0, 29.0, 0.2, 3.0, 4.4, 1.4, 0.1, 4.0), 'M2.5': (0.45, 11.0, 17.0, 30.0, 0.2, 4.0, 5.5, 1.7, 0.1, 5.0), 'M3': (0.50, 12.0, 18.0, 31.0, 0.2, 4.6, 6.1, 2.0, 0.1, 5.5), '(M3.5)':(0.60, 13.0, 19.0, 32.0, 0.2, 5.1, 6.6, 2.4, 0.1, 6.0), 'M4': (0.70, 14.0, 20.0, 33.0, 0.2, 5.9, 7.7, 2.8, 0.2, 7.0), 'M5': (0.80, 16.0, 22.0, 35.0, 0.2, 6.9, 8.9, 3.5, 0.2, 8.0), 'M6': (1.00, 18.0, 24.0, 37.0, 0.2, 8.9, 11.05, 4.0, 0.25,10.0), 'M8': (1.25, 22.0, 28.0, 41.0, 0.3, 11.7, 14.5, 5.3, 0.4, 13.0), 'M10': (1.50, 26.0, 32.0, 45.0, 0.3, 14.7, 17.9, 6.4, 0.4, 16.0), 'M12': (1.75, 30.0, 36.0, 49.0, 0.3, 16.7, 20.1, 7.5, 0.6, 18.0), '(M14)': (2.00, 34.0, 40.0, 53.0, 0.3, 20.5, 24.5, 8.8, 0.6, 22.0), 'M16': (2.00, 38.0, 44.0, 57.0, 0.4, 22.4, 26.9, 10.0, 0.6, 24.0), '(M18)': (2.50, 42.0, 48.0, 61.0, 0.4, 25.4, 30.2, 11.5, 0.6, 27.0), 'M20': (2.50, 46.0, 52.0, 65.0, 0.4, 28.2, 33.7, 12.5, 0.8, 30.0), '(M22)': (2.50, 50.0, 56.0, 69.0, 0.4, 31.8, 37.7, 14.0, 0.8, 34.0), 'M24': (3.00, 54.0, 60.0, 73.0, 0.4, 33.7, 40.1, 15.0, 0.8, 36.0), '(M27)': (3.00, 60.0, 66.0, 79.0, 0.4, 38.0, 45.2, 17.0, 1.0, 41.0), '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 '(M33)': (3.50, 78.0, 78.0, 91.0, 0.4, 46.6, 55.4, 21.0, 1.0, 50.0), 'M36': (4.00, 84.0, 84.0, 97.0, 0.4, 51.2, 60.8, 22.5, 1.0, 55.0), '(M39)': (4.00, 90.0, 90.0, 103.0, 0.5, 55.9, 66.5, 25.0, 1.0, 60.0), 'M42': (4.50, 96.0, 96.0, 109.0, 0.6, 60.0, 71.3, 26.0, 1.2, 65.0), '(M45)': (4.50, 102.0, 102.0, 115.0, 0.7, 64.7, 77.0, 28.0, 1.2, 70.0), 'M48': (5.00, 108.0, 108.0, 121.0, 0.6, 69.5, 82.6, 30.0, 1.6, 75.0), '(M52)': (5.00, 116.0, 116.0, 129.0, 0.7, 74.5, 88.3, 33.0, 1.6, 80.0), 'M56': (5.50, 137.0, 137.0, 137.0, 0.6, 78.7, 93.6, 35.0, 2.0, 85.0), '(M60)': (5.50, 145.0, 145.0, 145.0, 0.7, 82.7, 99.2, 38.0, 2.0, 90.0), 'M64': (6.00, 153.0, 153.0, 153.0, 0.6, 88.2,104.9, 40.0, 2.0, 55.0) } iso4014length = { '12':(11.65, 12.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '100':(99.3, 100.7), '110':(109.3, 110.7), '120':(119.3, 120.7), '130':(129.2, 130.8), '140':(139.2, 130.8), '150':(149.2, 150.8), '160':(159.2, 160.8), '180':(179.2, 180.8), '200':(199.1, 200.9), '220':(219.1, 220.9), '240':(237.7, 242.3), '260':(219.1, 220.9), '280':(219.1, 220.9), '300':(219.1, 220.9), '320':(219.1, 220.9), '340':(219.1, 220.9), '360':(219.1, 220.9), '380':(219.1, 220.9), '400':(219.1, 220.9), '420':(219.1, 220.9), '440':(219.1, 220.9), '460':(219.1, 220.9), '480':(219.1, 220.9), '500':(496.85, 503.15) } # range of typical srew lengths # min_length, max_length iso4014range = { 'M1.6':('12', '16'), 'M2': ('16', '20'), 'M2.5':('16', '25'), 'M3': ('20', '30'), '(M3.5)':('20', '35'), 'M4': ('25', '50'), 'M5': ('25', '50'), 'M6': ('30', '130'), 'M8': ('30', '180'), 'M10': ('35', '150'), 'M12': ('50', '150'), '(M14)': ('50', '160'), 'M16': ('55', '200'), '(M18)':('70','180'), 'M20': ('60', '300'), '(M22)':('70','220'), 'M24': ('80', '220'), '(M27)':('90', '220'), 'M30': ('110','300'), '(M33)':('130','320'), 'M36': ('140','360'), '(M39)':('150','380'), 'M42': ('160','440'), '(M45)':('180','440'), 'M48': ('180','480'), '(M52)':('200','480'), 'M56': ('220','500'), '(M60)':('220','500'), 'M64': ('260','500') } # EN 1662 Hexagon bolts with flange, small series # P, b0, b1, b2, b3, c, dc, dw, e, k, kw, lf, r1, s en1662def={ '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), '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), '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), '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), '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), '(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), '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)} # range of typical srew lengths # min_length, max_length en1662range = { 'M5': ('10', '50'), 'M6': ('12', '60'), 'M8': ('16', '80'), 'M10':('20','100'), 'M12':('25','120'), '(M14)':('30','140'), 'M16':('35','160') } en1662length = { '10':( 9.71, 10.29), '12':(11.65, 12.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '90':(89.3, 90.7), '100':(99.3, 100.7), '110':(109.3, 110.7), '120':(119.3, 120.7), '130':(129.2, 130.8), '140':(139.2, 130.8), '150':(149.2, 150.8), '160':(159.2, 160.8) } # EN 1665 Hexagon bolts with flange, heavy series # P, b0, b1, b2, b3, c, dc, dw, e, k, kw, lf, r1, s en1665def={ '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), '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), '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), '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), '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), '(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), '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), '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)} # range of typical srew lengths # min_length, max_length en1665range = { 'M5': ('10', '50'), 'M6': ('12', '60'), 'M8': ('16', '80'), 'M10':('20','100'), 'M12':('25','120'), '(M14)':('30','140'), 'M16':('35','160'), 'M20':('65','200') } en1665length = { '10':( 9.71, 10.29), '12':(11.65, 12.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '90':(89.3, 90.7), '100':(99.3, 100.7), '110':(109.3, 110.7), '120':(119.3, 120.7), '130':(129.2, 130.8), '140':(139.2, 130.8), '150':(149.2, 150.8), '160':(159.2, 160.8), '180':(179.2, 180.8), '200':(199.1, 200.9) } # ISO 1207 definitions Class A, Slotted cheese head screws # P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x iso1207def={ 'M1.6':(0.35, 0.7, 25.0, 3.0, 2.9, 2.0, 1.1, 0.46, 0.1, 0.45, 0.9), 'M2': (0.40, 0.8, 25.0, 3.8, 3.7, 2.6, 1.4, 0.56, 0.1, 0.6, 1.0), 'M2.5':(0.45, 0.9, 25.0, 4.5, 4.4, 3.1, 1.8, 0.66, 0.1, 0.7, 1.1), 'M3': (0.50, 1.0, 25.0, 5.5, 5.4, 3.6, 2.0, 0.86, 0.1, 0.85, 1.25), '(M3.5)':(0.60, 1.2, 38.0, 6.0, 5.9, 4.1, 2.4, 1.06, 0.1, 1.0, 1.5), 'M4': (0.70, 1.4, 38.0, 7.0, 6.9, 4.7, 2.6, 1.26, 0.2, 1.1, 1.75), 'M5': (0.80, 1.6, 38.0, 8.5, 8.4, 5.7, 3.3, 1.26, 0.2, 1.3, 2.0), 'M6': (1.00, 2.0, 38.0, 10.0, 9.9, 6.8, 3.9, 1.66, 0.25,1.6, 2.5), 'M8': (1.25, 2.5, 38.0, 13.0, 12.85, 9.2, 5.0, 2.06, 0.4, 2.0, 3.2), 'M10': (1.50, 3.0, 38.0, 16.0, 15.85, 11.2,6.0, 2.56, 0.4, 2.4, 3.8)} # range of typical srew lengths # min_length, max_length iso1207range = { 'M1.6':('2', '16'), 'M2': ('3', '20'), 'M2.5':('3', '25'), 'M3': ('4', '30'), '(M3.5)':('5', '35'), 'M4': ('5', '40'), 'M5': ('6', '50'), 'M6': ('8', '60'), 'M8': ('10', '80'), 'M10':('12', '80')} # slotted cheese head screws # nom length: l_min, l_max iso1207length = { '2': (1.8, 2.2), '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.05, 55.95), '60':(59.05, 60.95), '65':(64.05, 65.95), '70':(69.05, 70.95), '75':(74.05, 75.95), '80':(79.05, 80.95) } # ISO 14580 definitions , Hexalobular socket cheese head screws # P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x # tt, k, A, t_mean iso14580def={ 'M2': ('T6', 1.55, 1.75, 0.8), 'M2.5':('T8', 1.85, 2.40, 0.9), 'M3': ('T10', 2.40, 2.80, 1.2), '(M3.5)':('T15', 2.60, 3.35, 1.3), 'M4': ('T20', 3.10, 3.95, 1.5), 'M5': ('T25', 3.65, 4.50, 1.7), 'M6': ('T30', 4.40, 5.60, 2.1), 'M8': ('T45', 5.80, 7.95, 2.9), 'M10': ('T50', 6.90, 8.95, 3.3)} # range of typical srew lengths # min_length, max_length # iso14580range = iso1207range # nom length: l_min, l_max iso14580length = { '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.05, 55.95), '60':(59.05, 60.95), '65':(64.05, 65.95), '70':(69.05, 70.95), '75':(74.05, 75.95), '80':(79.05, 80.95) } # ISO 7048 definitions Class A, # Cross-recessed cheese head screws with type H or Z cross recess # P, a, b, dk, dk_mean, da, k, r, x, cT, mH, mZ iso7048def={ '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), 'M3': (0.50, 1.0, 25.0, 5.5, 5.4, 3.6, 2.0, 0.1, 1.25,'2', 3.5, 3.5), '(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), 'M4': (0.70, 1.4, 38.0, 7.0, 6.9, 4.7, 2.6, 0.2, 1.75,'2', 4.1, 4.0), 'M5': (0.80, 1.6, 38.0, 8.5, 8.4, 5.7, 3.3, 0.2, 2.0, '2', 4.8, 4.6), 'M6': (1.00, 2.0, 38.0, 10.0, 9.9, 6.8, 3.9, 0.25,2.5, '3', 6.2, 6.1), 'M8': (1.25, 2.5, 38.0, 13.0, 12.85, 9.2, 5.0, 0.4, 3.2, '3', 7.7, 7.5) } # range of typical srew lengths # min_length, max_length iso7048range = { 'M2.5':('3', '25'), 'M3': ('4', '30'), '(M3.5)':('5', '35'), 'M4': ('5', '40'), 'M5': ('6', '50'), 'M6': ('8', '60'), 'M8': ('10', '80')} # nom length: l_min, l_max iso7048length = { '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '60':(59.05, 60.95), '70':(69.05, 70.95), '80':(79.05, 80.95) } # Button Head Screw # nom length: l_min, l_max iso7380length = { #'2.5':(2.3, 2.7), #'3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.05, 55.95), '60':(59.05, 60.95), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '90':(89.3, 90.7) } # ISO 7380-1 definitions Class A # http://www.agrati.com/it/unificati/it/gamma/unificati/home02.htm # P, b, a, da, dk, dk_mean,s_mean,t_min, r, k, e, w, iso7380def={ '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), '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), '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), '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), '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), '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), '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), '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) } # range of typical srew lengths # min_length, max_length iso7380range = { 'M3': ('6', '30'), 'M4': ('6', '40'), 'M5': ('8', '50'), 'M6': ('10', '60'), 'M8': ('12', '80'), 'M10':('16', '90'), 'M12':('20', '90'), 'M16':('25', '90')} # ISO 7380-2 definitions # P, b, c, da, dk, dk_c,s_mean,t_min, r, k, e, w, iso7380_2def={ '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), '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), '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), '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), '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), '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), '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), '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) } # DIN 967 definitions: Cross recessed pan head screw with collar # P, b, c, da, dk, r, k, rf, x, cT, mH, mZ din967def={ 'M3': (0.50, 25.0, 0.7, 3.6, 7.5, 0.1, 2.35, 3.8, 1.25, '1', 3.0, 2.9), '(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), 'M4': (0.70, 38.0, 1.0, 4.7, 10.0, 0.2, 3.05, 5.8, 1.75, '2', 4.6, 4.3), 'M5': (0.80, 38.0, 1.2, 5.7, 11.5, 0.2, 3.55, 6.6, 2.0, '2', 5.0, 4.7), 'M6': (1.00, 38.0, 1.6, 6.8, 14.5, 0.25,4.55, 8.2, 2.5, '3', 7.1, 6.7), 'M8': (1.25, 38.0, 2.0, 9.2, 19.0, 0.4, 5.90, 11.0, 3.2, '4', 9.0, 8.8) } # range of typical srew lengths # min_length, max_length din967range = { 'M3': ('4', '30'), '(M3.5)': ('5', '35'), 'M4': ('5', '40'), 'M5': ('6', '45'), 'M6': ('8', '60'), 'M8': ('10', '60') } # Button Head Screw # nom length: l_min, l_max din967length = { '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.05, 55.95), '60':(59.05, 60.95) } L_iso2009length =['2.5','3','4','5','6','8','10','12','14','16','20', \ '25','30','35','40','45','50','55','60','65','70','75','80'] # nom length: l_min, l_max iso2009length = { '2.5':(2.3, 2.7), '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.05, 55.95), '60':(59.05, 60.95), '65':(64.05, 65.95), '70':(69.05, 70.95), '75':(74.05, 75.95), '80':(79.05, 80.95) } # ISO 2009 definitions Class A # P, a, b, dk_theo, dk_mean, k, n_min, r, t_mean, x iso2009def={ 'M1.6':(0.35, 0.7, 25, 3.6, 2.8, 1.0, 0.46, 0.2, 0.4, 0.9), 'M2': (0.40, 0.8, 25, 4.4, 3.6, 1.2, 0.56, 0.3, 0.5, 1.0), 'M2.5':(0.45, 0.9, 25, 5.5, 4.5, 1.5, 0.66, 0.3, 0.6, 1.1), 'M3': (0.50, 1.0, 25, 6.3, 5.3, 1.65, 0.86, 0.4, 0.7, 1.25), '(M3.5)':(0.60, 1.2, 38, 8.2, 7.1, 2.35, 1.06, 0.4, 1.0, 1.5), 'M4': (0.70, 1.4, 38, 9.4, 8.2, 2.7, 1.26, 0.5, 1.1, 1.75), 'M5': (0.80, 1.6, 38,10.4, 9.2, 2.7, 1.26, 0.6, 1.2, 2.0), 'M6': (1.00, 2.0, 38,12.6, 11.2, 3.3, 1.66, 0.7, 1.4, 2.5), 'M8': (1.25, 2.5, 38,17.3, 15.6, 4.65, 2.06, 1.0, 2.0, 3.2), 'M10': (1.50, 3.0, 38,20.0, 18.1, 5.0, 2.56, 1.2, 2.3, 3.8)} # range of typical srew lengths # min_length, max_length iso2009range = { 'M1.6':('2.5', '16'), 'M2': ('3', '20'), 'M2.5':('4', '25'), 'M3': ('5', '30'), '(M3.5)':('6', '35'), 'M4': ('6', '40'), 'M5': ('8', '50'), 'M6': ('8', '60'), 'M8': ('10', '80'), 'M10':('12', '80')} # ISO 7046 definitions Class A # ISO 7046 Countersunk flat head srews (common head style) # with type H or type Z cross recess # Parameters P, a, b, dk_theo, dk_mean, k, r, x to be read from iso2009def # Length = iso7045length # cT, mH, mZ iso7046def={ 'M1.6':('0', 1.6, 1.6), 'M2': ('0', 1.9, 1.9), 'M2.5':('1', 2.9, 2.8), 'M3': ('1', 3.2, 3.0), '(M3.5)':('2', 4.4, 4.1), 'M4': ('2', 4.6, 4.4), 'M5': ('2', 5.2, 4.0), 'M6': ('3', 6.8, 6.6), 'M8': ('4', 8.9, 8.8), 'M10': ('4', 10.0,9.8)} # range of typical srew lengths # min_length, max_length iso7046range = { 'M1.6':('3', '16'), 'M2': ('3', '20'), 'M2.5':('3', '25'), 'M3': ('4', '30'), '(M3.5)':('5', '35'), 'M4': ('5', '40'), 'M5': ('6', '50'), 'M6': ('8', '60'), 'M8': ('10', '60'), 'M10':('12', '60')} # ISO 2010, ISO 7047 definitions Class A: Raised Countersunk head srews # ISO 2010 slotted screws (common head style) range = iso2009range # ISO 7047 with type H or type Z cross recess range = iso7046range # Parameters P, a, b, dk_theo, dk_mean, k, r, x to be read from iso2009def # Length = iso7045length # rf, t_mean, cT, mH, mZ Raised_countersunk_def={ 'M1.6':(3.0, 0.7, '0', 1.9, 1.9), 'M2': (4.0, 0.9, '0', 2.0, 2.2), 'M2.5':(5.0, 1.1, '1', 3.0, 2.8), 'M3': (6.0, 1.3, '1', 3.4, 3.1), '(M3.5)':(8.5, 1.5, '2', 4.8, 4.6), 'M4': (9.5, 1.8, '2', 5.2, 5.0), 'M5': (9.5, 2.2, '2', 5.4, 5.3), 'M6': (12.0, 2.6, '3', 7.3, 7.1), 'M8': (16.5, 3.5, '4', 9.6, 9.5), 'M10': (19.5, 4.1, '4', 10.4,10.3)} # ISO 14582 definitions # P, a, b, dk_theo, dk_mean,k, r, tt, A, t_mean iso14582def={ 'M3': (0.50, 1.0, 18.0, 7.40, 6.5, 2.20, 0.10, 'T10', 2.80, 1.1), 'M4': (0.70, 1.4, 20.0, 10.02, 9.0, 3.01, 0.20, 'T20', 3.95, 1.6), 'M5': (0.80, 1.6, 22.0, 12.00, 10.8, 3.50, 0.20, 'T25', 4.50, 1.8), 'M6': (1.00, 2.0, 24.0, 14.44, 13.1, 4.22, 0.25, 'T30', 5.60, 2.2), 'M8': (1.25, 2.5, 28.0, 19.38, 17.8, 5.69, 0.40, 'T45', 7.93, 2.8), 'M10': (1.50, 3.0, 32.0, 23.00, 21.1, 6.50, 0.40, 'T50', 8.95, 3.3)} # range of typical srew lengths # min_length, max_length iso14582range = { 'M3': ('8', '30'), 'M4': ('8', '40'), 'M5': ('8', '50'), 'M6': ('8', '60'), 'M8': ('10', '80'), 'M10':('12', '100')} # nom length: l_min, l_max iso14582length = { '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '90':(89.3, 90.7), '100':(99.3, 100.7) } # ISO 1580 definitions Class A, Slotted pan head screws # P, a, b, dk_max,da, k, n_min, r, rf, t_mean, x iso1580def={ 'M1.6':(0.35, 0.7, 25, 3.2, 2.0, 1.0, 0.46, 0.1, 0.5, 0.4, 0.9), 'M2': (0.4, 0.8, 25, 4.0, 2.6, 1.3, 0.56, 0.1, 0.6, 0.5, 1.0), 'M2.5':(0.45, 0.9, 25, 5.0, 3.1, 1.5, 0.66, 0.1, 0.8, 0.6, 1.1), 'M3': (0.5, 1.0, 25, 5.6, 3.6, 1.8, 0.86, 0.1, 0.9, 0.7, 1.25), '(M3.5)':(0.6, 1.2, 38, 7.0, 4.1, 2.1, 1.06, 0.1, 1.0, 0.8, 1.5), 'M4': (0.7, 1.4, 38, 8.0, 4.7, 2.4, 1.26, 0.2, 1.2, 1.0, 1.75), 'M5': (0.8, 1.6, 38, 9.5, 5.7, 3.0, 1.26, 0.2, 1.5, 1.2, 2.0), 'M6': (1.0, 2.0, 38, 12.0, 6.8, 3.6, 1.66, 0.25,1.8, 1.4, 2.5), 'M8': (1.25, 2.5, 38, 16.0, 9.2, 4.8, 2.06, 0.4, 2.4, 1.9, 3.2), 'M10': (1.50, 3.0, 38, 20.0,11.2, 6.0, 2.56, 0.4, 3.0, 2.4, 3.8)} # ISO 7045 definitions Class A, Pan head screws with type H or type Z # partly used also for ISO 14583 Hexalobular socket pan head screws # cross recess; cT = size of cross recess # P, a, b, dk_max,da, k, r, rf, x, cT, mH, mZ iso7045def={ 'M1.6':(0.35, 0.7, 25, 3.2, 2.0, 1.3, 0.1, 2.5, 0.9, '0', 1.7, 1.6), 'M2': (0.4, 0.8, 25, 4.0, 2.6, 1.6, 0.1, 3.2, 1.0, '0', 1.9, 2.1), 'M2.5':(0.45, 0.9, 25, 5.0, 3.1, 2.1, 0.1, 4.0, 1.1, '1', 2.7, 2.6), 'M3': (0.5, 1.0, 25, 5.6, 3.6, 2.4, 0.1, 5.0, 1.25,'1', 3.0, 2.8), '(M3.5)':(0.6, 1.2, 38, 7.0, 4.1, 2.6, 0.1, 6.0, 1.5, '2', 3.9, 3.9), 'M4': (0.7, 1.4, 38, 8.0, 4.7, 3.1, 0.2, 6.5, 1.75,'2', 4.4, 4.3), 'M5': (0.8, 1.6, 38, 9.5, 5.7, 3.7, 0.2, 8.0, 2.0, '2', 4.9, 4.7), 'M6': (1.0, 2.0, 38, 12.0, 6.8, 4.6, 0.25,10., 2.5, '3', 6.9, 6.7), 'M8': (1.25, 2.5, 38, 16.0, 9.2, 6.0, 0.4, 13., 3.2, '4', 9.0, 8.8), 'M10': (1.50, 3.0, 38, 20.0,11.2, 7.5, 0.4, 16., 3.8, '4', 10.1,9.9)} # nom length: l_min, l_max iso7045length = { '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.05, 55.95), '60':(59.05, 60.95) } # range of typical srew lengths # min_length, max_length iso7045range = { 'M1.6':('3', '16'), 'M2': ('3', '20'), 'M2.5':('3', '25'), 'M3': ('4', '30'), '(M3.5)':('5', '35'), 'M4': ('5', '40'), 'M5': ('6', '45'), 'M6': ('8', '60'), 'M8': ('10', '60'), 'M10':('12', '60')} # ISO 14583 Hexalobular socket pan head screws # hexalobular recess; tt = size of hexalobular recess # tt, A, t_mean iso14583def={ 'M2': ('T6', 1.75, 0.7), 'M2.5':('T8', 2.40, 1.0), 'M3': ('T10', 2.80, 1.2), '(M3.5)':('T15', 3.35, 1.3), 'M4': ('T20', 3.95, 1.5), 'M5': ('T25', 4.50, 1.7), 'M6': ('T30', 5.60, 2.2), 'M8': ('T45', 7.95, 3.0), 'M10': ('T50', 8.95, 3.8)} #iso14583range = iso7046range #iso14583length = iso7045length # ISO 14584 Hexalobular socket raised countersunk head screws # P, b, dk_theo, dk_mean, f, k, r, rf, x, tt, A, t_mean iso14584def={ 'M2': (0.40, 25.0, 4.4, 3.8, 0.5, 1.20, 0.2, 4.0, 1.00, 'T6', 1.75, 0.7), '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), 'M3': (0.50, 25.0, 6.3, 5.5, 0.7, 1.65, 0.4, 6.0, 1.25, 'T10', 2.80, 1.2), '(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), 'M4': (0.70, 38.0, 9.4, 8.4, 1.0, 2.70, 0.5, 9.5, 1.75, 'T20', 3.95, 1.5), 'M5': (0.80, 38.0, 10.4, 9.3, 1.2, 2.70, 0.6, 9.5, 2.00, 'T25', 4.50, 1.7), 'M6': (1.00, 38.0, 12.6, 11.3, 1.4, 3.30, 0.7, 12.0, 2.50, 'T30', 5.60, 2.2), 'M8': (1.25, 38.0, 17.3, 15.8, 2.0, 4.65, 1.0, 16.5, 3.20, 'T45', 7.95, 3.0), 'M10': (1.50, 38.0, 20.0, 18.3, 2.3, 5.00, 1.2, 19.5, 3.80, 'T50', 8.95, 3.8)} # range of typical srew lengths # min_length, max_length iso14584range = { 'M2': ('3', '20'), 'M2.5':('3', '25'), 'M3': ('4', '30'), '(M3.5)':('5', '35'), 'M4': ('5', '40'), 'M5': ('6', '50'), 'M6': ('8', '60'), 'M8': ('10', '60'), 'M10':('12', '60')} #iso14584length = iso7045length # ISO 4762 Hexagon socket head cap screws ( Allan screw) # ISO 4762 definitions # P, b, dk_max, da, ds_min, e, lf, k, r, s_mean, t, v, dw, w iso4762def={ '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), '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), '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), '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), '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), '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), '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), '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), '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), '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), '(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), '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), '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), '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), '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), '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), '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), '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), '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), '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) } # nom length: l_min, l_max iso4762length = { '2.5':(2.3, 2.7), '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '14':(13.65, 14.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '75':(74.4, 75.6), '80':(79.4, 80.6), '100':(99.3, 100.7), '110':(109.3, 110.7), '120':(119.3, 120.7), '130':(129.2, 130.8), '140':(139.2, 130.8), '150':(149.2, 150.8), '160':(159.2, 160.8), '180':(179.2, 180.8), '200':(199.1, 200.9), '220':(219.1, 220.9), '240':(237.7, 242.3), '260':(219.1, 220.9), '280':(219.1, 220.9), '300':(219.1, 220.9) } # range of typical srew lengths # min_length, max_length iso4762range = { 'M1.6':('2.5', '16'), 'M2': ('3', '20'), 'M2.5':('4', '25'), 'M3': ('5', '30'), '(M3.5)':('6', '35'), 'M4': ('6', '40'), 'M5': ('8', '50'), 'M6': ('8', '60'), 'M8': ('10', '80'), 'M10':('16', '100'), 'M12':('20', '120'), '(M14)':('25', '140'), 'M16':('25', '160'), 'M20':('16', '100'), 'M24':('40', '200'), 'M30':('45', '200'), 'M36':('55', '200'), 'M42':('60', '300'), 'M48':('100','300'), 'M56':('110','300'), 'M64':('120','300') } # ISO 14579 Hexalobular socket head cap screws # hexalobular recess; tt = size of hexalobular recess # tt, A, t_mean iso14579def={ 'M2': ( 'T6', 1.75, 0.8), 'M2.5':( 'T8', 2.40, 1.0), 'M3': ('T10', 2.80, 1.2), 'M4': ('T20', 3.95, 1.7), 'M5': ('T25', 4.50, 1.9), 'M6': ('T30', 5.60, 2.3), 'M8': ('T45', 7.95, 3.2), 'M10': ('T50', 8.95, 3.8), 'M12': ('T55', 11.35, 5.0), '(M14)': ('T60', 13.45, 5.8), 'M16': ('T70', 15.70, 6.8), '(M18)': ('T80', 17.75, 7.8), 'M20': ('T90', 20.20, 9.0), } # range of typical srew lengths # min_length, max_length iso14579range = { 'M2': ('3', '20'), 'M2.5':('4', '25'), 'M3': ('5', '30'), 'M4': ('6', '40'), 'M5': ('8', '50'), 'M6': ('10', '60'), 'M8': ('12', '80'), 'M10':('16','100'), 'M12':('20','120'), '(M14)':('25','140'), 'M16':('25','160'), '(M18)':('30','180'), 'M20':('30','200'), } iso14579length = { '3': ( 2.8, 3.2), '4': ( 3.76, 4.24), '5': ( 4.76, 5.24), '6': ( 5.76, 6.24), '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '90':(89.3, 90.7), '100':(99.3, 100.7), '110':(109.3, 110.7), '120':(119.3, 120.7), '130':(129.2, 130.8), '140':(139.2, 130.8), '150':(149.2, 150.8), '160':(159.2, 160.8), '180':(179.2, 180.8), '200':(199.1, 200.9) } # ISO 10642 Hexagon socket countersunk head screws ( Allan screw) # ISO 10642 definitions # P, b, dk_theo, dk_mean,da, ds_min, e, k, r, s_mean, t, w iso10642def={ '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), '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), '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), '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), '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), '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), '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), '(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), '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), '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)} # range of typical srew lengths # min_length, max_length iso10642range = { 'M3': ('8', '30'), 'M4': ('8', '40'), 'M5': ('8', '50'), 'M6': ('8', '60'), 'M8': ('10', '80'), 'M10':('12','100'), 'M12':('20','100'), '(M14)':('25','100'), 'M16':('30','100'), 'M20':('35','100'), } iso10642length = { '8': ( 7.71, 8.29), '10':( 9.71, 10.29), '12':(11.65, 12.35), '16':(15.65, 16.35), '20':(19.58, 20.42), '25':(24.58, 25.42), '30':(29.58, 30.42), '35':(34.5, 35.5), '40':(39.5, 40.5), '45':(44.5, 45.5), '50':(49.5, 50.5), '55':(54.4, 55.6), '60':(59.4, 60.6), '65':(64.4, 65.6), '70':(69.4, 70.6), '80':(79.4, 80.6), '90':(89.3, 90.7), '100':(99.3, 100.7), } # ISO 7089 definitions Washer # d1_min, d2_max, h, h_max iso7089def={ 'M1.6':( 1.7, 4.0, 0.3, 0.35), 'M2': ( 2.2, 5.0, 0.3, 0.35), 'M2.5':( 2.7, 6.0, 0.5, 0.55), 'M3': ( 3.2, 7.0, 0.5, 0.55), 'M4': ( 4.3, 9.0, 0.8, 0.90), 'M5': ( 5.3, 10.0, 1.0, 1.10), 'M6': ( 6.4, 12.0, 1.6, 1.80), 'M8': ( 8.4, 16.0, 1.6, 1.80), 'M10': (10.5, 20.0, 2.0, 2.20), 'M12': (13.0, 24.0, 2.5, 2.70), 'M16': (17.0, 30.0, 3.0, 3.30), 'M20': (21.0, 37.0, 3.0, 3.30), 'M24': (25.0, 44.0, 4.0, 4.30), 'M30': (31.0, 56.0, 4.0, 4.30), 'M36': (37.0, 66.0, 5.0, 5.60), 'M42': (45.0, 78.0, 8.0, 9.0), 'M48': (52.0, 92.0, 8.0, 9.0), 'M56': (62.0,105.0,10.0, 11.0), 'M64': (70.0,115.0,10.0, 11.0) } # ISO 7090 definitions Plain washers, chamfered - Normal series # chamfer angle 30° / 45° # chamfer h/4 / h/2 # d1_min, d2_max, h, h_max iso7090def={ 'M5': ( 5.3, 10.0, 1.0, 1.10), 'M6': ( 6.4, 12.0, 1.6, 1.80), 'M8': ( 8.4, 16.0, 1.6, 1.80), 'M10': (10.5, 20.0, 2.0, 2.20), 'M12': (13.0, 24.0, 2.5, 2.70), 'M16': (17.0, 30.0, 3.0, 3.30), 'M20': (21.0, 37.0, 3.0, 3.30), 'M24': (25.0, 44.0, 4.0, 4.30), 'M30': (31.0, 56.0, 4.0, 4.30), 'M36': (37.0, 66.0, 5.0, 5.60), 'M42': (45.0, 78.0, 8.0, 9.0), 'M48': (52.0, 92.0, 8.0, 9.0), 'M56': (62.0,105.0,10.0, 11.0), 'M64': (70.0,115.0,10.0, 11.0) } # ISO 7091 definitions Plain washer - Normal series Product Grade C # d1_min, d2_max, h, h_max iso7091def={ 'M1.6':( 1.8, 4.0, 0.3, 0.35), 'M2': ( 2.4, 5.0, 0.3, 0.35), 'M2.5':( 2.9, 6.0, 0.5, 0.55), 'M3': ( 3.4, 7.0, 0.5, 0.55), 'M4': ( 4.5, 9.0, 0.8, 0.90), 'M5': ( 5.5, 10.0, 1.0, 1.10), 'M6': ( 6.6, 12.0, 1.6, 1.80), 'M8': ( 9.0, 16.0, 1.6, 1.80), 'M10': (11.0, 20.0, 2.0, 2.20), 'M12': (13.5, 24.0, 2.5, 2.70), 'M16': (17.5, 30.0, 3.0, 3.30), 'M20': (22.0, 37.0, 3.0, 3.30), 'M24': (26.0, 44.0, 4.0, 4.30), 'M30': (33.0, 56.0, 4.0, 4.30), 'M36': (39.0, 66.0, 5.0, 5.60), 'M42': (45.0, 78.0, 8.0, 9.0), 'M48': (52.0, 92.0, 8.0, 9.0), 'M56': (62.0,105.0,10.0, 11.0), 'M64': (70.0,115.0,10.0, 11.0) } # ISO 7092 definitions Plain washers - Small series # d1_min, d2_max, h, h_max iso7092def={ 'M1.6':( 1.7, 3.5, 0.3, 0.35), 'M2': ( 2.2, 4.5, 0.3, 0.35), 'M2.5':( 2.7, 5.0, 0.5, 0.55), 'M3': ( 3.2, 6.0, 0.5, 0.55), 'M4': ( 4.3, 8.0, 0.5, 0.55), 'M5': ( 5.3, 9.0, 1.0, 1.10), 'M6': ( 6.4, 11.0, 1.6, 1.80), 'M8': ( 8.4, 15.0, 1.6, 1.80), 'M10': (10.5, 18.0, 1.6, 1.80), 'M12': (13.0, 20.0, 2.0, 2.20), 'M16': (17.0, 28.0, 2.5, 2.70), 'M20': (21.0, 34.0, 3.0, 3.30), 'M24': (25.0, 39.0, 4.0, 4.30), 'M30': (31.0, 50.0, 4.0, 4.30), 'M36': (37.0, 60.0, 5.0, 5.60) } # ISO 7093-1 definitions Plain washers - Large series # d1_min, d2_max, h, h_max iso7093def={ 'M3': ( 3.2, 9.0, 0.8, 0.90), '(M3.5)':( 3.7, 11.0, 0.8, 0.90), 'M4': ( 4.3, 12.0, 1.0, 1.10), 'M5': ( 5.3, 15.0, 1.0, 1.10), 'M6': ( 6.4, 18.0, 1.6, 1.80), 'M8': ( 8.4, 24.0, 2.0, 2.20), 'M10': (10.5, 30.0, 2.5, 2.70), 'M12': (13.0, 37.0, 3.0, 3.30), '(M14)': (15.0, 44.0, 3.0, 3.30), 'M16': (17.0, 50.0, 3.0, 3.30), '(M18)': (19.0, 56.0, 4.0, 4.30), 'M20': (21.0, 60.0, 4.0, 4.30), '(M22)': (23.0, 66.0, 5.0, 5.60), 'M24': (25.0, 72.0, 5.0, 5.60), '(M27)': (30.0, 85.0, 6.0, 6.60), 'M30': (33.0, 92.0, 6.0, 6.60), '(M33)': (36.0,105.0, 6.0, 6.60), 'M36': (39.0,110.0, 8.0, 9.00) } # ISO 7094 definitions Plain washers - Extra large series # d1_min, d2_max, h, h_max iso7094def={ 'M5': ( 5.5, 18.0, 2.0, 2.3), 'M6': ( 6.6, 22.0, 2.0, 2.3), 'M8': ( 9.0, 28.0, 3.0, 3.6), 'M10': (11.0, 34.0, 3.0, 3.6), 'M12': (13.5, 44.0, 4.0, 4.6), '(M14)': (15.5, 50.0, 4.0, 4.6), 'M16': (17.5, 56.0, 5.0, 6.0), '(M18)': (20.0, 60.0, 5.0, 6.0), 'M20': (22.0, 72.0, 6.0, 7.0), '(M22)': (24.0, 80.0, 6.0, 7.0), 'M24': (26.0, 85.0, 6.0, 7.0), '(M27)': (30.0, 98.0, 6.0, 7.0), 'M30': (33.0,105.0, 6.0, 7.0), '(M33)': (36.0,115.0, 8.0, 9.2), 'M36': (39.0,125.0, 8.0, 9.2) } # ISO 4757:1983 Definition of cross recess type H # b, e_min, g, f_mean, r, t1, alpha, beta iso4757def = { '0': (0.61, 0.26, 0.81, 0.34, 0.3, 0.22, 138.0, 7.0 ), '1': (0.97, 0.41, 1.27, 0.54, 0.5, 0.34, 138.0, 7.0 ), '2': (1.47, 0.79, 2.29, 0.70, 0.6, 0.61, 140.0, 5.75), '3': (2.41, 1.98, 3.81, 0.83, 0.8, 1.01, 146.0, 5.75), '4': (3.48, 2.39, 5.08, 1.23, 1.0, 1.35, 153.0, 7.0 ) } # ISO 10664 Hexalobular internal driving feature for bolts and screws # A, B, Re iso10664def = { 'T6': ( 1.75, 1.205, 0.14), 'T8': ( 2.40, 1.67, 0.20), 'T10':( 2.80, 1.98, 0.24), 'T15':( 3.35, 2.35, 0.28), 'T20':( 3.95, 2.75, 0.32), 'T25':( 4.50, 3.16, 0.39), 'T30':( 5.60, 3.95, 0.46), 'T40':( 6.75, 4.76, 0.56), 'T45':( 7.93, 5.55, 0.59), 'T50':( 8.95, 6.36, 0.78), 'T55':(11.35, 7.92, 0.77), 'T60':(13.45, 9.48, 1.07), 'T70':(15.70, 11.08, 1.20), 'T80':(17.75, 12.64, 1.53), 'T90':(20.20, 14.22, 1.54), 'T100':(22.40,15.81, 1.73) } # ISO 4032 Hex-head-nut # P, c, damax, dw, e, m, mw, s_nom iso4032def={ 'M1.6': (0.35, 0.2, 1.84, 2.9, 3.4, 1.3, 0.8, 3.2), 'M2': (0.40, 0.2, 2.3, 3.7, 4.4, 1.6, 1.1, 4.0), 'M2.5': (0.45, 0.2, 2.9, 4.6, 5.5, 2.0, 1.4, 5.0), 'M3': (0.5, 0.2, 3.45, 5.2, 6.1, 2.4, 1.7, 5.5), '(M3.5)':(0.6, 0.2, 4.00, 5.7, 6.6, 2.8, 2.0, 6.0), 'M4': (0.7, 0.2, 4.6, 6.6, 7.7, 3.2, 2.3, 7.0), 'M5': (0.8, 0.2, 5.75, 7.5, 8.9, 3.5, 3.5, 8.0), 'M6': (1.0, 0.2, 6.75, 9.5, 11.05, 4.7, 3.9, 10.0), 'M8': (1.25, 0.3, 8.75, 11.7, 14.5, 6.8, 5.2, 13.0), 'M10': (1.50, 0.3, 10.8, 14.7, 17.9, 8.4, 6.4, 16.0), 'M12': (1.75, 0.3, 13.0, 16.7, 20.1, 10.8, 8.3, 18.0), '(M14)': (2.00, 0.3, 15.1, 20.5, 24.5, 12.8, 9.7, 22.0), 'M16': (2.00, 0.4, 17.3, 22.4, 26.9, 14.8, 11.3, 24.0), '(M18)': (2.50, 0.4, 19.5, 24.9, 29.6, 15.8, 12.3, 27.0), 'M20': (2.50, 0.4, 21.6, 28.2, 33.7, 18.0, 13.5, 30.0), '(M22)': (2.50, 0.4, 23.7, 31.4, 37.3, 19.4, 15.0, 34.0), 'M24': (3.00, 0.4, 25.9, 33.7, 40.1, 21.5, 16.2, 36.0), '(M27)': (3.00, 0.4, 29.1, 38.0, 45.2, 23.8, 18.0, 41.0), 'M30': (3.50, 0.4, 32.4, 42.8, 50.9, 25.6, 19.4, 46.0), '(M33)': (3.50, 0.4, 35.6, 46.6, 55.4, 28.7, 21.4, 50.0), 'M36': (4.00, 0.4, 38.9, 51.2, 61.0, 31.0, 23.5, 55.0), '(M39)': (4.00, 0.5, 42.1, 55.9, 66.5, 33.4, 24.5, 60.0), 'M42': (4.50, 0.7, 45.4, 60.0, 71.3, 34.0, 25.9, 65.0), '(M45)': (4.50, 0.7, 48.6, 64.7, 77.0, 36.0, 27.9, 70.0), 'M48': (5.00, 0.7, 51.8, 69.5, 82.6, 38.0, 29.1, 75.0), '(M52)': (5.00, 0.7, 56.2, 74.5, 88.3, 42.0, 32.1, 80.0), 'M56': (5.50, 0.7, 60.5, 78.7, 93.6, 45.0, 34.7, 85.0), '(M60)': (5.50, 0.7, 64.8, 82.7, 99.2, 48.0, 38.7, 90.0), 'M64': (6.00, 0.7, 69.1, 88.2,104.9, 51.0, 39.3, 95.0) } # ISO 4033 Hexagon nuts style 2 # P, c, damax, dw, e, m, mw, s_nom iso4033def={ 'M5': (0.8, 0.2, 5.75, 7.5, 8.9, 5.1, 3.5, 8.0), 'M6': (1.0, 0.2, 6.75, 9.5, 11.05, 5.7, 3.9, 10.0), 'M8': (1.25, 0.3, 8.75, 11.7, 14.5, 7.5, 5.2, 13.0), 'M10': (1.50, 0.3, 10.8, 14.7, 17.9, 9.3, 6.4, 16.0), 'M12': (1.75, 0.3, 13.0, 16.7, 20.1, 12.0, 8.3, 18.0), '(M14)': (2.00, 0.3, 15.1, 20.5, 24.5, 14.1, 9.7, 22.0), 'M16': (2.00, 0.4, 17.3, 22.4, 26.9, 16.4, 11.3, 24.0), 'M20': (2.50, 0.4, 21.6, 28.2, 33.7, 20.3, 13.5, 30.0), 'M24': (3.00, 0.4, 25.9, 33.7, 40.1, 23.9, 16.2, 36.0), 'M30': (3.50, 0.4, 32.4, 42.8, 50.9, 28.6, 19.4, 46.0), 'M36': (4.00, 0.4, 38.9, 51.2, 61.0, 33.1, 23.5, 55.0) } # ISO 4035 Hexagon thin nuts, chamfered # P, c, damax, dw, e, m, mw, s_nom iso4035def={ 'M1.6': (0.35, 0.2, 1.84, 2.9, 3.4, 1.0, 0.8, 3.2), 'M2': (0.40, 0.2, 2.3, 3.7, 4.4, 1.2, 1.1, 4.0), 'M2.5': (0.45, 0.2, 2.9, 4.6, 5.5, 1.6, 1.4, 5.0), 'M3': (0.5, 0.2, 3.45, 5.2, 6.1, 1.8, 1.7, 5.5), '(M3.5)':(0.6, 0.2, 4.00, 5.7, 6.6, 2.0, 2.0, 6.0), 'M4': (0.7, 0.2, 4.6, 6.6, 7.7, 2.2, 2.3, 7.0), 'M5': (0.8, 0.2, 5.75, 7.5, 8.9, 2.7, 3.5, 8.0), 'M6': (1.0, 0.2, 6.75, 9.5, 11.05, 3.2, 3.9, 10.0), 'M8': (1.25, 0.3, 8.75, 11.7, 14.5, 4.0, 5.2, 13.0), 'M10': (1.50, 0.3, 10.8, 14.7, 17.9, 5.0, 6.4, 16.0), 'M12': (1.75, 0.3, 13.0, 16.7, 20.1, 6.0, 8.3, 18.0), '(M14)': (2.00, 0.3, 15.1, 20.5, 24.5, 7.0, 9.7, 22.0), 'M16': (2.00, 0.4, 17.3, 22.4, 26.9, 8.0, 11.3, 24.0), '(M18)': (2.50, 0.4, 19.5, 24.9, 29.6, 9.0, 12.3, 27.0), 'M20': (2.50, 0.4, 21.6, 28.2, 33.7, 10.0, 13.5, 30.0), '(M22)': (2.50, 0.4, 23.7, 31.4, 37.3, 11.0, 15.0, 34.0), 'M24': (3.00, 0.4, 25.9, 33.7, 40.1, 12.0, 16.2, 36.0), '(M27)': (3.00, 0.4, 29.1, 38.0, 45.2, 13.5, 18.0, 41.0), 'M30': (3.50, 0.4, 32.4, 42.8, 50.9, 15.0, 19.4, 46.0), '(M33)': (3.50, 0.4, 35.6, 46.6, 55.4, 16.5, 21.4, 50.0), 'M36': (4.00, 0.4, 38.9, 51.2, 61.0, 18.0, 23.5, 55.0), '(M39)': (4.00, 0.5, 42.1, 55.9, 66.5, 19.5, 24.5, 60.0), 'M42': (4.50, 0.7, 45.4, 60.0, 71.3, 21.0, 25.9, 65.0), '(M45)': (4.50, 0.7, 48.6, 64.7, 77.0, 22.5, 27.9, 70.0), 'M48': (5.00, 0.7, 51.8, 69.5, 82.6, 24.0, 29.1, 75.0), '(M52)': (5.00, 0.7, 56.2, 74.5, 88.3, 26.0, 32.1, 80.0), 'M56': (5.50, 0.7, 60.5, 78.7, 93.6, 28.0, 34.7, 85.0), '(M60)': (5.50, 0.7, 64.8, 82.7, 99.2, 30.0, 38.7, 90.0), 'M64': (6.00, 0.7, 69.1, 88.2,104.9, 32.0, 39.3, 95.0) } # ISO 4036 Hexagon thin nuts, unchamfered # P, e, m, s_nom iso4036def={ 'M1.6': (0.35, 3.4, 1.0, 3.2), 'M2': (0.40, 4.4, 1.2, 4.0), 'M2.5': (0.45, 5.5, 1.6, 5.0), 'M3': (0.5, 6.1, 1.8, 5.5), '(M3.5)':(0.6, 6.6, 2.0, 6.0), 'M4': (0.7, 7.7, 2.2, 7.0), 'M5': (0.8, 8.9, 2.7, 8.0), 'M6': (1.0, 10.9, 3.2, 10.0), 'M8': (1.25, 14.5, 4.0, 13.0), 'M10': (1.50, 17.9, 5.0, 16.0)} # EN 1661 Hexagon nuts with flange # P, damax, c, dc, dw, e, m, mw, r, s en1661def={ 'M5' :(0.80, 5.75, 1.0, 11.8, 9.8, 8.79, 5.0, 2.5, 0.30, 8.0), 'M6' :(1.00, 6.75, 1.1, 14.2, 12.2, 11.05, 6.0, 3.1, 0.36, 10.0), 'M8' :(1.25, 8.75, 1.2, 17.9, 15.8, 14.38, 8.0, 4.6, 0.48, 13.0), 'M10' :(1.50, 10.80, 1.5, 21.8, 19.6, 17.77, 10.0, 5.9, 0.60, 16.0), 'M12' :(1.75, 13.00, 1.8, 26.0, 23.8, 20.03, 12.0, 6.8, 0.72, 18.0), '(M14)':(2.00, 15.10, 2.1, 29.9, 27.6, 23.36, 14.0, 7.7, 0.88, 21.0), 'M16' :(2.00, 17.30, 2.4, 34.5, 31.9, 26.75, 16.0, 8.9, 0.96, 24.0), 'M20' :(2.50, 21.60, 3.0, 42.8, 39.9, 33.23, 20.0,10.7, 1.20, 30.0)} # Tuning table to get valid shapes # P, tunIn, tunEx tuningTable={ 'M1.6':(0.35, 516, 516), 'M2': (0.40, 515, 516), 'M2.5':(0.45, 515, 515), 'M3': (0.5, 480, 502), '(M3.5)':(0.6, 480, 502), 'M4': (0.7, 510, 519), #last value needed for ISO7380 'M5': (0.8, 510, 510), 'M6': (1.0, 515, 515), 'M8': (1.25, 516, 516), 'M10': (1.50, 515, 515), 'M12': (1.75, 513, 513), '(M14)': (2.00, 513, 513), 'M16': (2.00, 513, 513), 'M20': (2.50, 513, 513), 'M24': (3.00, 513, 513), '(M27)': (3.00, 513, 513), 'M30': (3.50, 513, 513), '(M33)': (3.50, 513, 513), 'M36': (4.00, 513, 513), 'M42': (4.50, 515, 515), '(M45)': (4.50, 515, 515), 'M48': (5.00, 515, 505), # ISO4014: 505, 502 or 488; ISO4017: above 505 '(M52)': (5.00, 508, 508), 'M56': (5.50, 508, 508), '(M60)': (5.50, 508, 508), 'M64': (6.00, 489, 489) # Nut ISO4032: 489 } try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_ScrewMaker(object): def setupUi(self, ScrewMaker): FCUi = FreeCADGui.UiLoader() ScrewMaker.setObjectName(_fromUtf8("ScrewMaker")) ScrewMaker.resize(450, 362) ScrewMaker.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom)) self.layoutWidget = QtGui.QWidget(ScrewMaker) self.layoutWidget.setGeometry(QtCore.QRect(348, 35, 102, 161)) self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget) #self.verticalLayout_2.setMargin(0) self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) self.ScrewTypeLabel = QtGui.QLabel(self.layoutWidget) self.ScrewTypeLabel.setObjectName(_fromUtf8("ScrewTypeLabel")) self.verticalLayout_2.addWidget(self.ScrewTypeLabel) self.NomDiaLabel = QtGui.QLabel(self.layoutWidget) self.NomDiaLabel.setObjectName(_fromUtf8("NomDiaLabel")) self.verticalLayout_2.addWidget(self.NomDiaLabel) self.NomLenLabel = QtGui.QLabel(self.layoutWidget) self.NomLenLabel.setObjectName(_fromUtf8("NomLenLabel")) self.verticalLayout_2.addWidget(self.NomLenLabel) self.UserLenLabel = QtGui.QLabel(self.layoutWidget) self.UserLenLabel.setObjectName(_fromUtf8("UserLenLabel")) self.verticalLayout_2.addWidget(self.UserLenLabel) self.layoutWidget1 = QtGui.QWidget(ScrewMaker) self.layoutWidget1.setGeometry(QtCore.QRect(3, 35, 350, 166)) #self.layoutWidget1.setGeometry(QtCore.QRect(10, 5, 315, 200)) self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1")) self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget1) #self.verticalLayout.setMargin(0) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.ScrewType = QtGui.QComboBox(self.layoutWidget1) self.ScrewType.setObjectName(_fromUtf8("ScrewType")) for i in range(32): self.ScrewType.addItem(_fromUtf8("")) # 0 self.verticalLayout.addWidget(self.ScrewType) self.NominalDiameter = QtGui.QComboBox(self.layoutWidget1) self.NominalDiameter.setObjectName(_fromUtf8("NominalDiameter")) for i in range(28): self.NominalDiameter.addItem(_fromUtf8("")) # 0 self.verticalLayout.addWidget(self.NominalDiameter) self.NominalLength = QtGui.QComboBox(self.layoutWidget1) self.NominalLength.setObjectName(_fromUtf8("NominalLength")) for i in range(48): self.NominalLength.addItem(_fromUtf8("")) #0 self.verticalLayout.addWidget(self.NominalLength) #self.UserLen = QtGui.QComboBox(self.layoutWidget1) self.UserLen = FCUi.createWidget("Gui::InputField") self.UserLen.setObjectName(_fromUtf8("UserLen")) #self.UserLen.addItem(_fromUtf8("")) self.UserLen.setProperty("text", "0 mm") self.verticalLayout.addWidget(self.UserLen) #self.CommentLabel = QtGui.QLabel(self.layoutWidget) self.CommentLabel = QtGui.QLabel(ScrewMaker) self.CommentLabel.setObjectName(_fromUtf8("CommentLabel")) self.CommentLabel.setGeometry(QtCore.QRect(10, 184, 411, 21)) #self.verticalLayout.addWidget(self.CommentLabel) self.layoutWidget2 = QtGui.QWidget(ScrewMaker) #self.layoutWidget2.setGeometry(QtCore.QRect(10, 200, 321, 83)) self.layoutWidget2.setGeometry(QtCore.QRect(3, 200, 321, 120)) self.layoutWidget2.setObjectName(_fromUtf8("layoutWidget2")) self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget2) #self.verticalLayout_3.setMargin(0) self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.SimpleScrew = QtGui.QRadioButton(self.layoutWidget2) self.SimpleScrew.setChecked(True) self.SimpleScrew.setObjectName(_fromUtf8("SimpleScrew")) self.verticalLayout_3.addWidget(self.SimpleScrew) self.SymbolThread = QtGui.QRadioButton(self.layoutWidget2) self.SymbolThread.setObjectName(_fromUtf8("SymbolThread")) self.verticalLayout_3.addWidget(self.SymbolThread) self.RealThread = QtGui.QRadioButton(self.layoutWidget2) self.RealThread.setObjectName(_fromUtf8("RealThread")) self.verticalLayout_3.addWidget(self.RealThread) self.MessageLabel = QtGui.QLabel(ScrewMaker) self.MessageLabel.setGeometry(QtCore.QRect(10, 10, 411, 21)) self.MessageLabel.setProperty("Empty_text", _fromUtf8("")) self.MessageLabel.setObjectName(_fromUtf8("MessageLabel")) self.CreateButton = QtGui.QToolButton(ScrewMaker) self.CreateButton.setGeometry(QtCore.QRect(180, 320, 111, 26)) self.CreateButton.setObjectName(_fromUtf8("CreateButton")) self.ScrewAvailable = True self.simpThread = self.SimpleScrew.isChecked() self.symThread = self.SymbolThread.isChecked() self.rThread = self.RealThread.isChecked() self.theScrew = Screw() self.retranslateUi(ScrewMaker) self.NominalDiameter.setCurrentIndex(5) self.NominalLength.setCurrentIndex(9) QtCore.QObject.connect(self.ScrewType, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), self.guiCheck_Data) QtCore.QObject.connect(self.CreateButton, QtCore.SIGNAL(_fromUtf8("pressed()")), self.guiCreateScrew) QtCore.QObject.connect(self.NominalDiameter, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), self.guiCheck_Data) QtCore.QObject.connect(self.NominalLength, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), self.guiCheck_Data) QtCore.QMetaObject.connectSlotsByName(ScrewMaker) def retranslateUi(self, ScrewMaker): ScrewMaker.setWindowTitle(QtGui.QApplication.translate("ScrewMaker", "Screw-Maker 2.0", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewTypeLabel.setText(QtGui.QApplication.translate("ScrewMaker", "Type of Screw", None, QtGui.QApplication.UnicodeUTF8)) self.NomDiaLabel.setText(QtGui.QApplication.translate("ScrewMaker", "Nomimal\nDiameter", None, QtGui.QApplication.UnicodeUTF8)) self.NomLenLabel.setText(QtGui.QApplication.translate("ScrewMaker", "Nominal\nLength", None, QtGui.QApplication.UnicodeUTF8)) self.UserLenLabel.setText(QtGui.QApplication.translate("ScrewMaker", "User length \nfor screw-tap", None, QtGui.QApplication.UnicodeUTF8)) self.CommentLabel.setText(QtGui.QApplication.translate("ScrewMaker", "Values in brackets are not recommended!", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(0, QtGui.QApplication.translate("ScrewMaker", "ISO4017: Hexagon head screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(1, QtGui.QApplication.translate("ScrewMaker", "ISO4014: Hexagon head bolts", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(2, QtGui.QApplication.translate("ScrewMaker", "EN1662: Hexagon bolts with flange, small\n series", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(3, QtGui.QApplication.translate("ScrewMaker", "EN1665: Hexagon bolts with flange, heavy\n series", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(4, QtGui.QApplication.translate("ScrewMaker", "ISO4762: Hexagon socket head cap screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(5, QtGui.QApplication.translate("ScrewMaker", "ISO7380-1: Hexagon socket button head\n screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(6, QtGui.QApplication.translate("ScrewMaker", "ISO7380-2: Hexagon socket button head\n screws with collar", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(7, QtGui.QApplication.translate("ScrewMaker", "DIN967: Cross recessed pan head screws\n with collar", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(8, QtGui.QApplication.translate("ScrewMaker", "ISO10642: Hexagon socket countersunk \n head screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(9, QtGui.QApplication.translate("ScrewMaker", "ISO2009: Slotted countersunk flat head\n screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(10, QtGui.QApplication.translate("ScrewMaker", "ISO2010: Slotted raised countersunk head\n screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(11, QtGui.QApplication.translate("ScrewMaker", "ISO1207: Slotted cheese head screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(12, QtGui.QApplication.translate("ScrewMaker", "ISO1580: Slotted pan head screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(13, QtGui.QApplication.translate("ScrewMaker", "ISO7045: Pan head screws, type H cross recess", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(14, QtGui.QApplication.translate("ScrewMaker", "ISO7046: Countersunk flat head screws\n H cross recess", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(15, QtGui.QApplication.translate("ScrewMaker", "ISO7047: Raised countersunk head screws\n H cross recess", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(16, QtGui.QApplication.translate("ScrewMaker", "ISO7048: Cheese head screws type H cross recess", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(17, QtGui.QApplication.translate("ScrewMaker", "ISO14579: Hexalobular socket head cap screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(18, QtGui.QApplication.translate("ScrewMaker", "ISO14580: Hexalobular socket cheese head\n screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(19, QtGui.QApplication.translate("ScrewMaker", "ISO14583: Hexalobular socket pan head screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(20, QtGui.QApplication.translate("ScrewMaker", "ISO14582: Hexalobular socket countersunk\n head screws, high head", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(21, QtGui.QApplication.translate("ScrewMaker", "ISO14584: Hexalobular socket raised\n countersunk head screws", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(22, QtGui.QApplication.translate("ScrewMaker", "ISO7089: Plain washers - Normal series", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(23, QtGui.QApplication.translate("ScrewMaker", "ISO7090: Plain washers, chamfered - Normal series", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(24, QtGui.QApplication.translate("ScrewMaker", "ISO7092: Plain washers - Small series", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(25, QtGui.QApplication.translate("ScrewMaker", "ISO7093-1: Plain washer - Large series", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(26, QtGui.QApplication.translate("ScrewMaker", "ISO7094: Plain washers - Extra large series", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(27, QtGui.QApplication.translate("ScrewMaker", "ISO4032: Hexagon nuts, Style 1", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(28, QtGui.QApplication.translate("ScrewMaker", "ISO4033: Hexagon nuts, Style 2", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(29, QtGui.QApplication.translate("ScrewMaker", "ISO4035: Hexagon thin nuts, chamfered", None, QtGui.QApplication.UnicodeUTF8)) self.ScrewType.setItemText(30, QtGui.QApplication.translate("ScrewMaker", "EN1661: Hexagon nuts with flange", None, QtGui.QApplication.UnicodeUTF8)) 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)) self.NominalDiameter.setItemText(1, QtGui.QApplication.translate("ScrewMaker", "M2", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(2, QtGui.QApplication.translate("ScrewMaker", "M2.5", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(3, QtGui.QApplication.translate("ScrewMaker", "M3", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(4, QtGui.QApplication.translate("ScrewMaker", "(M3.5)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(5, QtGui.QApplication.translate("ScrewMaker", "M4", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(6, QtGui.QApplication.translate("ScrewMaker", "M5", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(7, QtGui.QApplication.translate("ScrewMaker", "M6", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(8, QtGui.QApplication.translate("ScrewMaker", "M8", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(9, QtGui.QApplication.translate("ScrewMaker", "M10", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(10, QtGui.QApplication.translate("ScrewMaker", "M12", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(11, QtGui.QApplication.translate("ScrewMaker", "(M14)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(12, QtGui.QApplication.translate("ScrewMaker", "M16", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(13, QtGui.QApplication.translate("ScrewMaker", "(M18)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(14, QtGui.QApplication.translate("ScrewMaker", "M20", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(15, QtGui.QApplication.translate("ScrewMaker", "(M22)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(16, QtGui.QApplication.translate("ScrewMaker", "M24", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(17, QtGui.QApplication.translate("ScrewMaker", "(M27)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(18, QtGui.QApplication.translate("ScrewMaker", "M30", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(19, QtGui.QApplication.translate("ScrewMaker", "M36", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(20, QtGui.QApplication.translate("ScrewMaker", "(M33)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(21, QtGui.QApplication.translate("ScrewMaker", "M42", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(22, QtGui.QApplication.translate("ScrewMaker", "(M45)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(23, QtGui.QApplication.translate("ScrewMaker", "M48", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(24, QtGui.QApplication.translate("ScrewMaker", "(M52)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(25, QtGui.QApplication.translate("ScrewMaker", "M54", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(26, QtGui.QApplication.translate("ScrewMaker", "(M60)", None, QtGui.QApplication.UnicodeUTF8)) self.NominalDiameter.setItemText(27, QtGui.QApplication.translate("ScrewMaker", "M64", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(0, QtGui.QApplication.translate("ScrewMaker", "2", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(1, QtGui.QApplication.translate("ScrewMaker", "2.5", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(2, QtGui.QApplication.translate("ScrewMaker", "3", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(3, QtGui.QApplication.translate("ScrewMaker", "4", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(4, QtGui.QApplication.translate("ScrewMaker", "5", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(5, QtGui.QApplication.translate("ScrewMaker", "6", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(6, QtGui.QApplication.translate("ScrewMaker", "8", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(7, QtGui.QApplication.translate("ScrewMaker", "10", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(8, QtGui.QApplication.translate("ScrewMaker", "12", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(9, QtGui.QApplication.translate("ScrewMaker", "16", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(10, QtGui.QApplication.translate("ScrewMaker", "20", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(11, QtGui.QApplication.translate("ScrewMaker", "25", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(12, QtGui.QApplication.translate("ScrewMaker", "30", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(13, QtGui.QApplication.translate("ScrewMaker", "35", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(14, QtGui.QApplication.translate("ScrewMaker", "40", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(15, QtGui.QApplication.translate("ScrewMaker", "45", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(16, QtGui.QApplication.translate("ScrewMaker", "50", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(17, QtGui.QApplication.translate("ScrewMaker", "55", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(18, QtGui.QApplication.translate("ScrewMaker", "60", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(19, QtGui.QApplication.translate("ScrewMaker", "65", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(20, QtGui.QApplication.translate("ScrewMaker", "70", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(21, QtGui.QApplication.translate("ScrewMaker", "80", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(22, QtGui.QApplication.translate("ScrewMaker", "90", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(23, QtGui.QApplication.translate("ScrewMaker", "100", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(24, QtGui.QApplication.translate("ScrewMaker", "110", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(25, QtGui.QApplication.translate("ScrewMaker", "120", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(26, QtGui.QApplication.translate("ScrewMaker", "130", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(27, QtGui.QApplication.translate("ScrewMaker", "140", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(28, QtGui.QApplication.translate("ScrewMaker", "150", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(29, QtGui.QApplication.translate("ScrewMaker", "160", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(30, QtGui.QApplication.translate("ScrewMaker", "180", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(31, QtGui.QApplication.translate("ScrewMaker", "200", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(32, QtGui.QApplication.translate("ScrewMaker", "220", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(33, QtGui.QApplication.translate("ScrewMaker", "240", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(34, QtGui.QApplication.translate("ScrewMaker", "260", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(35, QtGui.QApplication.translate("ScrewMaker", "280", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(36, QtGui.QApplication.translate("ScrewMaker", "300", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(37, QtGui.QApplication.translate("ScrewMaker", "320", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(38, QtGui.QApplication.translate("ScrewMaker", "340", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(39, QtGui.QApplication.translate("ScrewMaker", "360", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(40, QtGui.QApplication.translate("ScrewMaker", "380", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(41, QtGui.QApplication.translate("ScrewMaker", "400", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(42, QtGui.QApplication.translate("ScrewMaker", "420", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(43, QtGui.QApplication.translate("ScrewMaker", "440", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(44, QtGui.QApplication.translate("ScrewMaker", "460", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(45, QtGui.QApplication.translate("ScrewMaker", "480", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(46, QtGui.QApplication.translate("ScrewMaker", "500", None, QtGui.QApplication.UnicodeUTF8)) self.NominalLength.setItemText(47, QtGui.QApplication.translate("ScrewMaker", "User", None, QtGui.QApplication.UnicodeUTF8)) #self.UserLen.setItemText(0, QtGui.QApplication.translate("ScrewMaker", "regular pitch", None, QtGui.QApplication.UnicodeUTF8)) self.SimpleScrew.setText(QtGui.QApplication.translate("ScrewMaker", "Simple Screw (no thread at all!)", None, QtGui.QApplication.UnicodeUTF8)) self.SymbolThread.setText(QtGui.QApplication.translate("ScrewMaker", "Symbol Thread (not implemented yet)", None, QtGui.QApplication.UnicodeUTF8)) self.RealThread.setText(QtGui.QApplication.translate("ScrewMaker", "Real Thread (takes time, memory intensive)\nMay not work for all screws!", None, QtGui.QApplication.UnicodeUTF8)) self.MessageLabel.setText(QtGui.QApplication.translate("ScrewMaker", "Select your screw type", None, QtGui.QApplication.UnicodeUTF8)) self.MessageLabel.setProperty("Errortext", QtGui.QApplication.translate("ScrewMaker", "Combination not implemented", None, QtGui.QApplication.UnicodeUTF8)) self.MessageLabel.setProperty("OK_text", QtGui.QApplication.translate("ScrewMaker", "Screw is made", None, QtGui.QApplication.UnicodeUTF8)) self.CreateButton.setText(QtGui.QApplication.translate("ScrewMaker", "create", None, QtGui.QApplication.UnicodeUTF8)) def guiCheck_Data(self): ST_text = str(self.ScrewType.currentText()) ST_text = ST_text.split(':')[0] ND_text = str(self.NominalDiameter.currentText()) NL_text = str(self.NominalLength.currentText()) M_text, self.ScrewAvailable = self.theScrew.check_Data(ST_text, ND_text, NL_text) self.MessageLabel.setText(QtGui.QApplication.translate("ScrewMaker", M_text, None, QtGui.QApplication.UnicodeUTF8)) def guiCreateScrew(self): #self.simpThread = self.SimpleScrew.isChecked() #self.symThread = self.SymbolThread.isChecked() #self.rThread = self.RealThread.isChecked() if self.SimpleScrew.isChecked(): threadType = 'simple' if self.SymbolThread.isChecked(): threadType = 'symbol' if self.RealThread.isChecked(): threadType = 'real' ND_text = str(self.NominalDiameter.currentText()) NL_text = str(self.NominalLength.currentText()) ST_text = str(self.ScrewType.currentText()) ST_text = ST_text.split(':')[0] if ST_text == 'ScrewTap': if NL_text == 'User': textValue = self.UserLen.property("text") stLength = FreeCAD.Units.parseQuantity(textValue).Value NL_text = str(stLength) myObj = self.theScrew.createScrew(ST_text, ND_text, NL_text, threadType) class Screw(object): def __init__(self): self.objAvailable = True self.Tuner = 510 def check_Data(self, ST_text, ND_text, NL_text): #FreeCAD.Console.PrintMessage("Data checking" + NL_text + "\n") #set screw not ok self.objAvailable = False M_text = "Select your screw type" Type_text = '' if ST_text == 'ISO4017': table = iso4017head tab_len = iso4017length tab_range = iso4017range Type_text = 'Screw' if ST_text == 'EN1662': table = en1662def tab_len = en1662length tab_range = en1662range Type_text = 'Screw' if ST_text == 'EN1665': table = en1665def tab_len = en1665length tab_range = en1665range Type_text = 'Screw' if ST_text == 'ISO2009': table = iso2009def tab_len = iso2009length tab_range = iso2009range Type_text = 'Screw' if ST_text == 'ISO2010': table = iso2009def tab_len = iso2009length tab_range = iso2009range Type_text = 'Screw' if ST_text == 'ISO4762': table = iso4762def tab_len = iso4762length tab_range = iso4762range Type_text = 'Screw' if ST_text == 'ISO10642': table = iso10642def tab_len = iso10642length tab_range = iso10642range Type_text = 'Screw' if ST_text == 'ISO4014': table = iso4014head tab_len = iso4014length tab_range = iso4014range Type_text = 'Screw' if ST_text == 'ISO1207': table = iso1207def tab_len = iso1207length tab_range = iso1207range Type_text = 'Screw' if ST_text == 'ISO1580': table = iso1580def tab_len = iso2009length tab_range = iso2009range Type_text = 'Screw' if ST_text == 'ISO7045': table = iso7045def tab_len = iso7045length tab_range = iso7045range Type_text = 'Screw' if ST_text == 'ISO7046': table = iso7046def # contains only cross recess data tab_len = iso7045length tab_range = iso7046range Type_text = 'Screw' if ST_text == 'ISO7047': table = iso2009def tab_len = iso7045length tab_range = iso7046range Type_text = 'Screw' if ST_text == 'ISO7048': table = iso7048def tab_len = iso7048length tab_range = iso7048range Type_text = 'Screw' if ST_text == 'ISO7380-1': table = iso7380def tab_len = iso7380length tab_range = iso7380range Type_text = 'Screw' if ST_text == 'ISO7380-2': table = iso7380_2def tab_len = iso7380length tab_range = iso7380range Type_text = 'Screw' if ST_text == 'DIN967': table = din967def tab_len = din967length tab_range = din967range Type_text = 'Screw' if ST_text == 'ISO14579': table = iso14579def tab_len = iso14579length tab_range = iso14579range Type_text = 'Screw' if ST_text == 'ISO14580': table = iso14580def tab_len = iso14580length tab_range = iso1207range Type_text = 'Screw' if ST_text == 'ISO14583': table = iso14583def tab_len = iso7045length tab_range = iso7046range Type_text = 'Screw' if ST_text == 'ISO14584': table = iso14584def tab_len = iso7045length tab_range = iso14584range Type_text = 'Screw' if ST_text == 'ISO14582': table = iso14582def tab_len = iso14582length tab_range = iso14582range Type_text = 'Screw' if ST_text == 'ISO7089': table = iso7089def Type_text = 'Washer' if ST_text == 'ISO7090': table = iso7090def Type_text = 'Washer' if ST_text == 'ISO7091': table = iso7091def Type_text = 'Washer' if ST_text == 'ISO7092': table = iso7092def Type_text = 'Washer' if ST_text == 'ISO7093-1': table = iso7093def Type_text = 'Washer' if ST_text == 'ISO7094': table = iso7094def Type_text = 'Washer' if ST_text == 'ISO4032': table = iso4032def Type_text = 'Nut' if ST_text == 'ISO4033': table = iso4033def Type_text = 'Nut' if ST_text == 'ISO4035': table = iso4035def Type_text = 'Nut' if ST_text == 'ISO4036': table = iso4036def Type_text = 'Nut' if ST_text == 'EN1661': table = en1661def Type_text = 'Nut' if ST_text == 'ScrewTap': table = tuningTable Type_text = 'Screw-Tap' if ND_text not in table: ND_min, ND_max = standard_diameters[ST_text] M_text = ST_text+' has diameters from '+ ND_min +' to ' + ND_max + ' and not ' + ND_text +'!' self.objAvailable = False # set scew not ok else: if Type_text == 'Screw': #NL_text = str(self.NominalLength.currentText()) NL_min, NL_max = tab_range[ND_text] NL_min_float = float(NL_min) NL_max_float = float(NL_max) if NL_text == 'User': M_text = 'User length is only available for the screw-tab!' self.objAvailable = False else: NL_text_float = float(NL_text) if (NL_text_float<NL_min_float)or(NL_text_float>NL_max_float)or(NL_text not in tab_len): if '(' in ND_text: ND_text = ND_text.lstrip('(').rstrip(')') M_text = ST_text+'-'+ ND_text +' has lengths from '+ NL_min +' to ' + NL_max + ' and not ' + NL_text +'!' self.objAvailable = False # set screw not ok else: if '(' in ND_text: ND_text = ND_text.lstrip('(').rstrip(')') M_text = ST_text+'-'+ ND_text +'x'+ NL_text +' is in library available! ' self.objAvailable = True #set screw ok else: # Washers and Nuts if not (Type_text == 'Screw-Tap'): if '(' in ND_text: ND_text = ND_text.lstrip('(').rstrip(')') M_text = ST_text+'-'+ ND_text +' is in library available! ' self.objAvailable = True #set washer/nut ok else: if NL_text == 'User': M_text = 'Screw-tab with user length is ok!' self.objAvailable = True else: #NL_text = str(self.NominalLength.currentText()) if '(' in ND_text: ND_text = ND_text.lstrip('(').rstrip(')') M_text = ST_text+'-'+ ND_text +' with '+ NL_text +'mm length is in library available! ' self.objAvailable = True #set screwTap ok #print "Data checking: ", self.NominalLength.currentText(), "\n" #FreeCAD.Console.PrintMessage("Set Check_result into text " + str(self.objAvailable) + M_text + "\n") return M_text, self.objAvailable def createScrew(self, ST_text, ND_text, NL_text, threadType): #self.simpThread = self.SimpleScrew.isChecked() #self.symThread = self.SymbolThread.isChecked() #self.rThread = self.RealThread.isChecked() if threadType == 'real': self.rThread = True else: self.rThread = False if self.objAvailable: try: # first we check if valid numbers have been entered #FreeCAD.Console.PrintMessage("NominalLength: " + self.NominalLength.currentText() + "\n") #FreeCAD.Console.PrintMessage("NominalDiameter: " + self.NominalDiameter.currentText() + "\n") #FreeCAD.Console.PrintMessage("SimpleThread: " + str(self.SimpleScrew.isChecked()) + "\n") #FreeCAD.Console.PrintMessage("SymbolThread: " + str(self.SymbolThread.isChecked()) + "\n") #FreeCAD.Console.PrintMessage("RealThread: " + str(self.RealThread.isChecked()) + "\n") #ND_text = str(self.NominalDiameter.currentText()) #NL_text = str(self.NominalLength.currentText()) #ST_text = str(self.ScrewType.currentText()) #ST_text = ST_text.split(':')[0] #dia = float(ND_text.lstrip('M')) l = float(NL_text) if ST_text == 'ISO4017': table = iso4017head if ST_text == 'ISO4014': table = iso4014head if ST_text == 'EN1662': table = en1662def if ST_text == 'EN1665': table = en1665def if ST_text == 'ISO2009': table = iso2009def if ST_text == 'ISO2010': table = iso2009def if ST_text == 'ISO4762': table = iso4762def if ST_text == 'ISO10642': table = iso10642def if ST_text == 'ISO1207': table = iso1207def if ST_text == 'ISO1580': table = iso1580def if ST_text == 'ISO7045': table = iso7045def if ST_text == 'ISO7046': table = iso7045def if ST_text == 'ISO7047': table = iso7045def if ST_text == 'ISO7048': table = iso7048def if ST_text == 'ISO7380-1': table = iso7380def if ST_text == 'ISO7380-2': table = iso7380_2def if ST_text == 'DIN967': table = din967def if ST_text == 'ISO14579': table = iso14579def if ST_text == 'ISO14580': table = iso14580def if ST_text == 'ISO14582': table = iso14582def if ST_text == 'ISO14583': table = iso14583def if ST_text == 'ISO14584': table = iso14584def if ST_text == 'ISO7089': table = iso7089def if ST_text == 'ISO7090': table = iso7090def if ST_text == 'ISO7091': table = iso7091def if ST_text == 'ISO7092': table = iso7092def if ST_text == 'ISO7093-1': table = iso7093def if ST_text == 'ISO7094': table = iso7094def if ST_text == 'ISO4032': table = iso4032def if ST_text == 'ISO4033': table = iso4033def if ST_text == 'ISO4035': table = iso4035def if ST_text == 'ISO4036': table = iso4036def if ST_text == 'EN1661': table = en1661def if ST_text == 'ScrewTap': table = tuningTable if ND_text not in table: FreeCAD.Console.PrintMessage("Combination of type "+ST_text \ + " and diameter " + ND_text +" not available!" + "\n") #self.MessageLabel.setText(QtGui.QApplication.translate("ScrewMaker", "not implemented", None, QtGui.QApplication.UnicodeUTF8)) except ValueError: #print "Error! nom_dia and length values must be valid numbers!" FreeCAD.Console.PrintMessage("Error! nom_dia and length values must be valid numbers!\n") else: doc=FreeCAD.activeDocument() done = False if (ST_text == 'ISO4014') or (ST_text == 'ISO4017'): screw = self.makeIso4017_2(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'EN1662') or (ST_text == 'EN1665'): screw = self.makeEN1662_2(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'ISO2009') or (ST_text == 'ISO2010') or (ST_text == 'ISO1580'): screw = self.makeSlottedScrew(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'ISO4762') or (ST_text == 'ISO14579'): screw = self.makeIso4762(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'ISO1207') or (ST_text == 'ISO14580') or (ST_text == 'ISO7048'): screw = self.makeIso1207(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'ISO7045') or (ST_text == 'ISO14583'): screw = self.makeIso7045(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'ISO7046') or (ST_text == 'ISO7047') or \ (ST_text == 'ISO14582') or (ST_text == 'ISO14584') or (ST_text == 'ISO10642'): screw = self.makeIso7046(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'ISO7380-1') or (ST_text == 'ISO7380-2') or (ST_text == 'DIN967'): screw = self.makeIso7380(ST_text, ND_text,l) Type_text = 'Screw' done = True if (ST_text == 'ISO7089') or (ST_text == 'ISO7090') or (ST_text == 'ISO7093-1') or \ (ST_text == 'ISO7091') or (ST_text == 'ISO7092') or (ST_text == 'ISO7094'): screw = self.makeIso7089(ST_text, ND_text) Type_text = 'Washer' done = True if (ST_text == 'ISO4032') or (ST_text == 'ISO4033') or (ST_text == 'ISO4035'): screw = self.makeIso4032(ST_text, ND_text) Type_text = 'Nut' done = True if ST_text == 'EN1661': screw = self.makeEN1661(ND_text) Type_text = 'Nut' done = True if ST_text == 'ScrewTap': screw = self.makeScrewTap(ND_text,l) Type_text = 'Screw-Tap' done = True if not done: FreeCAD.Console.PrintMessage("No valid Screw Type!" + "\n") if '(' in ND_text: ND_text = ND_text.lstrip('(').rstrip(')') if Type_text == 'Screw': label = ST_text + "-" + ND_text +"x"+ NL_text +"_" else: if (Type_text == 'Nut'): label = ST_text + '-' + ND_text +'_' else: if Type_text == 'Screw-Tap': label = ST_text + '-' + ND_text +'x'+ NL_text +'_' else: # washer label = ST_text + '-' + ND_text.lstrip('M') +'_' ScrewObj = doc.addObject("Part::Feature") ScrewObj.Label=label ScrewObj.Shape=screw #FreeCAD.Console.PrintMessage("Placement: "+ str(ScrewObj.Placement) +"\n") #FreeCAD.Console.PrintMessage("The label: "+ label +"\n") self.moveScrew(ScrewObj) #ScrewObj.Label = label doc.recompute() # Part.show(screw) return ScrewObj def moveScrew(self, ScrewObj_m): #FreeCAD.Console.PrintMessage("In Move Screw: " + str(ScrewObj_m) + "\n") mylist = FreeCAD.Gui.Selection.getSelectionEx() if (mylist.__len__() == 1): # check selection #FreeCAD.Console.PrintMessage("Selektionen: " + str(mylist.__len__()) + "\n") Pnt1 = None Axis1 = None Axis2 = None for o in Gui.Selection.getSelectionEx(): #for s in o.SubElementNames: #FreeCAD.Console.PrintMessage( "name: " + str(s) + "\n") for s in o.SubObjects: #FreeCAD.Console.PrintMessage( "object: "+ str(s) + "\n") if hasattr(s,"Curve"): #FreeCAD.Console.PrintMessage( "The Object is a Curve!\n") if hasattr(s.Curve,"Center"): """ FreeCAD.Console.PrintMessage( "The object has a Center!\n") FreeCAD.Console.PrintMessage( "Curve attribut. "+ str(s.__getattribute__('Curve')) + "\n") FreeCAD.Console.PrintMessage( "Center: "+ str(s.Curve.Center) + "\n") FreeCAD.Console.PrintMessage( "Axis: "+ str(s.Curve.Axis) + "\n") """ Pnt1 = s.Curve.Center Axis1 = s.Curve.Axis if hasattr(s,'Surface'): #print 'the object is a face!' if hasattr(s.Surface,'Axis'): Axis1 = s.Surface.Axis if hasattr(s,'Point'): #FreeCAD.Console.PrintMessage( "the object seems to be a vertex! "+ str(s.Point) + "\n") Pnt1 = s.Point if (Axis1 != None): #FreeCAD.Console.PrintMessage( "Got Axis1: " + str(Axis1) + "\n") Axis2 = Base.Vector(0.0,0.0,1.0) Axis2_minus = Base.Vector(0.0,0.0,-1.0) # Calculate angle if Axis1 == Axis2: normvec = Base.Vector(1.0,0.0,0.0) result = 0.0 else: if Axis1 == Axis2_minus: normvec = Base.Vector(1.0,0.0,0.0) result = math.pi else: normvec = Axis1.cross(Axis2) # Berechne Achse der Drehung = normvec normvec.normalize() # Normalisieren fuer Quaternionenrechnung #normvec_rot = normvec result = DraftVecUtils.angle(Axis1, Axis2, normvec) # Winkelberechnung sin_res = math.sin(result/2.0) cos_res = math.cos(result/2.0) normvec.multiply(-sin_res) # Berechnung der Quaternionen-Elemente #FreeCAD.Console.PrintMessage( "Winkel = "+ str(math.degrees(result)) + "\n") #FreeCAD.Console.PrintMessage("Normalvektor: "+ str(normvec) + "\n") pl = FreeCAD.Placement() pl.Rotation = (normvec.x,normvec.y,normvec.z,cos_res) #Drehungs-Quaternion #FreeCAD.Console.PrintMessage("pl mit Rot: "+ str(pl) + "\n") #neuPlatz = Part2.Object.Placement.multiply(pl) neuPlatz = ScrewObj_m.Placement #FreeCAD.Console.PrintMessage("die Position "+ str(neuPlatz) + "\n") neuPlatz.Rotation = pl.Rotation.multiply(ScrewObj_m.Placement.Rotation) neuPlatz.move(Pnt1) #FreeCAD.Console.PrintMessage("die rot. Position: "+ str(neuPlatz) + "\n") # make Washer def makeIso7089(self,SType ='ISO7089', ThreadType ='M6'): dia = self.getDia(ThreadType) #FreeCAD.Console.PrintMessage("die Scheibe mit dia: " + str(dia) + "\n") if SType == 'ISO7089': d1_min, d2_max, h, h_max = iso7089def[ThreadType] if SType == 'ISO7090': d1_min, d2_max, h, h_max = iso7090def[ThreadType] if SType == 'ISO7091': d1_min, d2_max, h, h_max = iso7091def[ThreadType] if SType == 'ISO7092': d1_min, d2_max, h, h_max = iso7092def[ThreadType] if SType == 'ISO7093-1': d1_min, d2_max, h, h_max = iso7093def[ThreadType] if SType == 'ISO7094': d1_min, d2_max, h, h_max = iso7094def[ThreadType] #FreeCAD.Console.PrintMessage("got: " + SType + "\n") #FreeCAD.Console.PrintMessage("die Scheibe mit d1_min: " + str(d1_min) + "\n") #Washer Points Pnt0 = Base.Vector(d1_min/2.0,0.0,h_max) Pnt2 = Base.Vector(d2_max/2.0,0.0,h_max) Pnt3 = Base.Vector(d2_max/2.0,0.0,0.0) Pnt4 = Base.Vector(d1_min/2.0,0.0,0.0) if SType == 'ISO7090': Pnt1 = Base.Vector(d2_max/2.0-h_max/4.0,0.0,h_max) Pnt2 = Base.Vector(d2_max/2.0,0.0,h_max*0.75) edge1 = Part.makeLine(Pnt0,Pnt1) edgeCham = Part.makeLine(Pnt1,Pnt2) edge1 = Part.Wire([edge1, edgeCham]) else: edge1 = Part.makeLine(Pnt0,Pnt2) edge2 = Part.makeLine(Pnt2,Pnt3) edge3 = Part.makeLine(Pnt3,Pnt4) edge4 = Part.makeLine(Pnt4,Pnt0) #FreeCAD.Console.PrintMessage("Edges made Pnt2: " + str(Pnt2) + "\n") aWire=Part.Wire([edge1,edge2,edge3,edge4]) #Part.show(aWire) aFace =Part.Face(aWire) head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #FreeCAD.Console.PrintMessage("Washer revolved: " + str(dia) + "\n") return head # make ISO 2009 Slotted countersunk flat head screws # make ISO 2010 Slotted raised countersunk head screws # make ISO 1580 Pan head slotted screw (Code is nearly identical to iso1207) def makeSlottedScrew(self,SType ='ISO1580', ThreadType ='M6',l=25.0): dia = self.getDia(ThreadType) if SType == 'ISO1580': #FreeCAD.Console.PrintMessage("der Kopf mit l: " + str(l) + "\n") #P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x = iso1580def[ThreadType] P, a, b, dk_max, da, k, n_min, r, rf, t_min, x = iso1580def[ThreadType] #FreeCAD.Console.PrintMessage("der Kopf mit iso: " + str(dk_max) + "\n") ht = k headEnd = r #Length for calculation of head fillet sqrt2_ = 1.0/math.sqrt(2.0) r_fil = rf beta = math.radians(5.0) # angle of pan head edge alpha = math.radians(90.0 - (90.0+5.0)/2.0) tan_beta = math.tan(beta) # top head diameter without fillet rK_top = dk_max/2.0 - k * tan_beta fillet_center_x = rK_top - r_fil + r_fil * tan_beta fillet_center_z = k - r_fil fillet_arc_x = fillet_center_x + r_fil * math.sin(alpha) fillet_arc_z = fillet_center_z + r_fil * math.cos(alpha) #FreeCAD.Console.PrintMessage("rK_top: " + str(rK_top) + "\n") if (b > (l - 1.0*P)): bmax = l- 1.0*P else: bmax = b #Head Points Pnt0 = Base.Vector(0.0,0.0,k) Pnt2 = Base.Vector(fillet_center_x,0.0,k) Pnt3 = Base.Vector(fillet_arc_x,0.0,fillet_arc_z) Pnt4 = Base.Vector(fillet_center_x + r_fil*math.cos(beta),0.0,fillet_center_z+ r_fil * math.sin(beta)) Pnt5 = Base.Vector(dk_max/2.0,0.0,0.0) Pnt6 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank Pnt7 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet #Pnt8 = Base.Vector(dia/2.0,0.0,-r) # end of fillet PntR = Base.Vector(dia/2.0,0.0,-r) # end of fillet PntT0 = Base.Vector(0.0,0.0,-r) # helper point for real thread edge1 = Part.makeLine(Pnt0,Pnt2) edge2 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape() edge3 = Part.makeLine(Pnt4,Pnt5) edge4 = Part.makeLine(Pnt5,Pnt6) edge5 = Part.Arc(Pnt6,Pnt7,PntR).toShape() headWire=Part.Wire([edge1,edge2,edge3,edge4,edge5]) if (SType == 'ISO2009') or (SType == 'ISO2010'): P, a, b, dk_theo, dk_mean, k, n_min, r, t_mean, x = iso2009def[ThreadType] dk_max = dk_theo t_min = t_mean ht = 0.0 # Head heigth of flat head if (SType == 'ISO2010'): rf, t_mean, cT, mH, mZ = Raised_countersunk_def[ThreadType] #Lengths and angles for calculation of head rounding beta = math.asin(dk_mean /2.0 / rf) # angle of head edge tan_beta = math.tan(beta) alpha = beta/2.0 # half angle # heigth of raised head top ht = rf - (dk_mean/2.0) / tan_beta h_arc_x = rf * math.sin(alpha) h_arc_z = ht - rf + rf * math.cos(alpha) cham = (dk_theo - dk_mean)/2.0 rad225 = math.radians(22.5) rad45 = math.radians(45.0) rtan = r*math.tan(rad225) headEnd = k + rtan if (b > l - k - rtan/2.0 - 1.0*P): bmax = l-k-rtan/2.0 - 1.0*P else: bmax = b #Head Points Pnt0 = Base.Vector(0.0,0.0,ht) Pnt1 = Base.Vector(dk_mean/2.0,0.0,0.0) Pnt2 = Base.Vector(dk_mean/2.0,0.0,-cham) Pnt3 = Base.Vector(dia/2.0+r-r*math.cos(rad45),0.0,-k-rtan+r*math.sin(rad45)) # Arc-points Pnt4 = Base.Vector(dia/2.0+r-r*(math.cos(rad225)),0.0,-k-rtan+r*math.sin(rad225)) PntR = Base.Vector(dia/2.0,0.0,-k-rtan) #PntA = Base.Vector(dia/2.0,0.0,-a_point) PntT0 = Base.Vector(0.0,0.0,-k-rtan) # helper point for real thread if (SType == 'ISO2010'): # make raised head rounding Pnt0arc = Base.Vector(h_arc_x,0.0,h_arc_z) edge1 = Part.Arc(Pnt0,Pnt0arc,Pnt1).toShape() else: edge1 = Part.makeLine(Pnt0,Pnt1) # make flat head edge2 = Part.makeLine(Pnt1,Pnt2) edge3 = Part.makeLine(Pnt2,Pnt3) edgeArc = Part.Arc(Pnt3,Pnt4,PntR).toShape() headWire=Part.Wire([edge1,edge2,edge3,edgeArc]) ### make the new code with math.modf(l) residue, turns = math.modf((bmax)/P) halfturns = 2*int(turns) if residue < 0.5: a_point = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a_point = l - (turns+2.0) * P #halfturns = halfturns + 2 offSet = headEnd - a_point PntA = Base.Vector(dia/2.0,0.0,-a_point) # Start of thread if self.rThread: edgeZ1 = Part.makeLine(PntR,PntT0) edgeZ0 = Part.makeLine(PntT0,Pnt0) aWire=Part.Wire([headWire, edgeZ1, edgeZ0]) else: # bolt points PntB1 = Base.Vector(dia/2.0,0.0,-l) PntB2 = Base.Vector(0.0,0.0,-l) edgeB2 = Part.makeLine(PntB1,PntB2) edgeZ0 = Part.makeLine(PntB2,Pnt0) if a_point <= r: edgeB1 = Part.makeLine(PntR,PntB1) aWire=Part.Wire([headWire, edgeB1, edgeB2, edgeZ0]) else: edgeRA = Part.makeLine(PntR,PntA) edgeB1 = Part.makeLine(PntA,PntB1) aWire=Part.Wire([headWire, edgeRA, edgeB1, edgeB2, edgeZ0]) aFace =Part.Face(aWire) head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") #Parameter for slot-recess: dk_max, n_min, k, t_min slot = Part.makePlane(dk_max, n_min, \ Base.Vector(dk_max/2.0,-n_min/2.0,ht+1.0),Base.Vector(0.0,0.0,-1.0)) slot = slot.extrude(Base.Vector(0.0,0.0,-t_min-1.0)) #Part.show(slot) head = head.cut(slot) #FreeCAD.Console.PrintMessage("der Kopf geschnitten: " + str(dia) + "\n") #Part.show(head) if self.rThread: rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) #Part.show(rthread) headFaces = [] if (SType == 'ISO2009'): for i in range(0,len(head.Faces)-2): headFaces.append(head.Faces[i]) headFaces.append(head.Faces[len(head.Faces)-1]) if (SType == 'ISO1580') or (SType == 'ISO2010'): for i in range(0,len(head.Faces)-1): headFaces.append(head.Faces[i]) for threadFace in rthread.Faces: headFaces.append(threadFace) newHeadShell = Part.Shell(headFaces) #Part.show(newHeadShell) head = Part.Solid(newHeadShell) return head # ISO 7045 Pan head screws with type H or type Z cross recess # ISO 14583 Hexalobular socket pan head screws def makeIso7045(self, SType ='ISO7045', ThreadType ='M6',l=25.0): dia = self.getDia(ThreadType) #FreeCAD.Console.PrintMessage("der Kopf mit l: " + str(l) + "\n") P, a, b, dk_max,da, k, r, rf, x, cT, mH, mZ = iso7045def[ThreadType] #FreeCAD.Console.PrintMessage("der Kopf mit iso: " + str(dk_max) + "\n") #Lengths and angles for calculation of head rounding beta = math.asin(dk_max /2.0 / rf) # angle of head edge #print 'beta: ', math.degrees(beta) tan_beta = math.tan(beta) if SType == 'ISO14583': tt, A, t_mean = iso14583def[ThreadType] beta_A = math.asin(A/2.0 / rf) # angle of recess edge tan_beta_A = math.tan(beta_A) alpha = (beta_A + beta)/2.0 # half angle #print 'alpha: ', math.degrees(alpha) # heigth of head edge he = k - A/2.0/tan_beta_A + (dk_max/2.0) / tan_beta #print 'he: ', he h_arc_x = rf * math.sin(alpha) h_arc_z = k - A/2.0/tan_beta_A + rf * math.cos(alpha) #FreeCAD.Console.PrintMessage("h_arc_z: " + str(h_arc_z) + "\n") else: alpha = beta/2.0 # half angle #print 'alpha: ', math.degrees(alpha) # heigth of head edge he = k - rf + (dk_max/2.0) / tan_beta #print 'he: ', he h_arc_x = rf * math.sin(alpha) h_arc_z = k - rf + rf * math.cos(alpha) #FreeCAD.Console.PrintMessage("h_arc_z: " + str(h_arc_z) + "\n") if (b > (l - 1.0*P)): bmax = l- 1.0*P else: bmax = b ### make the new code with math.modf(l) residue, turns = math.modf((bmax)/P) halfturns = 2*int(turns) if residue < 0.5: a_point = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a_point = l - (turns+2.0) * P #halfturns = halfturns + 2 offSet = r - a_point #FreeCAD.Console.PrintMessage("The transition at a: " + str(a) + " turns " + str(turns) + "\n") sqrt2_ = 1.0/math.sqrt(2.0) #Head Points Pnt1 = Base.Vector(h_arc_x,0.0,h_arc_z) Pnt2 = Base.Vector(dk_max/2.0,0.0,he) Pnt3 = Base.Vector(dk_max/2.0,0.0,0.0) Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank Pnt5 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet Pnt6 = Base.Vector(dia/2.0,0.0,-r) # end of fillet Pnt7 = Base.Vector(dia/2.0,0.0,-a_point) # Start of thread #FreeCAD.Console.PrintMessage("Points defined a_point: " + str(a_point) + "\n") if (SType == 'ISO14583'): #Pnt0 = Base.Vector(0.0,0.0,k-A/4.0) Pnt0 = Base.Vector(0.0,0.0,k-A/8.0) PntFlat = Base.Vector(A/8.0,0.0,k-A/8.0) PntCham = Base.Vector(A/1.99,0.0,k) edgeCham0 = Part.makeLine(Pnt0,PntFlat) edgeCham1 = Part.makeLine(PntFlat,PntCham) edgeCham2 = Part.Arc(PntCham,Pnt1,Pnt2).toShape() #edge1 = Part.Wire([edgeCham0,edgeCham1,edgeCham2]) edge1 = Part.Wire([edgeCham0,edgeCham1]) edge2 = Part.makeLine(Pnt2,Pnt3) edge2 = Part.Wire([edgeCham2, edge2]) # Part.show(edge2) # Here is the next approach to shorten the head building time # Make two helper points to create a cutting tool for the # recess and recess shell. PntH1 = Base.Vector(A/1.99,0.0, 2.0*k) PntH2 = Base.Vector(0.0,0.0, 2.0*k) edgeH1 = Part.makeLine(PntCham,PntH1) edgeH2 = Part.makeLine(PntH1,PntH2) edgeH3 = Part.makeLine(PntH2,Pnt0) else: Pnt0 = Base.Vector(0.0,0.0,k) edge1 = Part.Arc(Pnt0,Pnt1,Pnt2).toShape() # make round head edge2 = Part.makeLine(Pnt2,Pnt3) # Here is the next approach to shorten the head building time # Make two helper points to create a cutting tool for the # recess and recess shell. PntH1 = Base.Vector(dk_max/2.0,0.0, 2.0*k) PntH2 = Base.Vector(0.0,0.0, 2.0*k) edgeH1 = Part.makeLine(Pnt2,PntH1) edgeH2 = Part.makeLine(PntH1,PntH2) edgeH3 = Part.makeLine(PntH2,Pnt0) edge3 = Part.makeLine(Pnt3,Pnt4) edge4 = Part.Arc(Pnt4,Pnt5,Pnt6).toShape() #FreeCAD.Console.PrintMessage("Edges made h_arc_z: " + str(h_arc_z) + "\n") #if self.RealThread.isChecked(): if self.rThread: aWire=Part.Wire([edge2,edge3,edge4]) else: # bolt points PntB1 = Base.Vector(dia/2.0,0.0,-l) PntB2 = Base.Vector(0.0,0.0,-l) edgeB2 = Part.makeLine(PntB1,PntB2) if a_point <= r: edgeB1 = Part.makeLine(Pnt6,PntB1) aWire=Part.Wire([edge2, edge3, edge4, edgeB1, edgeB2]) else: edge5 = Part.makeLine(Pnt6,Pnt7) edgeB1 = Part.makeLine(Pnt7,PntB1) aWire=Part.Wire([edge2, edge3, edge4, edge5, edgeB1, edgeB2]) hWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell hFace = Part.Face(hWire) hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #head = Part.Solid(headShell) #Part.show(aWire) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") headFaces = headShell.Faces if (SType == 'ISO14583'): recess, recessShell = self.makeIso10664_3(tt, t_mean, k) recessShell = recessShell.cut(hCut) topFace = hCut.Faces[1] topFace = topFace.cut(recess) #Part.show(topFace) #Part.show(recessShell) #Part.show(headShell) headFaces.append(topFace.Faces[0]) #headFaces.append(hCut.Faces[2]) else: #Lengths and angles for calculation of recess positioning beta_cr = math.asin(mH /2.0 / rf) # angle of recess edge tan_beta_cr = math.tan(beta_cr) # heigth of cross recess cutting hcr = k - rf + (mH/2.0) / tan_beta_cr #print 'hcr: ', hcr #Parameter for cross-recess type H: cT, mH recess, recessShell = self.makeCross_H3(cT, mH, hcr) recessShell = recessShell.cut(hCut) topFace = hCut.Faces[0] topFace = topFace.cut(recess) #Part.show(topFace) #Part.show(recessShell) #Part.show(headShell) headFaces.append(topFace.Faces[0]) #Part.show(hCut) headFaces.extend(recessShell.Faces) #if self.RealThread.isChecked(): if self.rThread: #head = self.cutIsoThread(head, dia, P, turns, l) rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) #head = head.fuse(rthread) #Part.show(rthread) for threadFace in rthread.Faces: headFaces.append(threadFace) newHeadShell = Part.Shell(headFaces) #Part.show(newHeadShell) head = Part.Solid(newHeadShell) return head # make Cheese head screw # ISO 1207 slotted screw # ISO 7048 cross recessed screw # ISO 14580 Hexalobular socket cheese head screws def makeIso1207(self,SType ='ISO1207', ThreadType ='M6',l=25.0): dia = self.getDia(ThreadType) ''' if '(' in TreadType: threadString = ThreadType.lstrip('(M') dia = float(ThreadType.rstrip(')')) else: dia=float(ThreadType.lstrip('M')) ''' #FreeCAD.Console.PrintMessage("der Kopf mit l: " + str(l) + "\n") if (SType == 'ISO1207') or (SType == 'ISO14580'): P, a, b, dk, dk_mean, da, k, n_min, r, t_min, x = iso1207def[ThreadType] if SType == 'ISO7048': P, a, b, dk, dk_mean, da, k, r, x, cT, mH, mZ = iso7048def[ThreadType] if (SType == 'ISO14580'): tt, k, A, t_min = iso14580def[ThreadType] #FreeCAD.Console.PrintMessage("der Kopf mit iso: " + str(dk) + "\n") #Length for calculation of head fillet r_fil = r*2.0 beta = math.radians(5.0) # angle of cheese head edge alpha = math.radians(90.0 - (90.0+5.0)/2.0) tan_beta = math.tan(beta) # top head diameter without fillet rK_top = dk/2.0 - k * tan_beta fillet_center_x = rK_top - r_fil + r_fil * tan_beta fillet_center_z = k - r_fil fillet_arc_x = fillet_center_x + r_fil * math.sin(alpha) fillet_arc_z = fillet_center_z + r_fil * math.cos(alpha) #FreeCAD.Console.PrintMessage("rK_top: " + str(rK_top) + "\n") if (b > (l - 1.0*P)): bmax = l- 1.0*P else: bmax = b ### make the new code with math.modf(l) residue, turns = math.modf((bmax)/P) halfturns = 2*int(turns) if residue < 0.5: a_point = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a_point = l - (turns+2.0) * P #halfturns = halfturns + 2 offSet = r - a_point sqrt2_ = 1.0/math.sqrt(2.0) #Head Points Pnt2 = Base.Vector(fillet_center_x,0.0,k) Pnt3 = Base.Vector(fillet_arc_x,0.0,fillet_arc_z) Pnt4 = Base.Vector(fillet_center_x + r_fil*math.cos(beta),0.0,fillet_center_z+ r_fil * math.sin(beta)) Pnt5 = Base.Vector(dk/2.0,0.0,0.0) Pnt6 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank Pnt7 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet Pnt8 = Base.Vector(dia/2.0,0.0,-r) # end of fillet Pnt9 = Base.Vector(dia/2.0,0.0,-a_point) # Start of thread #FreeCAD.Console.PrintMessage("Points defined fillet_center_x: " + str(fillet_center_x) + "\n") if (SType == 'ISO14580'): # Pnt0 = Base.Vector(0.0,0.0,k-A/4.0) #Center Point for countersunk Pnt0 = Base.Vector(0.0,0.0,k-A/8.0) #Center Point for flat countersunk PntFlat = Base.Vector(A/8.0,0.0,k-A/8.0) # End of flat part Pnt1 = Base.Vector(A/1.99,0.0,k) #countersunk edge at head edgeCham0 = Part.makeLine(Pnt0,PntFlat) edgeCham1 = Part.makeLine(PntFlat,Pnt1) edgeCham2 = Part.makeLine(Pnt1,Pnt2) edge1 = Part.Wire([edgeCham1,edgeCham2]) # make head with countersunk PntH1 = Base.Vector(A/1.99,0.0, 2.0*k) else: Pnt0 = Base.Vector(0.0,0.0,k) edge1 = Part.makeLine(Pnt0,Pnt2) # make flat head edge2 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape() edge3 = Part.makeLine(Pnt4,Pnt5) edge4 = Part.makeLine(Pnt5,Pnt6) edge5 = Part.Arc(Pnt6,Pnt7,Pnt8).toShape() #FreeCAD.Console.PrintMessage("Edges made fillet_center_z: " + str(fillet_center_z) + "\n") if SType == 'ISO1207': #Parameter for slot-recess: dk, n_min, k, t_min recess = Part.makePlane(dk, n_min, \ Base.Vector(dk/2.0,-n_min/2.0,k+1.0),Base.Vector(0.0,0.0,-1.0)) recess = recess.extrude(Base.Vector(0.0,0.0,-t_min-1.0)) if self.rThread: Pnt11 = Base.Vector(0.0,0.0,-r) # helper point for real thread edgeZ1 = Part.makeLine(Pnt8,Pnt11) edgeZ0 = Part.makeLine(Pnt11,Pnt0) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5, \ edgeZ1, edgeZ0]) else: # bolt points PntB1 = Base.Vector(dia/2.0,0.0,-l) PntB2 = Base.Vector(0.0,0.0,-l) edgeB2 = Part.makeLine(PntB1,PntB2) if a_point <= r: edgeB1 = Part.makeLine(Pnt8,PntB1) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5, \ edgeB1, edgeB2]) else: edge6 = Part.makeLine(Pnt8,Pnt9) edgeB1 = Part.makeLine(Pnt9,PntB1) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6, \ edgeB1, edgeB2]) aFace =Part.Face(aWire) head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0) head = head.cut(recess) # FreeCAD.Console.PrintMessage("der Kopf geschnitten: " + str(dia) + "\n") #Part.show(head) if self.rThread: screwFaces = [] for i in range(0, len(head.Faces)-1): screwFaces.append(head.Faces[i]) rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) for threadFace in rthread.Faces: screwFaces.append(threadFace) screwShell = Part.Shell(screwFaces) head = Part.Solid(screwShell) else: if self.rThread: aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5 ]) else: # bolt points PntB1 = Base.Vector(dia/2.0,0.0,-l) PntB2 = Base.Vector(0.0,0.0,-l) edgeB2 = Part.makeLine(PntB1,PntB2) if a_point <= r: edgeB1 = Part.makeLine(Pnt8,PntB1) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5, \ edgeB1, edgeB2]) else: edge6 = Part.makeLine(Pnt8,Pnt9) edgeB1 = Part.makeLine(Pnt9,PntB1) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6, \ edgeB1, edgeB2]) #aFace =Part.Face(aWire) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") if SType == 'ISO7048': # hCut should be just a cylinder hCut = Part.makeCylinder(fillet_center_x,k,Pnt0) recess, recessShell = self.makeCross_H3(cT, mH, k) recessShell = recessShell.cut(hCut) topFace = headShell.Faces[0].cut(recess) screwFaces = [topFace.Faces[0]] screwFaces.extend(recessShell.Faces) if (SType == 'ISO14580'): # Ring-cutter for recess shell PntH2 = Base.Vector(A/8.0,0.0, 2.0*k) edgeH1 = Part.makeLine(Pnt1,PntH1) edgeH2 = Part.makeLine(PntH1,PntH2) edgeH3 = Part.makeLine(PntH2,PntFlat) hWire = Part.Wire([edgeCham1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell hFace = Part.Face(hWire) hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) recess, recessShell = self.makeIso10664_3(tt, t_min, k) recessShell = recessShell.cut(hCut) topFace = headShell.Faces[0].cut(recess) screwFaces = [topFace.Faces[0]] screwFaces.extend(recessShell.Faces) for i in range(1, len(headShell.Faces)): screwFaces.append(headShell.Faces[i]) if self.rThread: #head = self.cutIsoThread(head, dia, P, turns, l) rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) #head = head.fuse(rthread) #Part.show(rthread) for threadFace in rthread.Faces: screwFaces.append(threadFace) screwShell = Part.Shell(screwFaces) head = Part.Solid(screwShell) return head # make the ISO 4017 Hex-head-screw # make the ISO 4014 Hex-head-bolt def makeIso4017_2(self,SType ='ISO4017', ThreadType ='M6',l=40.0): dia = self.getDia(ThreadType) #FreeCAD.Console.PrintMessage("der Kopf mit l: " + str(l) + "\n") if SType == 'ISO4017': P, c, dw, e,k,r,s = iso4017head[ThreadType] ### make the new code with math.modf(l) residue, turns = math.modf((l-1*P)/P) halfturns = 2*int(turns) if SType == 'ISO4014': P, b1, b2, b3, c, dw, e, k, r, s = iso4014head[ThreadType] if l<= 125.0: b = b1 else: if l<= 200.0: b = b2 else: b = b3 ### make the new code with math.modf(l) residue, turns = math.modf((b)/P) halfturns = 2*int(turns) if residue < 0.5: a = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a = l - (turns+2.0) * P #halfturns = halfturns + 2 offSet = r - a sqrt2_ = 1.0/math.sqrt(2.0) cham = (e-s)*math.sin(math.radians(15)) # needed for chamfer at head top #Head Points Usage of k, s, cham, c, dw, dia, r, a #FreeCAD.Console.PrintMessage("der Kopf mit halfturns: " + str(halfturns) + "\n") Pnt0 = Base.Vector(0.0,0.0,k) Pnt2 = Base.Vector(s/2.0,0.0,k) Pnt3 = Base.Vector(s/math.sqrt(3.0),0.0,k-cham) Pnt4 = Base.Vector(s/math.sqrt(3.0),0.0,c) Pnt5 = Base.Vector(dw/2.0,0.0,c) Pnt6 = Base.Vector(dw/2.0,0.0,0.0) Pnt7 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank Pnt8 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet Pnt9 = Base.Vector(dia/2.0,0.0,-r) # end of fillet Pnt10 = Base.Vector(dia/2.0,0.0,-a) # Start of thread edge1 = Part.makeLine(Pnt0,Pnt2) edge2 = Part.makeLine(Pnt2,Pnt3) edge3 = Part.makeLine(Pnt3,Pnt4) edge4 = Part.makeLine(Pnt4,Pnt5) edge5 = Part.makeLine(Pnt5,Pnt6) edge6 = Part.makeLine(Pnt6,Pnt7) edge7 = Part.Arc(Pnt7,Pnt8,Pnt9).toShape() # create cutting tool for hexagon head # Parameters s, k, outer circle diameter = e/2.0+10.0 extrude = self.makeHextool(s, k, s*2.0) #if self.RealThread.isChecked(): if self.rThread: Pnt11 = Base.Vector(0.0,0.0,-r) # helper point for real thread edgeZ1 = Part.makeLine(Pnt9,Pnt11) edgeZ0 = Part.makeLine(Pnt11,Pnt0) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7, \ edgeZ1, edgeZ0]) aFace =Part.Face(aWire) head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") # Part.show(extrude) head = head.cut(extrude) #FreeCAD.Console.PrintMessage("der Kopf geschnitten: " + str(dia) + "\n") #Part.show(head) headFaces = [] for i in range(18): headFaces.append(head.Faces[i]) if (dia < 3.0) or (dia > 5.0): rthread = self.makeShellthread(dia, P, halfturns, True, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a-2.0*P)) #rthread.translate(Base.Vector(0.0, 0.0,-2.0*P)) #Part.show(rthread) for tFace in rthread.Faces: headFaces.append(tFace) headShell = Part.Shell(headFaces) head = Part.Solid(headShell) else: rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a-2.0*P)) #rthread.translate(Base.Vector(0.0, 0.0,-2.0*P)) #Part.show(rthread) for tFace in rthread.Faces: headFaces.append(tFace) headShell = Part.Shell(headFaces) head = Part.Solid(headShell) cyl = self.cutChamfer(dia, P, l) #FreeCAD.Console.PrintMessage("vor Schnitt Ende: " + str(dia) + "\n") head = head.cut(cyl) else: # bolt points cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0 PntB0 = Base.Vector(0.0,0.0,-a) PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_t) PntB2 = Base.Vector(dia/2.0-cham_t,0.0,-l) PntB3 = Base.Vector(0.0,0.0,-l) edgeB1 = Part.makeLine(Pnt10,PntB1) edgeB2 = Part.makeLine(PntB1,PntB2) edgeB3 = Part.makeLine(PntB2,PntB3) edgeZ0 = Part.makeLine(PntB3,Pnt0) if a <= r: edgeB1 = Part.makeLine(Pnt9,PntB1) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7, \ edgeB1, edgeB2, edgeB3, edgeZ0]) else: edge8 = Part.makeLine(Pnt9,Pnt10) edgeB1 = Part.makeLine(Pnt10,PntB1) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8, \ edgeB1, edgeB2, edgeB3, edgeZ0]) aFace =Part.Face(aWire) head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") # Part.show(extrude) head = head.cut(extrude) #FreeCAD.Console.PrintMessage("der Kopf geschnitten: " + str(dia) + "\n") return head # EN 1662 Hex-head-bolt with flange - small series # EN 1665 Hexagon bolts with flange, heavy series def makeEN1662_2(self,SType ='EN1662', ThreadType ='M8',l=25.0): dia = self.getDia(ThreadType) #FreeCAD.Console.PrintMessage("der Kopf mit l: " + str(l) + "\n") if SType == 'EN1662': P, b0, b1, b2, b3, c, dc, dw, e, k, kw,f, r1, s = en1662def[ThreadType] else: P, b0, b1, b2, b3, c, dc, dw, e, k, kw,f, r1, s = en1665def[ThreadType] if l< b0: b = l - 2*P else: if l<= 125.0: b = b1 else: if l<= 200.0: b = b2 else: b = b3 #FreeCAD.Console.PrintMessage("der Kopf mit isoEN1662: " + str(c) + "\n") cham = s*(2.0/math.sqrt(3.0)-1.0)*math.sin(math.radians(25)) # needed for chamfer at head top ### make the new code with math.modf(l) residue, turns = math.modf((b)/P) halfturns = 2*int(turns) if residue < 0.5: a_point = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a_point = l - (turns+2.0) * P #halfturns = halfturns + 2 offSet = r1 - a_point sqrt2_ = 1.0/math.sqrt(2.0) # Flange is made with a radius of c beta = math.radians(25.0) tan_beta = math.tan(beta) # Calculation of Arc points of flange edge using dc and c arc1_x = dc/2.0 - c/2.0 + (c/2.0)*math.sin(beta) 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 + kw * 1.1 + cham #kmean = k * 0.95 #Hex-Head Points #FreeCAD.Console.PrintMessage("der Kopf mit math a: " + str(a_point) + "\n") PntH0 = Base.Vector(0.0,0.0,kmean*0.9) PntH1 = Base.Vector(s/2.0*0.8 - r1/2.0,0.0,kmean*0.9) 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_) PntH1b = Base.Vector(s/2.0*0.8,0.0,kmean*0.9 +r1/2.0) PntH2 = Base.Vector(s/2.0*0.8,0.0,kmean -r1) PntH2a = Base.Vector(s/2.0*0.8+r1-r1*sqrt2_,0.0,kmean -r1 +r1*sqrt2_) PntH2b = Base.Vector(s/2.0*0.8 + r1 ,0.0,kmean) PntH3 = Base.Vector(s/2.0,0.0,kmean) #PntH4 = Base.Vector(s/math.sqrt(3.0),0.0,kmean-cham) #s/math.sqrt(3.0) #PntH5 = Base.Vector(s/math.sqrt(3.0),0.0,c) #PntH6 = Base.Vector(0.0,0.0,c) edgeH1 = Part.makeLine(PntH0,PntH1) edgeH2 = Part.Arc(PntH1,PntH1a,PntH1b).toShape() edgeH3 = Part.makeLine(PntH1b,PntH2) edgeH3a = Part.Arc(PntH2,PntH2a,PntH2b).toShape() edgeH3b = Part.makeLine(PntH2b,PntH3) hWire=Part.Wire([edgeH1,edgeH2,edgeH3,edgeH3a,edgeH3b]) topShell = hWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) #Part.show(topShell) # create a cutter ring to generate the chamfer at the top of the hex chamHori = s/math.sqrt(3.0) - s/2.0 PntC1 = Base.Vector(s/2.0-chamHori,0.0,kmean+kmean) PntC2 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,kmean+kmean) PntC3 = Base.Vector(s/2.0-chamHori,0.0,kmean+cham) PntC4 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,kmean-cham-cham) #s/math.sqrt(3.0) edgeC1 = Part.makeLine(PntC3, PntC1) edgeC2 = Part.makeLine(PntC1, PntC2) edgeC3 = Part.makeLine(PntC2, PntC4) edgeC4 = Part.makeLine(PntC4, PntC3) cWire = Part.Wire([edgeC4, edgeC1, edgeC2, edgeC3]) cFace = Part.Face(cWire) chamCut = cFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(cWire) #Part.show(chamCut) # create hexagon mhex=Base.Matrix() mhex.rotateZ(math.radians(60.0)) polygon = [] vhex=Base.Vector(s/math.sqrt(3.0),0.0,kmean) for i in range(6): polygon.append(vhex) vhex = mhex.multiply(vhex) polygon.append(vhex) hexagon = Part.makePolygon(polygon) hexFace = Part.Face(hexagon) solidHex = hexFace.extrude(Base.Vector(0.0,0.0,c-kmean)) #Part.show(solidHex) hexCham = solidHex.cut(chamCut) #Part.show(hexCham) topFaces = topShell.Faces topFaces.append(hexCham.Faces[6]) topFaces.append(hexCham.Faces[12]) topFaces.append(hexCham.Faces[14]) topFaces.append(hexCham.Faces[13]) topFaces.append(hexCham.Faces[8]) topFaces.append(hexCham.Faces[2]) topFaces.append(hexCham.Faces[1]) hexFaces = [hexCham.Faces[5], hexCham.Faces[11], hexCham.Faces[10]] hexFaces.extend([hexCham.Faces[9], hexCham.Faces[3], hexCham.Faces[0]]) hexShell = Part.Shell(hexFaces) # Center of flange: Pnt0 = Base.Vector(0.0,0.0,hF) Pnt1 = Base.Vector(s/2.0,0.0,hF) # arc edge of flange: Pnt2 = Base.Vector(arc1_x,0.0,arc1_z) Pnt3 = Base.Vector(dc/2.0,0.0,c/2.0) 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 Pnt6 = Base.Vector(dia/2.0+r1-r1*sqrt2_,0.0,-r1+r1*sqrt2_) #arc-point of fillet Pnt7 = Base.Vector(dia/2.0,0.0,-r1) # end of fillet Pnt8 = Base.Vector(dia/2.0,0.0,-a_point) # Start of thread edge1 = Part.makeLine(Pnt0,Pnt1) edge2 = Part.makeLine(Pnt1,Pnt2) edge3 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape() edge4 = Part.makeLine(Pnt4,Pnt5) edge5 = Part.Arc(Pnt5,Pnt6,Pnt7).toShape() # make a cutter for the hexShell PntHC1 = Base.Vector(0.0,0.0,arc1_z) PntHC2 = Base.Vector(0.0,0.0,0.0) edgeHC1 = Part.makeLine(Pnt2,PntHC1) edgeHC2 = Part.makeLine(PntHC1,PntHC2) edgeHC3 = Part.makeLine(PntHC2,Pnt0) HCWire = Part.Wire([edge2, edgeHC1, edgeHC2, edgeHC3, edge1]) HCFace = Part.Face(HCWire) hex2Cut = HCFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) hexShell = hexShell.cut(hex2Cut) #Part.show(hexShell) topFaces.extend(hexShell.Faces) # bolt points cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0 PntB0 = Base.Vector(0.0,0.0,-a_point) PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_t) PntB2 = Base.Vector(dia/2.0-cham_t,0.0,-l) PntB3 = Base.Vector(0.0,0.0,-l) edgeB2 = Part.makeLine(PntB1,PntB2) edgeB3 = Part.makeLine(PntB2,PntB3) #if self.RealThread.isChecked(): if self.rThread: aWire=Part.Wire([edge2,edge3,edge4,edge5]) boltIndex = 4 else: if a_point <=r1: edgeB1 = Part.makeLine(Pnt7,PntB1) aWire=Part.Wire([edge2,edge3,edge4,edge5, edgeB1, edgeB2, edgeB3]) boltIndex = 7 else: edgeB1 = Part.makeLine(Pnt8,PntB1) edge6 = Part.makeLine(Pnt7,Pnt8) aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6, \ edgeB1, edgeB2, edgeB3]) boltIndex = 8 #aFace =Part.Face(aWire) #Part.show(aWire) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") #Part.show(headShell) chamFace = headShell.Faces[0].cut(solidHex) #Part.show(chamFace) topFaces.append(chamFace.Faces[0]) for i in range(1,boltIndex): topFaces.append(headShell.Faces[i]) if self.rThread: if (dia < 3.0) or (dia > 5.0): rthread = self.makeShellthread(dia, P, halfturns, True, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P)) for tFace in rthread.Faces: topFaces.append(tFace) headShell = Part.Shell(topFaces) screw = Part.Solid(headShell) else: rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P)) for tFace in rthread.Faces: topFaces.append(tFace) headShell = Part.Shell(topFaces) head = Part.Solid(headShell) cyl = self.cutChamfer(dia, P, l) #FreeCAD.Console.PrintMessage("vor Schnitt Ende: " + str(dia) + "\n") screw = head.cut(cyl) else: screwShell = Part.Shell(topFaces) screw = Part.Solid(screwShell) return screw # also used for ISO 7046 countersunk flat head screws with H cross recess # also used for ISO 7047 raised countersunk head screws with H cross recess # also used for ISO 10642 Hexagon socket countersunk head screws # also used for ISO 14582 Hexalobular socket countersunk head screws, high head # also used for ISO 14584 Hexalobular socket raised countersunk head screws def makeIso7046(self, SType ='ISO7046', ThreadType ='M6',l=25.0): dia = self.getDia(ThreadType) #FreeCAD.Console.PrintMessage("der 2009Kopf mit l: " + str(l) + "\n") if (SType == 'ISO10642'): P,b,dk_theo,dk_mean,da, ds_min, e, k, r, s_mean, t, w =iso10642def[ThreadType] ePrax = s_mean / math.sqrt(3.0) / 0.99 ht = 0.0 a = 2*P t_mean = t else: #still need the data from iso2009def, but this screw can not created here P, a, b, dk_theo, dk_mean, k, n_min, r, t_mean, x = iso2009def[ThreadType] ht = 0.0 # Head heigth of flat head if SType == 'ISO7046': cT, mH, mZ = iso7046def[ThreadType] if (SType == 'ISO7047'): rf, t_mean, cT, mH, mZ = Raised_countersunk_def[ThreadType] #Lengths and angles for calculation of head rounding beta = math.asin(dk_mean /2.0 / rf) # angle of head edge tan_beta = math.tan(beta) alpha = beta/2.0 # half angle # heigth of raised head top ht = rf - (dk_mean/2.0) / tan_beta #print 'he: ', he h_arc_x = rf * math.sin(alpha) h_arc_z = ht - rf + rf * math.cos(alpha) #FreeCAD.Console.PrintMessage("h_arc_z: " + str(h_arc_z) + "\n") if (SType == 'ISO14582'): P, a, b, dk_theo, dk_mean, k, r, tt, A, t_mean = iso14582def[ThreadType] ePrax = A / 2.0 / 0.99 if (SType == 'ISO14584'): P, b, dk_theo, dk_mean, f, k, r, rf, x, tt, A, t_mean = iso14584def[ThreadType] ePrax = A / 2.0 / 0.99 #Lengths and angles for calculation of head rounding beta = math.asin(dk_mean /2.0 / rf) # angle of head edge tan_beta = math.tan(beta) ctp = - (dk_mean/2.0) / tan_beta # Center Top Edge = center for rf betaA = math.asin(ePrax / rf) # angle of head edge at start of recess ht = ctp + ePrax / math.tan(betaA) alpha = betaA + (beta - betaA)/2.0 # half angle of top Arc h_arc_x = rf * math.sin(alpha) h_arc_z = ctp + rf * math.cos(alpha) #FreeCAD.Console.PrintMessage("der Kopf mit iso r: " + str(r) + "\n") cham = (dk_theo - dk_mean)/2.0 rad225 = math.radians(22.5) rad45 = math.radians(45.0) rtan = r*math.tan(rad225) #FreeCAD.Console.PrintMessage("Checking rtan: " + str(rtan) + "\n") if (b > (l - k - rtan/2.0 - 1.0*P)): bmax = l - k - rtan/2.0 - 1.0*P else: bmax = b ### make the new code with math.modf(l) residue, turns = math.modf((bmax)/P) halfturns = 2*int(turns) if residue < 0.5: a_point = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a_point = l - (turns+2.0) * P #halfturns = halfturns + 2 offSet = k + rtan - a_point #Head Points Pnt1 = Base.Vector(dk_mean/2.0,0.0,0.0) Pnt2 = Base.Vector(dk_mean/2.0,0.0,-cham) Pnt3 = Base.Vector(dia/2.0+r-r*math.cos(rad45),0.0,-k-rtan+r*math.sin(rad45)) # Arc-points Pnt4 = Base.Vector(dia/2.0+r-r*(math.cos(rad225)),0.0,-k-rtan+r*math.sin(rad225)) Pnt5 = Base.Vector(dia/2.0,0.0,-k-rtan) Pnt6 = Base.Vector(dia/2.0,0.0,-a_point) if (SType == 'ISO10642') or (SType == 'ISO14582'): if (SType == 'ISO10642'): recess, recessShell = self.makeAllen2(s_mean, t_mean, 0.0 ) Pnt0 = Base.Vector(ePrax/2.0,0.0,-ePrax/2.0) PntCham = Base.Vector(ePrax,0.0,0.0) edge1 = Part.makeLine(Pnt0,PntCham) edgeCham2 = Part.makeLine(PntCham,Pnt1) edge2 = Part.makeLine(Pnt1,Pnt2) edge2 = Part.Wire([edgeCham2,edge2]) PntH0 = Base.Vector(ePrax/2.0,0.0, ht + k) PntH1 = Base.Vector(ePrax,0.0, ht + k) if (SType == 'ISO14582'): recess, recessShell = self.makeIso10664_3(tt, t_mean, 0.0) # hexalobular recess Pnt0 = Base.Vector(0.0,0.0,0.0) edge1 = Part.makeLine(Pnt0,Pnt1) edge2 = Part.makeLine(Pnt1,Pnt2) # bolt points with bolt chamfer cham_b = P*math.sqrt(3.0)/2.0*17.0/24.0 PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_b) PntB2 = Base.Vector(dia/2.0-cham_b,0.0,-l) PntB3 = Base.Vector(0.0,0.0,-l) if a_point <= (k + rtan): edgeB0 = Part.makeLine(Pnt5,PntB1) else: edgeB0 = Part.makeLine(Pnt6,PntB1) edgeB2 = Part.makeLine(PntB1,PntB2) edgeB3 = Part.makeLine(PntB2,PntB3) edgeB1 = Part.Wire([edgeB2,edgeB3]) else: # bolt points PntB1 = Base.Vector(dia/2.0,0.0,-l) PntB2 = Base.Vector(0.0,0.0,-l) if a_point <= (k + rtan): edgeB0 = Part.makeLine(Pnt5,PntB1) else: edgeB0 = Part.makeLine(Pnt6,PntB1) edgeB1 = Part.makeLine(PntB1,PntB2) if (SType == 'ISO7047'): # make raised head rounding Pnt0 = Base.Vector(0.0,0.0,ht) Pnt0arc = Base.Vector(h_arc_x,0.0,h_arc_z) edge1 = Part.Arc(Pnt0,Pnt0arc,Pnt1).toShape() edge2 = Part.makeLine(Pnt1,Pnt2) PntH0 = Base.Vector(0.0,0.0, ht + k) PntH1 = Base.Vector(dk_mean/2.0,0.0, ht + k) recess, recessShell = self.makeCross_H3(cT, mH, ht) if (SType == 'ISO7046'): # ISO7046 Pnt0 = Base.Vector(0.0,0.0,ht) edge1 = Part.makeLine(Pnt0,Pnt1) # make flat head edge2 = Part.makeLine(Pnt1,Pnt2) recess, recessShell = self.makeCross_H3(cT, mH, ht) if (SType == 'ISO14584'): # make raised head rounding with chamfer Pnt0 = Base.Vector(ePrax/2.0,0.0,ht-ePrax/4.0) PntCham = Base.Vector(ePrax,0.0,ht) PntArc = Base.Vector(h_arc_x,0.0,h_arc_z) edge1 = Part.makeLine(Pnt0,PntCham) edgeArc = Part.Arc(PntCham,PntArc,Pnt1).toShape() edge2 = Part.makeLine(Pnt1,Pnt2) edge2 = Part.Wire([edgeArc,edge2]) PntH0 = Base.Vector(ePrax/2.0,0.0, ht + k) PntH1 = Base.Vector(ePrax,0.0, ht + k) recess, recessShell = self.makeIso10664_3(tt, t_mean, ht) # hexalobular recess edge3 = Part.makeLine(Pnt2,Pnt3) edgeArc = Part.Arc(Pnt3,Pnt4,Pnt5).toShape() edgeArc1 = Part.makeLine(Pnt3,Pnt4) edgeArc2 = Part.makeLine(Pnt4,Pnt5) edge6 = Part.makeLine(Pnt5,Pnt6) if self.rThread: #aWire=Part.Wire([edge1,edge2,edge3,edgeArc]) aWire=Part.Wire([edge2,edge3,edgeArc]) else: if a_point <= (k + rtan): aWire=Part.Wire([edge2,edge3,edgeArc, edgeB0, edgeB1]) else: aWire=Part.Wire([edge2,edge3,edgeArc,edge6, edgeB0, edgeB1]) #Part.show(aWire) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) headFaces = headShell.Faces #Part.show(headShell) if (SType == 'ISO7046') or (SType == 'ISO14582'): # hCut is just a cylinder for ISO7046 hCut = Part.makeCylinder(dk_mean/2.0,k,Pnt0) #Part.show(hCut) topFace = hCut.Faces[2] else: edgeH1 = Part.makeLine(Pnt1,PntH1) edgeH2 = Part.makeLine(PntH1,PntH0) edgeH3 = Part.makeLine(PntH0,Pnt0) hWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell hFace = Part.Face(hWire) hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) topFace = hCut.Faces[0] recessShell = recessShell.cut(hCut) topFace = topFace.cut(recess) #Part.show(topFace) #Part.show(recessShell) #Part.show(headShell) headFaces.append(topFace.Faces[0]) headFaces.extend(recessShell.Faces) if (SType == 'ISO10642') or (SType == 'ISO14582'): if self.rThread: if (dia < 3.0) or (dia > 5.0): #if True: rthread = self.makeShellthread(dia, P, halfturns, True, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) #head = head.fuse(rthread) #Part.show(rthread) for threadFace in rthread.Faces: headFaces.append(threadFace) screwShell = Part.Shell(headFaces) screw = Part.Solid(screwShell) else: ''' # head = self.cutIsoThread(head, dia, P, turns, l) rthread = self.makeShellthread(dia, P, halfturns, False) rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P)) head = head.fuse(rthread) head = head.removeSplitter() cyl = self.cutChamfer(dia, P, l) #FreeCAD.Console.PrintMessage("vor Schnitt Ende: " + str(dia) + "\n") head = head.cut(cyl) ''' rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) #head = head.fuse(rthread) Part.show(rthread) for threadFace in rthread.Faces: headFaces.append(threadFace) screwShell = Part.Shell(headFaces) screw = Part.Solid(screwShell) cyl = self.cutChamfer(dia, P, l) screw = screw.cut(cyl) else: screwShell = Part.Shell(headFaces) screw = Part.Solid(screwShell) else: if self.rThread: rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) #head = head.fuse(rthread) #Part.show(rthread) for threadFace in rthread.Faces: headFaces.append(threadFace) screwShell = Part.Shell(headFaces) screw = Part.Solid(screwShell) return screw # make ISO 4762 Allan Screw head # ISO 14579 Hexalobular socket head cap screws def makeIso4762(self, SType ='ISO4762', ThreadType ='M6',l=25.0): dia = self.getDia(ThreadType) #FreeCAD.Console.PrintMessage("der 4762Kopf mit l: " + str(l) + "\n") P, b, dk_max, da, ds_mean, e, lf, k, r, s_mean, t, v, dw, w = iso4762def[ThreadType] #FreeCAD.Console.PrintMessage("der Kopf mit iso r: " + str(r) + "\n") if SType == 'ISO14579': tt, A, t = iso14579def[ThreadType] #Head Points 30° countersunk # Pnt0 = Base.Vector(0.0,0.0,k-A/4.0) #Center Point for countersunk Pnt0 = Base.Vector(0.0,0.0,k-A/8.0) #Center Point for flat countersunk PntFlat = Base.Vector(A/8.0,0.0,k-A/8.0) # End of flat part Pnt1 = Base.Vector(A/1.99,0.0,k) #countersunk edge at head edgeCham0 = Part.makeLine(Pnt0,PntFlat) edgeCham1 = Part.makeLine(PntFlat,Pnt1) edge1 = Part.Wire([edgeCham0,edgeCham1]) # Here is the next approach to shorten the head building time # Make two helper points to create a cutting tool for the # recess and recess shell. PntH1 = Base.Vector(A/1.99,0.0, 2.0*k) else: e_cham = 2.0 * s_mean / math.sqrt(3.0) #Head Points 45° countersunk Pnt0 = Base.Vector(0.0,0.0,k-e_cham/1.99/2.0) #Center Point for countersunk PntFlat = Base.Vector(e_cham/1.99/2.0,0.0,k-e_cham/1.99/2.0) # End of flat part Pnt1 = Base.Vector(e_cham/1.99,0.0,k) #countersunk edge at head edgeCham0 = Part.makeLine(Pnt0,PntFlat) edgeCham1 = Part.makeLine(PntFlat,Pnt1) edge1 = Part.Wire([edgeCham0,edgeCham1]) PntH1 = Base.Vector(e_cham/1.99,0.0, 2.0*k) PntH2 = Base.Vector(0.0,0.0, 2.0*k) edgeH1 = Part.makeLine(Pnt1,PntH1) edgeH2 = Part.makeLine(PntH1,PntH2) edgeH3 = Part.makeLine(PntH2,Pnt0) hWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell hFace = Part.Face(hWire) hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) ''' PntH2 = Base.Vector(A/8.0,0.0, 2.0*k) edgeH1 = Part.makeLine(Pnt1,PntH1) edgeH2 = Part.makeLine(PntH1,PntH2) edgeH3 = Part.makeLine(PntH2,PntFlat) hWire = Part.Wire([edgeCham1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell hFace = Part.Face(hWire) hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) ''' sqrt2_ = 1.0/math.sqrt(2.0) #depth = s_mean / 3.0 ''' if (b > l - 2*P): bmax = l-2*P else: bmax = b halfturns = round(2.0*(bmax+P)/P) # number of thread turns if self.RealThread.isChecked(): a_real = l-(halfturns+2)*P/2.0 # point to fuse real thread else: a_real = l-halfturns*P/2.0 # starting point of thread if a_real < r: a_point = r*1.3 else: a_point = a_real ''' if (b > (l - 1.0*P)): bmax = l- 1.0*P else: bmax = b ### make the new code with math.modf(l) residue, turns = math.modf((bmax)/P) halfturns = 2*int(turns) if residue < 0.5: a_point = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a_point = l - (turns+2.0) * P #halfturns = halfturns + 2 offSet = r - a_point #FreeCAD.Console.PrintMessage("The transition at a: " + str(a) + " turns " + str(turns) + "\n") #rad30 = math.radians(30.0) #Head Points Pnt2 = Base.Vector(dk_max/2.0-v,0.0,k) #start of fillet Pnt3 = Base.Vector(dk_max/2.0-v+v*sqrt2_,0.0,k-v+v*sqrt2_) #arc-point of fillet Pnt4 = Base.Vector(dk_max/2.0,0.0,k-v) #end of fillet Pnt5 = Base.Vector(dk_max/2.0,0.0,(dk_max-dw)/2.0) #we have a chamfer here Pnt6 = Base.Vector(dw/2.0,0.0,0.0) #end of chamfer Pnt7 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank Pnt8 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet Pnt9 = Base.Vector(dia/2.0,0.0,-r) # end of fillet Pnt10 = Base.Vector(dia/2.0,0.0,-a_point) # start of thread edge1 = Part.makeLine(Pnt0,Pnt1) edge2 = Part.makeLine(Pnt1,Pnt2) edge3 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape() edge4 = Part.makeLine(Pnt4,Pnt5) edge5 = Part.makeLine(Pnt5,Pnt6) edge6 = Part.makeLine(Pnt6,Pnt7) edge7 = Part.Arc(Pnt7,Pnt8,Pnt9).toShape() ''' # bolt points PntB1 = Base.Vector(dia/2.0,0.0,-l-P) # Chamfer is made with a cut later PntB2 = Base.Vector(0.0,0.0,-l-P) #PntB3 = Base.Vector(0.0,0.0,-l) edgeB0 = Part.makeLine(Pnt10,PntB1) edgeB1 = Part.makeLine(PntB1,PntB2) #edgeB2 = Part.makeLine(PntB2,PntB3) edgeZ0 = Part.makeLine(PntB2,Pnt0) aWire=Part.Wire([edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8, \ edgeB0, edgeB1, edgeZ0]) ''' if self.rThread: aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7]) else: # bolt points cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0 PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_t) PntB2 = Base.Vector(dia/2.0-cham_t,0.0,-l) PntB3 = Base.Vector(0.0,0.0,-l) #edgeB1 = Part.makeLine(Pnt10,PntB1) edgeB2 = Part.makeLine(PntB1,PntB2) edgeB3 = Part.makeLine(PntB2,PntB3) if a_point <= r: edgeB1 = Part.makeLine(Pnt9,PntB1) aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7, \ edgeB1, edgeB2, edgeB3]) else: edge8 = Part.makeLine(Pnt9,Pnt10) edgeB1 = Part.makeLine(Pnt10,PntB1) aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7,edge8, \ edgeB1, edgeB2, edgeB3]) #Part.show(aWire) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #head = Part.Solid(headShell) #Part.show(aWire) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") headFaces = headShell.Faces if SType == 'ISO14579': #recess = self.makeIso10664(tt, t, k) # hexalobular recess recess, recessShell = self.makeIso10664_3(tt, t, k) # hexalobular recess else: recess, recessShell = self.makeAllen2(s_mean, t, k ) recessShell = recessShell.cut(hCut) topFace = hCut.Faces[1] #topFace = hCut.Faces[0] topFace = topFace.cut(recess) #Part.show(topFace) #Part.show(recessShell) #Part.show(headShell) headFaces.append(topFace.Faces[0]) #headFaces.append(hCut.Faces[2]) #allenscrew = head.cut(recess) #Part.show(hCut) headFaces.extend(recessShell.Faces) #if self.RealThread.isChecked(): if self.rThread: #if (dia < 3.0) or (dia > 5.0): if True: # head = self.cutIsoThread(head, dia, P, turns, l) rthread = self.makeShellthread(dia, P, halfturns, True, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P)) #Part.show(rthread) for tFace in rthread.Faces: headFaces.append(tFace) headShell = Part.Shell(headFaces) allenscrew = Part.Solid(headShell) else: # head = self.cutIsoThread(head, dia, P, turns, l) rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P)) for tFace in rthread.Faces: headFaces.append(tFace) headShell = Part.Shell(headFaces) allenscrew = Part.Solid(headShell) cyl = self.cutChamfer(dia, P, l) # FreeCAD.Console.PrintMessage("vor Schnitt Ende: " + str(dia) + "\n") allenscrew = allenscrew.cut(cyl) else: headShell = Part.Shell(headFaces) allenscrew = Part.Solid(headShell) return allenscrew # make ISO 7380-1 Button head Screw # make ISO 7380-2 Button head Screw with collar # make DIN 967 cross recessed pan head Screw with collar def makeIso7380(self, SType ='ISO7380-1', ThreadType ='M6',l=25.0): dia = self.getDia(ThreadType) #todo: different radii for screws with thread to head or with shaft? sqrt2_ = 1.0/math.sqrt(2.0) if (SType =='DIN967'): P, b, c, da, dk, r, k, rf, x, cT, mH, mZ = din967def[ThreadType] rH = rf # radius of button arc alpha = math.acos((rf-k+c)/rf) #Head Points Pnt0 = Base.Vector(0.0,0.0,k) PntArc = Base.Vector(rf*math.sin(alpha/2.0),0.0,k-rf + rf*math.cos(alpha/2.0)) #arc-point of button Pnt1 = Base.Vector(rf*math.sin(alpha),0.0,c) #end of button arc PntC0 = Base.Vector((dk)/2.0,0.0,c) #collar points PntC2 = Base.Vector((dk)/2.0,0.0,0.0) #collar points Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank edge1 = Part.Arc(Pnt0,PntArc,Pnt1).toShape() edgeC0 = Part.makeLine(Pnt1,PntC0) edgeC1 = Part.makeLine(PntC0,PntC2) edge2 = Part.Wire([edgeC0, edgeC1]) edge3 = Part.makeLine(PntC2,Pnt4) #Points for recessShell cutter PntH0 = Base.Vector(0.0,0.0,2.0*k) PntH1 = Base.Vector(rf*math.sin(alpha),0.0,2.0*k) recess, recessShell = self.makeCross_H3(cT, mH, k) else: if (SType =='ISO7380-1'): P, b, a, da, dk, dk_mean,s_mean, t_min, r, k, e, w = iso7380def[ThreadType] # Bottom of recess e_cham = 2.0 * s_mean / math.sqrt(3.0) / 0.99 #depth = s_mean / 3.0 ak = -(4*k**2 + e_cham**2 - dk**2)/(8*k) # helper value for button arc rH = math.sqrt((dk/2.0)**2 + ak**2) # radius of button arc alpha = (math.atan(2*(k + ak)/e_cham) + math.atan((2*ak)/dk))/2 Pnt2 = Base.Vector(rH*math.cos(alpha),0.0,-ak + rH*math.sin(alpha)) #arc-point of button Pnt3 = Base.Vector(dk/2.0,0.0,0.0) #end of fillet Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank edge3 = Part.makeLine(Pnt3,Pnt4) if (SType =='ISO7380-2'): P, b, c, da, dk, dk_c,s_mean,t_min, r, k, e, w = iso7380_2def[ThreadType] # Bottom of recess e_cham = 2.0 * s_mean / math.sqrt(3.0) / 0.99 #depth = s_mean / 3.0 ak = -(4*(k-c)**2 + e_cham**2 - dk**2)/(8*(k-c)) # helper value for button arc rH = math.sqrt((dk/2.0)**2 + ak**2) # radius of button arc alpha = (math.atan(2*(k -c + ak)/e_cham) + math.atan((2*ak)/dk))/2 Pnt2 = Base.Vector(rH*math.cos(alpha),0.0,c -ak + rH*math.sin(alpha)) #arc-point of button Pnt3 = Base.Vector(dk/2.0,0.0,c) #end of fillet Pnt4 = Base.Vector(dia/2.0+r,0.0,0.0) #start of fillet between head and shank PntC0 = Base.Vector((dk_c-c)/2.0,0.0,c) #collar points PntC1 = Base.Vector(dk_c/2.0,0.0,c/2.0) #collar points PntC2 = Base.Vector((dk_c-c)/2.0,0.0,0.0) #collar points edgeC0 = Part.makeLine(Pnt3,PntC0) edgeC1 = Part.Arc(PntC0,PntC1,PntC2).toShape() edge3 = Part.makeLine(PntC2,Pnt4) edge3 = Part.Wire([edgeC0, edgeC1, edge3]) #Head Points Pnt0 = Base.Vector(e_cham/4.0,0.0,k-e_cham/4.0) #Center Point for chamfer Pnt1 = Base.Vector(e_cham/2.0,0.0,k) #inner chamfer edge at head #Points for recessShell cutter PntH0 = Base.Vector(e_cham/4.0,0.0,2.0*k) PntH1 = Base.Vector(e_cham/2.0,0.0,2.0*k) edge1 = Part.makeLine(Pnt0,Pnt1) edge2 = Part.Arc(Pnt1,Pnt2,Pnt3).toShape() recess, recessShell = self.makeAllen2(s_mean, t_min, k) if (b > (l - 1.0*P)): bmax = l- 1.0*P else: bmax = b ### make the new code with math.modf(l) residue, turns = math.modf((bmax)/P) halfturns = 2*int(turns) if residue < 0.5: a_point = l - (turns+1.0) * P halfturns = halfturns +1 else: halfturns = halfturns + 2 a_point = l - (turns+2.0) * P offSet = r - a_point Pnt5 = Base.Vector(dia/2.0+r-r*sqrt2_,0.0,-r+r*sqrt2_) #arc-point of fillet Pnt6 = Base.Vector(dia/2.0,0.0,-r) # end of fillet Pnt7 = Base.Vector(dia/2.0,0.0,-a_point) # start of thread edge4 = Part.Arc(Pnt4,Pnt5,Pnt6).toShape() edge5 = Part.makeLine(Pnt6,Pnt7) if (SType =='DIN967'): # bolt points PntB1 = Base.Vector(dia/2.0,0.0,-l) PntB2 = Base.Vector(0.0,0.0,-l) edgeB2 = Part.makeLine(PntB1,PntB2) else: # bolt points cham_b = P*math.sqrt(3.0)/2.0*17.0/24.0 PntB1 = Base.Vector(dia/2.0,0.0,-l+cham_b) PntB2 = Base.Vector(dia/2.0-cham_b,0.0,-l) PntB3 = Base.Vector(0.0,0.0,-l) edgeB2 = Part.makeLine(PntB1,PntB2) edgeB3 = Part.makeLine(PntB2,PntB3) edgeB2 = Part.Wire([edgeB2, edgeB3]) if self.rThread: aWire=Part.Wire([edge2,edge3,edge4]) else: if a_point <= r: edgeB1 = Part.makeLine(Pnt6,PntB1) aWire=Part.Wire([edge2,edge3,edge4, edgeB1, edgeB2]) else: edge5 = Part.makeLine(Pnt6,Pnt7) edgeB1 = Part.makeLine(Pnt7,PntB1) aWire=Part.Wire([edge2,edge3,edge4,edge5, edgeB1, edgeB2]) #Part.show(aWire) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(headShell) headFaces = headShell.Faces edgeH1 = Part.makeLine(Pnt1,PntH1) edgeH2 = Part.makeLine(PntH1,PntH0) edgeH3 = Part.makeLine(PntH0,Pnt0) hWire = Part.Wire([edge1,edgeH1,edgeH2,edgeH3]) # Cutter for recess-Shell hFace = Part.Face(hWire) hCut = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) topFace = hCut.Faces[0] recessShell = recessShell.cut(hCut) topFace = topFace.cut(recess) #Part.show(topFace) #Part.show(recessShell) #Part.show(headShell) headFaces.append(topFace.Faces[0]) headFaces.extend(recessShell.Faces) if self.rThread: #if (dia < 3.0) or (dia > 5.0): if True: if (SType =='DIN967'): rthread = self.makeShellthread(dia, P, halfturns, False, offSet) else: rthread = self.makeShellthread(dia, P, halfturns, True, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) for threadFace in rthread.Faces: headFaces.append(threadFace) screwShell = Part.Shell(headFaces) screw = Part.Solid(screwShell) else: rthread = self.makeShellthread(dia, P, halfturns, False, offSet) rthread.translate(Base.Vector(0.0, 0.0,-a_point -2.0*P)) for threadFace in rthread.Faces: headFaces.append(threadFace) screwShell = Part.Shell(headFaces) screw = Part.Solid(screwShell) cyl = self.cutChamfer(dia, P, l) screw = screw.cut(cyl) else: screwShell = Part.Shell(headFaces) screw = Part.Solid(screwShell) return screw def makeHextool(self,s_hex, k_hex, cir_hex): # makes a cylinder with an inner hex hole, used as cutting tool # create hexagon mhex=Base.Matrix() mhex.rotateZ(math.radians(60.0)) polygon = [] vhex=Base.Vector(s_hex/math.sqrt(3.0),0.0,-k_hex*0.1) for i in range(6): polygon.append(vhex) vhex = mhex.multiply(vhex) polygon.append(vhex) hexagon = Part.makePolygon(polygon) # create circle circ=Part.makeCircle(cir_hex/2.0,Base.Vector(0.0,0.0,-k_hex*0.1)) # Create the face with the circle as outline and the hexagon as hole face=Part.Face([Part.Wire(circ),hexagon]) # Extrude in z to create the final cutting tool exHex=face.extrude(Base.Vector(0.0,0.0,k_hex*1.2)) # Part.show(exHex) return exHex def makeShellthread(self, d, P, halfrots, withcham, offSet): d = float(d) #rotations = int(rots)-1 halfrots_int = int(halfrots) rotations = (halfrots_int / 2)-1 if halfrots_int % 2 == 1: #FreeCAD.Console.PrintMessage("got half turn: " + str(halfrots_int) + "\n") halfturn = True # bot_off = - P/2.0 # transition of half a turn bot_off = 0.0 # nominal length else: halfturn = False bot_off = 0.0 # nominal length H=P*math.cos(math.radians(30)) # Gewindetiefe H r=d/2.0 # helix = Part.makeHelix(P,P,d*511/1000.0,0) # make just one turn, length is identical to pitch helix = Part.makeHelix(P,P,d*self.Tuner/1000.0,0) # make just one turn, length is identical to pitch helix.translate(FreeCAD.Vector(0.0, 0.0,-P*9.0/16.0)) extra_rad = P # points for screw profile ps0 = (r,0.0, 0.0) ps1 = (r-H*5.0/8.0,0.0, -P*5.0/16.0) ps2 = (r-H*17.0/24.0,0.0, -P*7.0/16.0) # Center of Arc ps3 = (r-H*5.0/8.0,0.0, -P*9.0/16.0 ) ps4 = (r, 0.0, -P*14.0/16.0) ps5 = (r,0.0, -P) ps6 = (r+extra_rad,0.0, -P) ps7 = (r+extra_rad,0.0, 0.0) edge0 = Part.makeLine(ps0,ps1) edge1 = Part.Arc(FreeCAD.Vector(ps1),FreeCAD.Vector(ps2),FreeCAD.Vector(ps3)).toShape() edge2 = Part.makeLine(ps3,ps4) edge3 = Part.makeLine(ps4,ps5) edge4 = Part.makeLine(ps5,ps6) edge5 = Part.makeLine(ps6,ps7) edge6 = Part.makeLine(ps7,ps0) W0 = Part.Wire([edge0, edge1, edge2, edge3, edge4, edge5, edge6]) makeSolid=True isFrenet=True pipe0 = Part.Wire(helix).makePipeShell([W0],makeSolid,isFrenet) # pipe1 = pipe0.copy() TheFaces = [] TheFaces.append(pipe0.Faces[0]) #Part.show(pipe0.Faces[0]) TheFaces.append(pipe0.Faces[1]) #Part.show(pipe0.Faces[1]) TheFaces.append(pipe0.Faces[2]) #Part.show(pipe0.Faces[2]) TheFaces.append(pipe0.Faces[3]) #Part.show(pipe0.Faces[3]) TheShell = Part.Shell(TheFaces) # print "Shellpoints: ", len(TheShell.Vertexes) i = 1 for i in range(rotations-2): TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P)) for flaeche in TheShell.Faces: TheFaces.append(flaeche) #FreeCAD.Console.PrintMessage("Base-Shell: " + str(i) + "\n") # Make separate faces for the tip of the screw botFaces = [] for i in range(rotations-2, rotations, 1): TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P)) for flaeche in TheShell.Faces: botFaces.append(flaeche) #FreeCAD.Console.PrintMessage("Bottom-Shell: " + str(i) + "\n") # making additional faces for transition to cylinder pc1 = (r + H/16.0,0.0,P*1/32.0) pc2 = (r-H*5.0/8.0,0.0,-P*5.0/16.0 ) pc3 = (r-H*17.0/24.0,0.0, -P*7.0/16.0 ) # Center of Arc pc4 = (r-H*5.0/8.0,0.0, -P*9.0/16.0 ) pc5 = (r+ H/16.0, 0.0, -P*29.0/32.0 ) edgec0 = Part.makeLine(pc5,pc1) edgec1 = Part.makeLine(pc1,pc2) edgec2 = Part.Arc(FreeCAD.Vector(pc2),FreeCAD.Vector(pc3),FreeCAD.Vector(pc4)).toShape() edgec3 = Part.makeLine(pc4,pc5) cut_profile = Part.Wire([edgec1, edgec2, edgec3, edgec0 ]) alpha_rad = math.atan(2*H*17.0/24.0/P) alpha = math.degrees(alpha_rad) Hyp = P/math.cos(alpha_rad) # tuning = 511/1000.0 tuning = self.Tuner/1000.0 angled_Helix = Part.makeHelix(Hyp,Hyp*1.002/2.0,d*tuning,alpha) SH_faces = [] if halfturn: half_Helix = Part.makeHelix(P,P/2.0,d*self.Tuner/1000.0,0) # make just half a turn angled_Helix.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),180) angled_Helix.translate(FreeCAD.Vector(0.0, 0.0,P/2.0)) # Part.show(half_Helix) # Part.show(angled_Helix) pipe_cut = Part.Wire([half_Helix, angled_Helix]).makePipeShell([cut_profile],True,isFrenet) SH_faces.append(pipe_cut.Faces[0]) SH_faces.append(pipe_cut.Faces[1]) SH_faces.append(pipe_cut.Faces[2]) SH_faces.append(pipe_cut.Faces[4]) SH_faces.append(pipe_cut.Faces[5]) SH_faces.append(pipe_cut.Faces[6]) else: pipe_cut = Part.Wire(angled_Helix).makePipeShell([cut_profile],True,isFrenet) SH_faces.append(pipe_cut.Faces[0]) SH_faces.append(pipe_cut.Faces[1]) SH_faces.append(pipe_cut.Faces[2]) # Part.show(pipe_cut) Shell_helix = Part.Shell(SH_faces) # rect_helix_profile, needed for cutting a tube-shell pr1 = (r +H/16.0, 0.0, 0.0) pr2 = (r -H/16.0, 0.0, 0.0) pr3 = (r -H/16.0, 0.0, P) pr4 = (r +H/16.0, 0.0, P) edge_r1 = Part.makeLine(pr1,pr2) edge_r2 = Part.makeLine(pr2,pr3) edge_r3 = Part.makeLine(pr3,pr4) edge_r4 = Part.makeLine(pr4,pr1) rect_profile = Part.Wire([edge_r1, edge_r2, edge_r3, edge_r4 ]) rect_helix = Part.Wire(helix).makePipeShell([rect_profile], True, isFrenet) # if halfturn: # rect_helix.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),180) rect_helix.translate(FreeCAD.Vector(0.0, 0.0,- P)) # Part.show(rect_helix) # rect_ring, nedded for cutting the Shell_helix pr5 = (r +H*1.1, 0.0, P*1.1) pr6 = (r, 0.0, P*1.1) pr7 = (r, 0.0, -P*1.1) pr8 = (r +H*1.1, 0.0, -P*1.1) edge_r5 = Part.makeLine(pr5,pr6) edge_r6 = Part.makeLine(pr6,pr7) edge_r7 = Part.makeLine(pr7,pr8) edge_r8 = Part.makeLine(pr8,pr5) rect_profile = Part.Wire([edge_r5, edge_r6, edge_r7, edge_r8 ]) rect_Face =Part.Face(rect_profile) rect_ring= rect_Face.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(rect_ring) Shell_helix = Shell_helix.cut(rect_ring) Shell_helix.translate(FreeCAD.Vector(0.0, 0.0, P)) # Part.show(Shell_helix) # shell_ring, the transition to a cylinder pr9 = (r, 0.0, P-offSet) pr10 = (r, 0.0, -P ) edge_r9 = Part.makeLine(pr9,pr10) shell_ring= edge_r9.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) shell_ring = shell_ring.cut(pipe_cut) #Part.show(shell_ring) shell_ring = shell_ring.cut(rect_helix) shell_ring.translate(FreeCAD.Vector(0.0, 0.0, P)) #Part.show(shell_ring) for flaeche in shell_ring.Faces: TheFaces.append(flaeche) for flaeche in Shell_helix.Faces: TheFaces.append(flaeche) if withcham: #FreeCAD.Console.PrintMessage("with chamfer: " + str(i) + "\n") # cutting of the bottom Faces # bot_off = 0.0 # nominal length cham_off = H/8.0 cham_t = P*math.sqrt(3.0)/2.0*17.0/24.0 # points for chamfer: common-Method pch0 = (0.0, 0.0, -(rotations)*P + bot_off) # bottom center pch1 = (r-cham_t,0.0, -(rotations)*P + bot_off) pch2 = (r+cham_off, 0.0, -(rotations)*P + cham_t +cham_off + bot_off) pch3 = (r+cham_off, 0.0, -(rotations)*P + 3.0*P + bot_off) pch4 = (0.0, 0.0, -(rotations)*P + 3.0*P + bot_off) edgech0 = Part.makeLine(pch0,pch1) edgech1 = Part.makeLine(pch1,pch2) edgech2 = Part.makeLine(pch2,pch3) edgech3 = Part.makeLine(pch3,pch4) edgech4 = Part.makeLine(pch4,pch0) Wch_wire = Part.Wire([edgech0, edgech1, edgech2, edgech3, edgech4]) cham_Face =Part.Face(Wch_wire) cham_Solid = cham_Face.revolve(Base.Vector(0.0,0.0,-(rotations-1)*P),Base.Vector(0.0,0.0,1.0),360) # Part.show(cham_Solid) BotShell = Part.Shell(botFaces) BotShell = BotShell.common(cham_Solid) # Part.show(BotShell) cham_faces = [] cham_faces.append(cham_Solid.Faces[0]) cham_faces.append(cham_Solid.Faces[1]) cham_Shell = Part.Shell(cham_faces) # Part.show(cham_Shell) pipe0.translate(FreeCAD.Vector(0.0, 0.0, -(rotations-1)*P)) # Part.show(pipe0) # Part.show(Fillet_shell) cham_Shell = cham_Shell.cut(pipe0) pipe0.translate(FreeCAD.Vector(0.0, 0.0, -P)) # Part.show(pipe0) cham_Shell = cham_Shell.cut(pipe0) ''' botFaces2 = [] for flaeche in BotShell.Faces: botFaces2.append(flaeche) for flaeche in cham_Shell.Faces: botFaces2.append(flaeche) ''' else: # tip of screw without chamfer #FreeCAD.Console.PrintMessage("without chamfer: " + str(i) + "\n") commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 3.0*P) commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations)*P+bot_off)) #commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations+3)*P+bot_off)) #Part.show(commonbox) BotShell = Part.Shell(botFaces) #Part.show(BotShell) BotShell = BotShell.common(commonbox) #BotShell = BotShell.cut(commonbox) bot_edges =[] bot_z = 1.0e-5 -(rotations)*P + bot_off for kante in BotShell.Edges: if (kante.Vertexes[0].Point.z<=bot_z) and (kante.Vertexes[1].Point.z<=bot_z): bot_edges.append(kante) # Part.show(kante) bot_wire = Part.Wire(Part.__sortEdges__(bot_edges)) #botFaces2 = [] #for flaeche in BotShell.Faces: # botFaces2.append(flaeche) bot_face = Part.Face(bot_wire) bot_face.reverse() #botFaces2.append(bot_face) ''' BotShell2 = Part.Shell(botFaces2) # Part.show(BotShell2) TheShell2 = Part.Shell(TheFaces) # This gives a shell FaceList = [] for flaeche in TheShell2.Faces: FaceList.append(flaeche) for flaeche in BotShell2.Faces: FaceList.append(flaeche) TheShell = Part.Shell(FaceList) # Part.show(TheShell) ''' for flaeche in BotShell.Faces: TheFaces.append(flaeche) if withcham: for flaeche in cham_Shell.Faces: TheFaces.append(flaeche) else: TheFaces.append(bot_face) TheShell = Part.Shell(TheFaces) #print self.Tuner, " ", TheShell.ShapeType, " ", TheShell.isValid(), " hrots: ", halfrots_int, " Shellpunkte: ", len(TheShell.Vertexes) return TheShell # if da<>None: make Shell for a nut else: make a screw tap def makeInnerThread_2(self, d, P, rotations, da, l): d = float(d) bot_off = 0.0 # nominal length H=P*math.cos(math.radians(30)) # Gewindetiefe H r=d/2.0 helix = Part.makeHelix(P,P,d*self.Tuner/1000.0,0) # make just one turn, length is identical to pitch helix.translate(FreeCAD.Vector(0.0, 0.0,-P*9.0/16.0)) extra_rad = P # points for inner thread profile ps0 = (r,0.0, 0.0) ps1 = (r-H*5.0/8.0,0.0, -P*5.0/16.0) ps2 = (r-H*5.0/8.0,0.0, -P*9.0/16.0 ) ps3 = (r, 0.0, -P*14.0/16.0) ps4 = (r+H*1/24.0,0.0, -P*31.0/32.0) # Center of Arc ps5 = (r,0.0, -P) ps6 = (r+extra_rad,0.0, -P) ps7 = (r+extra_rad,0.0, 0.0) #ps6 = (r-extra_rad,0.0, -P) #ps7 = (r-extra_rad,0.0, 0.0) edge0 = Part.makeLine(ps0,ps1) edge1 = Part.makeLine(ps1,ps2) edge2 = Part.makeLine(ps2,ps3) edge3 = Part.Arc(FreeCAD.Vector(ps3),FreeCAD.Vector(ps4),FreeCAD.Vector(ps5)).toShape() edge4 = Part.makeLine(ps5,ps6) edge5 = Part.makeLine(ps6,ps7) edge6 = Part.makeLine(ps7,ps0) W0 = Part.Wire([edge0, edge1, edge2, edge3, edge4, edge5, edge6]) # Part.show(W0) makeSolid=True isFrenet=True pipe0 = Part.Wire(helix).makePipeShell([W0],makeSolid,isFrenet) # pipe1 = pipe0.copy() TheFaces = [] TheFaces.append(pipe0.Faces[0]) TheFaces.append(pipe0.Faces[1]) TheFaces.append(pipe0.Faces[2]) TheFaces.append(pipe0.Faces[3]) TheShell = Part.Shell(TheFaces) # print "Shellpoints: ", len(TheShell.Vertexes) # Handling of the top faces if da <> None: TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P)) for flaeche in TheShell.Faces: TheFaces.append(flaeche) TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P)) for flaeche in TheShell.Faces: TheFaces.append(flaeche) cham_i_delta = da/2.0 - (r-H) cham_i = cham_i_delta * math.tan(math.radians(15.0)) offSet = rotations*P - l #FreeCAD.Console.PrintMessage("Der Offset: " + str(offSet/P) + "\n") # points for chamfer: common-Method pch0 = (da/2.0-cham_i_delta, 0.0, -cham_i - offSet) # bottom chamfer pch1 = (da/2.0, 0.0, 0.0 - offSet) # pch2 = (da/2.0, 0.0, -4.0*P - offSet) pch3 = (da/2.0-cham_i_delta, 0.0, -4.0*P - offSet) edgech0 = Part.makeLine(pch0,pch1) edgech1 = Part.makeLine(pch1,pch2) edgech2 = Part.makeLine(pch2,pch3) edgech3 = Part.makeLine(pch3,pch0) Wch_wire = Part.Wire([edgech0, edgech1, edgech2, edgech3]) cham_Face =Part.Face(Wch_wire) cham_Solid = cham_Face.revolve(Base.Vector(0.0,0.0,-(rotations-1)*P),Base.Vector(0.0,0.0,1.0),360) #Part.show(cham_Solid) #Part.show(Wch_wire) rawTopShell = Part.Shell(TheFaces) topShell = rawTopShell.common(cham_Solid) # Making a Cutter for the cham face commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 2.0*P) commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-2.0*P)) #Part.show(commonbox) cutterShell = rawTopShell.common(commonbox) bot_edges =[] bot_z = 1.0e-5 -2.0*P for kante in cutterShell.Edges: if (kante.Vertexes[0].Point.z<=bot_z) and (kante.Vertexes[1].Point.z<=bot_z): bot_edges.append(kante) # Part.show(kante) bot_wire = Part.Wire(Part.__sortEdges__(bot_edges)) bot_face = Part.Face(bot_wire) bot_face.reverse() t_face = bot_face.copy() t_face.translate(Base.Vector(0.0, 0.0, 2.0*P)) cutterFaces = cutterShell.Faces cutterFaces.append(bot_face.Faces[0]) cutterFaces.append(t_face.Faces[0]) cutShell = Part.Shell(cutterFaces) chamFcutter = Part.Solid(cutShell) #Part.show(chamFcutter) topCham = cham_Solid.Faces[0] topCham = topCham.cut(chamFcutter) #Part.show(topCham) TheFaces = [topCham.Faces[0]] TheFaces.extend(topShell.Faces) for i in range(rotations-4): TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P)) for flaeche in TheShell.Faces: TheFaces.append(flaeche) else: commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 3.0*P) commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(3.0)*P)) topShell = TheShell.common(commonbox) top_edges =[] top_z = -1.0e-5 for kante in topShell.Edges: if (kante.Vertexes[0].Point.z>=top_z) and (kante.Vertexes[1].Point.z>=top_z): top_edges.append(kante) # Part.show(kante) top_wire = Part.Wire(Part.__sortEdges__(top_edges)) top_face = Part.Face(top_wire) TheFaces = [top_face.Faces[0]] TheFaces.extend(topShell.Faces) for i in range(rotations-2): TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P)) for flaeche in TheShell.Faces: TheFaces.append(flaeche) #FreeCAD.Console.PrintMessage("Base-Shell: " + str(i) + "\n") # Make separate faces for the tip of the screw botFaces = [] for i in range(rotations-2, rotations, 1): TheShell.translate(FreeCAD.Vector(0.0, 0.0,- P)) for flaeche in TheShell.Faces: botFaces.append(flaeche) #FreeCAD.Console.PrintMessage("Bottom-Shell: " + str(i) + "\n") if da <> None: # points for chamfer: common-Method pch0 = (da/2.0-cham_i_delta, 0.0, -(rotations)*P + cham_i) # bottom chamfer pch1 = (da/2.0, 0.0, -(rotations)*P) # pch2 = (da/2.0, 0.0, -(rotations)*P + 3.0*P) pch3 = (da/2.0-cham_i_delta, 0.0, -(rotations)*P + 3.0*P) #pch4 = (r-2.0*cham_i_delta, 0.0, -(rotations)*P + 3.0*P) edgech0 = Part.makeLine(pch0,pch1) edgech1 = Part.makeLine(pch1,pch2) edgech2 = Part.makeLine(pch2,pch3) edgech3 = Part.makeLine(pch3,pch0) Wch_wire = Part.Wire([edgech0, edgech1, edgech2, edgech3]) cham_Face =Part.Face(Wch_wire) cham_Solid = cham_Face.revolve(Base.Vector(0.0,0.0,-(rotations-1)*P),Base.Vector(0.0,0.0,1.0),360) #Part.show(cham_Solid) #Part.show(Wch_wire) BotShell = Part.Shell(botFaces) #Part.show(BotShell) chamFcutter.translate(FreeCAD.Vector(0.0, 0.0,-(rotations-1)*P)) #Part.show(chamFcutter) BotShell = BotShell.common(cham_Solid) #Part.show(BotShell) cham_face = cham_Solid.Faces[0] cham_face = cham_face.cut(chamFcutter) #Part.show(cham_face) for flaeche in BotShell.Faces: TheFaces.append(flaeche) if da <> None: TheFaces.append(cham_face.Faces[0]) else: TheFaces.append(bot_face) TheShell = Part.Shell(TheFaces) #print self.Tuner, " ", TheShell.ShapeType, " ", TheShell.isValid(), " hrots: ", halfrots_int, " Shellpunkte: ", len(TheShell.Vertexes) return TheShell else: # make of screw tap #FreeCAD.Console.PrintMessage("without chamfer: " + str(i) + "\n") commonbox = Part.makeBox(d+4.0*P, d+4.0*P, 3.0*P) commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations)*P+bot_off)) #commonbox.translate(FreeCAD.Vector(-(d+4.0*P)/2.0, -(d+4.0*P)/2.0,-(rotations+3)*P+bot_off)) #Part.show(commonbox) BotShell = Part.Shell(botFaces) #Part.show(BotShell) BotShell = BotShell.common(commonbox) #BotShell = BotShell.cut(commonbox) bot_edges =[] bot_z = 1.0e-5 -(rotations)*P + bot_off for kante in BotShell.Edges: if (kante.Vertexes[0].Point.z<=bot_z) and (kante.Vertexes[1].Point.z<=bot_z): bot_edges.append(kante) # Part.show(kante) bot_wire = Part.Wire(Part.__sortEdges__(bot_edges)) bot_face = Part.Face(bot_wire) bot_face.reverse() for flaeche in BotShell.Faces: TheFaces.append(flaeche) if da <> None: for flaeche in cham_Shell.Faces: TheFaces.append(flaeche) else: TheFaces.append(bot_face) TheShell = Part.Shell(TheFaces) TheSolid = Part.Solid(TheShell) #print self.Tuner, " ", TheShell.ShapeType, " ", TheShell.isValid(), " hrots: ", halfrots_int, " Shellpunkte: ", len(TheShell.Vertexes) return TheSolid # make the ISO 4032 Hex-nut # make the ISO 4033 Hex-nut def makeIso4032(self,SType ='ISO4032', ThreadType ='M6'): dia = self.getDia(ThreadType) if SType == 'ISO4032': # P, c, damax, dw, e, m, mw, s_nom P, c, da, dw, e, m, mw, s = iso4032def[ThreadType] if SType == 'ISO4033': # P, c, damax, dw, e, m, mw, s_nom P, c, da, dw, e, m, mw, s = iso4033def[ThreadType] if SType == 'ISO4035': # P, c, damax, dw, e, m, mw, s_nom P, c, da, dw, e, m, mw, s = iso4035def[ThreadType] residue, turns = math.modf(m/P) #halfturns = 2*int(turns) if residue > 0.0: turns += 1.0 #halfturns = halfturns +2 #offSet = r - a sqrt2_ = 1.0/math.sqrt(2.0) cham = (e-s)*math.sin(math.radians(15)) # needed for chamfer at nut top H=P*math.cos(math.radians(30)) # Gewindetiefe H cham_i_delta = da/2.0 - (dia/2.0-H*5.0/8.0) cham_i = cham_i_delta * math.tan(math.radians(15.0)) if self.rThread: Pnt0 = Base.Vector(da/2.0-2.0*cham_i_delta,0.0,m - 2.0*cham_i) Pnt7 = Base.Vector(da/2.0-2.0*cham_i_delta,0.0,0.0+ 2.0*cham_i) else: Pnt0 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,m - cham_i) Pnt7 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,0.0+ cham_i) Pnt1 = Base.Vector(da/2.0,0.0,m) Pnt2 = Base.Vector(s/2.0,0.0,m) Pnt3 = Base.Vector(s/math.sqrt(3.0),0.0,m-cham) Pnt4 = Base.Vector(s/math.sqrt(3.0),0.0,cham) Pnt5 = Base.Vector(s/2.0,0.0,0.0) Pnt6 = Base.Vector(da/2.0,0.0,0.0) edge0 = Part.makeLine(Pnt0,Pnt1) edge1 = Part.makeLine(Pnt1,Pnt2) edge2 = Part.makeLine(Pnt2,Pnt3) edge3 = Part.makeLine(Pnt3,Pnt4) edge4 = Part.makeLine(Pnt4,Pnt5) edge5 = Part.makeLine(Pnt5,Pnt6) edge6 = Part.makeLine(Pnt6,Pnt7) edge7 = Part.makeLine(Pnt7,Pnt0) # create cutting tool for hexagon head # Parameters s, k, outer circle diameter = e/2.0+10.0 extrude = self.makeHextool(s, m, s*2.0) aWire=Part.Wire([edge0,edge1,edge2,edge3,edge4,edge5,edge6,edge7]) #Part.show(aWire) aFace =Part.Face(aWire) head = aFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0) #Part.show(head) #Part.show(extrude) nut = head.cut(extrude) # Part.show(nut) if self.rThread: ''' threadCutter = self.makeInnerThread(dia, P, int(turns), None, m) # Part.show(threadCutter) threadCutter.translate(Base.Vector(0.0, 0.0,turns*P)) nut = nut.cut(threadCutter) ''' nutFaces = [nut.Faces[2]] for i in range(4,25): nutFaces.append(nut.Faces[i]) threadShell = self.makeInnerThread_2(dia, P, int(turns), da, m) threadShell.translate(Base.Vector(0.0, 0.0,turns*P)) #Part.show(threadShell) nutFaces.extend(threadShell.Faces) nutShell = Part.Shell(nutFaces) nut = Part.Solid(nutShell) #Part.show(nutShell) return nut # EN 1661 Hexagon nuts with flange # chamfer at top of hexagon is wrong = more than 30° def makeEN1661(self, ThreadType ='M8'): dia = self.getDia(ThreadType) P, da, c, dc, dw, e, m, mw, r1, s = en1661def[ThreadType] residue, turns = math.modf(m/P) #halfturns = 2*int(turns) if residue > 0.0: turns += 1.0 #FreeCAD.Console.PrintMessage("the nut with isoEN1661: " + str(c) + "\n") cham = s*(2.0/math.sqrt(3.0)-1.0)*math.sin(math.radians(25)) # needed for chamfer at head top sqrt2_ = 1.0/math.sqrt(2.0) # Flange is made with a radius of c beta = math.radians(25.0) tan_beta = math.tan(beta) # Calculation of Arc points of flange edge using dc and c arc1_x = dc/2.0 - c/2.0 + (c/2.0)*math.sin(beta) 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 #kmean = k * 0.95 #Hex-Head Points #FreeCAD.Console.PrintMessage("the nut with kmean: " + str(m) + "\n") PntH0 = Base.Vector(da/2.0,0.0,m) PntH1 = Base.Vector(s/2.0,0.0,m) edgeH1 = Part.makeLine(PntH0,PntH1) hWire=Part.Wire([edgeH1]) topShell = hWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(hWire) #Part.show(topShell) # create a cutter ring to generate the chamfer at the top of the hex chamHori = s/math.sqrt(3.0) - s/2.0 PntC1 = Base.Vector(s/2.0-chamHori,0.0,m+m) PntC2 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,m+m) PntC3 = Base.Vector(s/2.0-chamHori,0.0,m+cham) PntC4 = Base.Vector(s/math.sqrt(3.0)+chamHori,0.0,m-cham-cham) #s/math.sqrt(3.0) edgeC1 = Part.makeLine(PntC3, PntC1) edgeC2 = Part.makeLine(PntC1, PntC2) edgeC3 = Part.makeLine(PntC2, PntC4) edgeC4 = Part.makeLine(PntC4, PntC3) cWire = Part.Wire([edgeC4, edgeC1, edgeC2, edgeC3]) cFace = Part.Face(cWire) chamCut = cFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #Part.show(cWire) #Part.show(chamCut) # create hexagon mhex=Base.Matrix() mhex.rotateZ(math.radians(60.0)) polygon = [] vhex=Base.Vector(s/math.sqrt(3.0),0.0,m) for i in range(6): polygon.append(vhex) vhex = mhex.multiply(vhex) polygon.append(vhex) hexagon = Part.makePolygon(polygon) hexFace = Part.Face(hexagon) solidHex = hexFace.extrude(Base.Vector(0.0,0.0,c-m)) #Part.show(solidHex) hexCham = solidHex.cut(chamCut) #Part.show(hexCham) topFaces = topShell.Faces topFaces.append(hexCham.Faces[1]) topFaces.append(hexCham.Faces[2]) topFaces.append(hexCham.Faces[8]) topFaces.append(hexCham.Faces[13]) topFaces.append(hexCham.Faces[14]) topFaces.append(hexCham.Faces[12]) topFaces.append(hexCham.Faces[6]) hexFaces = [hexCham.Faces[5], hexCham.Faces[11], hexCham.Faces[10]] hexFaces.extend([hexCham.Faces[9], hexCham.Faces[3], hexCham.Faces[0]]) hexShell = Part.Shell(hexFaces) H=P*math.cos(math.radians(30)) # Gewindetiefe H cham_i_delta = da/2.0 - (dia/2.0-H*5.0/8.0) cham_i = cham_i_delta * math.tan(math.radians(15.0)) # Center of flange: Pnt0 = Base.Vector(0.0,0.0,hF) Pnt1 = Base.Vector(s/2.0,0.0,hF) # arc edge of flange: Pnt2 = Base.Vector(arc1_x,0.0,arc1_z) Pnt3 = Base.Vector(dc/2.0,0.0,c/2.0) Pnt4 = Base.Vector((dc-c)/2.0,0.0,0.0) Pnt5 = Base.Vector(da/2.0,0.0,0.0) #start of fillet between flat and thread edge1 = Part.makeLine(Pnt0,Pnt1) edge2 = Part.makeLine(Pnt1,Pnt2) edge3 = Part.Arc(Pnt2,Pnt3,Pnt4).toShape() edge4 = Part.makeLine(Pnt4,Pnt5) # make a cutter for the hexShell PntHC1 = Base.Vector(0.0,0.0,arc1_z) PntHC2 = Base.Vector(0.0,0.0,0.0) edgeHC1 = Part.makeLine(Pnt2,PntHC1) edgeHC2 = Part.makeLine(PntHC1,PntHC2) edgeHC3 = Part.makeLine(PntHC2,Pnt0) HCWire = Part.Wire([edge2, edgeHC1, edgeHC2, edgeHC3, edge1]) HCFace = Part.Face(HCWire) hex2Cut = HCFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) hexShell = hexShell.cut(hex2Cut) #Part.show(hexShell) topFaces.extend(hexShell.Faces) if self.rThread: aWire=Part.Wire([edge2,edge3,edge4]) boltIndex = 3 else: Pnt7 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,m - cham_i) Pnt6 = Base.Vector(dia/2.0-H*5.0/8.0,0.0,0.0+ cham_i) edge5 = Part.makeLine(Pnt5,Pnt6) edge6 = Part.makeLine(Pnt6,Pnt7) edge7 = Part.makeLine(Pnt7,PntH0) aWire=Part.Wire([edge2,edge3,edge4,edge5,edge6,edge7]) boltIndex = 6 #aFace =Part.Face(aWire) #Part.show(aWire) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) #FreeCAD.Console.PrintMessage("der Kopf mit revolve: " + str(dia) + "\n") #Part.show(headShell) chamFace = headShell.Faces[0].cut(solidHex) #Part.show(chamFace) topFaces.append(chamFace.Faces[0]) for i in range(1,boltIndex): topFaces.append(headShell.Faces[i]) if self.rThread: #rthread = self.makeShellthread(dia, P, halfturns, True, offSet) #rthread.translate(Base.Vector(0.0, 0.0,-a_point-2.0*P)) threadShell = self.makeInnerThread_2(dia, P, int(turns), da, m) threadShell.translate(Base.Vector(0.0, 0.0,turns*P)) #Part.show(threadShell) for tFace in threadShell.Faces: topFaces.append(tFace) headShell = Part.Shell(topFaces) screw = Part.Solid(headShell) else: screwShell = Part.Shell(topFaces) screw = Part.Solid(screwShell) return screw # make ISO 7380-1 Button head Screw # make ISO 7380-2 Button head Screw with collar # make DIN 967 cross recessed pan head Screw with collar def makeScrewTap(self, ThreadType ='M6',l=25.0): dia = self.getDia(ThreadType) P, tunIn, tunEx = tuningTable[ThreadType] residue, turns = math.modf((l)/P) turns += 1.0 #FreeCAD.Console.PrintMessage("ScrewTap residue: " + str(residue) + " turns: " + str(turns) + "\n") if self.rThread: screwTap = self.makeInnerThread_2(dia, P, int(turns), None, 0.0) screwTap.translate(Base.Vector(0.0, 0.0,(1-residue)*P)) else: H=P*math.cos(math.radians(30)) # Gewindetiefe H r=dia/2.0 # points for inner thread profile Pnt0 = Base.Vector(0.0,0.0,(1-residue)*P) Pnt1 = Base.Vector(r-H*5.0/8.0,0.0,(1-residue)*P) Pnt2 = Base.Vector(r-H*5.0/8.0,0.0,-l) Pnt3 = Base.Vector(0.0,0.0,-l) edge1 = Part.makeLine(Pnt0,Pnt1) edge2 = Part.makeLine(Pnt1,Pnt2) edge3 = Part.makeLine(Pnt2,Pnt3) aWire=Part.Wire([edge1,edge2,edge3]) headShell = aWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360.0) screwTap = Part.Solid(headShell) return screwTap def cutChamfer(self, dia_cC, P_cC, l_cC): cham_t = P_cC*math.sqrt(3.0)/2.0*17.0/24.0 PntC0 = Base.Vector(0.0,0.0,-l_cC) PntC1 = Base.Vector(dia_cC/2.0-cham_t,0.0,-l_cC) PntC2 = Base.Vector(dia_cC/2.0+cham_t,0.0,-l_cC+cham_t+cham_t) PntC3 = Base.Vector(dia_cC/2.0+cham_t,0.0,-l_cC-P_cC-cham_t) PntC4 = Base.Vector(0.0,0.0,-l_cC-P_cC-cham_t) edgeC1 = Part.makeLine(PntC0,PntC1) edgeC2 = Part.makeLine(PntC1,PntC2) edgeC3 = Part.makeLine(PntC2,PntC3) edgeC4 = Part.makeLine(PntC3,PntC4) edgeC5 = Part.makeLine(PntC4,PntC0) CWire=Part.Wire([edgeC1,edgeC2,edgeC3,edgeC4,edgeC5]) #Part.show(CWire) CFace =Part.Face(CWire) cyl = CFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) return cyl # cross recess type H def makeCross_H3(self, CrossType = '2', m = 6.9, h = 0.0): # m = diameter of cross at top of screw at reference level for penetration depth b, e_mean, g, f_mean, r, t1, alpha, beta = iso4757def[CrossType] rad265 = math.radians(26.5) rad28 = math.radians(28.0) tg = (m-g)/2.0/math.tan(rad265) # depth at radius of g t_tot = tg + g/2.0 * math.tan(rad28) # total depth # print 'tg: ', tg,' t_tot: ', t_tot hm = m / 4.0 hmc = m / 2.0 rmax = m / 2.0 + hm*math.tan(rad265) Pnt0 = Base.Vector(0.0,0.0,hm) Pnt1 = Base.Vector(rmax,0.0,hm) Pnt3 = Base.Vector(0.0,0.0,0.0) Pnt4 = Base.Vector(g/2.0,0.0,-tg) Pnt5 = Base.Vector(0.0,0.0,-t_tot) edge1 = Part.makeLine(Pnt0,Pnt1) edge3 = Part.makeLine(Pnt1,Pnt4) edge4 = Part.makeLine(Pnt4,Pnt5) # FreeCAD.Console.PrintMessage("Edges made Pnt2: " + str(Pnt2) + "\n") aWire=Part.Wire([edge1,edge3,edge4]) crossShell = aWire.revolve(Pnt3,Base.Vector(0.0,0.0,1.0),360) # FreeCAD.Console.PrintMessage("Peak-wire revolved: " + str(e_mean) + "\n") cross = Part.Solid(crossShell) #Part.show(cross) # the need to cut 4 corners out of the above shape. # Definition of corner # The angles 92 degrees and alpha are defined on a plane which has # an angle of beta against our coordinate system. # The projected angles are needed for easier calculation! rad_alpha = math.radians(alpha/2.0) rad92 = math.radians(92.0/2.0) rad_beta = math.radians(beta) rad_alpha_p = math.atan(math.tan(rad_alpha)/math.cos(rad_beta)) rad92_p = math.atan(math.tan(rad92)/math.cos(rad_beta)) tb = tg + (g-b)/2.0 * math.tan(rad28) # depth at dimension b rbtop = b/2.0 + (hmc + tb)*math.tan(rad_beta) # radius of b-corner at hm rbtot = b/2.0 - (t_tot - tb)*math.tan(rad_beta) # radius of b-corner at t_tot dre = e_mean/2.0 / math.tan(rad_alpha_p) # delta between corner b and corner e in x direction #FreeCAD.Console.PrintMessage("delta calculated: " + str(dre) + "\n") dx = m/2.0 * math.cos(rad92_p) dy = m/2.0 * math.sin(rad92_p) PntC0 = Base.Vector(rbtop,0.0,hmc) PntC1 = Base.Vector(rbtot,0.0,-t_tot) PntC2 = Base.Vector(rbtop+dre,+e_mean/2.0,hmc) PntC3 = Base.Vector(rbtot+dre,+e_mean/2.0,-t_tot) PntC4 = Base.Vector(rbtop+dre,-e_mean/2.0,hmc) PntC5 = Base.Vector(rbtot+dre,-e_mean/2.0,-t_tot) PntC6 = Base.Vector(rbtop+dre+dx,+e_mean/2.0+dy,hmc) #PntC7 = Base.Vector(rbtot+dre+dx,+e_mean/2.0+dy,-t_tot) PntC7 = Base.Vector(rbtot+dre+2.0*dx,+e_mean+2.0*dy,-t_tot) PntC8 = Base.Vector(rbtop+dre+dx,-e_mean/2.0-dy,hmc) #PntC9 = Base.Vector(rbtot+dre+dx,-e_mean/2.0-dy,-t_tot) PntC9 = Base.Vector(rbtot+dre+2.0*dx,-e_mean-2.0*dy,-t_tot) #wire_hm = Part.makePolygon([PntC0,PntC2,PntC6,PntC8,PntC4,PntC0]) #face_hm =Part.Face(wire_hm) #Part.show(face_hm) wire_t_tot = Part.makePolygon([PntC1,PntC3,PntC7,PntC9,PntC5,PntC1]) # Part.show(wire_t_tot) edgeC1 = Part.makeLine(PntC0,PntC1) #FreeCAD.Console.PrintMessage("edgeC1 mit PntC9" + str(PntC9) + "\n") makeSolid=True isFrenet=False corner = Part.Wire(edgeC1).makePipeShell([wire_t_tot],makeSolid,isFrenet) #Part.show(corner) rot_axis = Base.Vector(0.,0.,1.0) sin_res = math.sin(math.radians(90)/2.0) cos_res = math.cos(math.radians(90)/2.0) rot_axis.multiply(-sin_res) # Calculation of Quaternion-Elements #FreeCAD.Console.PrintMessage("Quaternion-Elements" + str(cos_res) + "\n") pl_rot = FreeCAD.Placement() pl_rot.Rotation = (rot_axis.x,rot_axis.y,rot_axis.z,cos_res) #Rotation-Quaternion 90° z-Axis crossShell = crossShell.cut(corner) #Part.show(crossShell) cutplace = corner.Placement cornerFaces = [] cornerFaces.append(corner.Faces[0]) cornerFaces.append(corner.Faces[1]) cornerFaces.append(corner.Faces[3]) cornerFaces.append(corner.Faces[4]) cornerShell = Part.Shell(cornerFaces) cornerShell = cornerShell.common(cross) addPlace = cornerShell.Placement crossFaces = cornerShell.Faces for i in range(3): cutplace.Rotation = pl_rot.Rotation.multiply(corner.Placement.Rotation) crossShell = crossShell.cut(corner) addPlace.Rotation = pl_rot.Rotation.multiply(cornerShell.Placement.Rotation) for coFace in cornerShell.Faces: crossFaces.append(coFace) #Part.show(crossShell) for i in range(1,6): crossFaces.append(crossShell.Faces[i]) crossShell0 = Part.Shell(crossFaces) crossFaces.append(crossShell.Faces[0]) crossShell = Part.Shell(crossFaces) cross = Part.Solid(crossShell) #FreeCAD.Console.PrintMessage("Placement: " + str(pl_rot) + "\n") cross.Placement.Base = Base.Vector(0.0,0.0,h) crossShell0.Placement.Base = Base.Vector(0.0,0.0,h) #Part.show(crossShell0) #Part.show(cross) return cross, crossShell0 # Allen recess cutting tool # Parameters used: s_mean, k, t_min, dk def makeAllen2(self, s_a = 3.0, t_a = 1.5, h_a = 2.0 ): # h_a top height location of cutting tool # s_a hex width # t_a dept of the allen # dk_a diameter not needed anymore e_cham = 2.0 * s_a / math.sqrt(3.0) depth = s_a / 3.0 #FreeCAD.Console.PrintMessage("allen tool: " + str(s_a) + "\n") # Points for an arc at the peak of the cone rCone = e_cham/4.0 hyp = (depth*math.sqrt(e_cham**2/depth**2+1.0)*rCone)/e_cham radAlpha = math.atan(e_cham/depth) radBeta = math.pi/2.0 - radAlpha zrConeCenter=hyp - depth -t_a xArc1=math.sin(radBeta)*rCone zArc1=zrConeCenter - math.cos(radBeta)*rCone xArc2=math.sin(radBeta/2.0)*rCone zArc2=zrConeCenter - math.cos(radBeta/2.0)*rCone zArc3 = zrConeCenter - rCone # The round part of the cutting tool, we need for the allen hex recess PntH1 = Base.Vector(0.0,0.0,-t_a-depth-depth) PntH2 = Base.Vector(e_cham,0.0,-t_a-depth-depth) PntH3 = Base.Vector(e_cham,0.0,-t_a+depth) PntH4 = Base.Vector(0.0,0.0,-t_a-depth) PntA1 = Base.Vector(xArc1,0.0,zArc1) PntA2 = Base.Vector(xArc2,0.0,zArc2) PntA3 = Base.Vector(0.0,0.0,zArc3) edgeA1 = Part.Arc(PntA1,PntA2,PntA3).toShape() edgeH1 = Part.makeLine(PntH1,PntH2) edgeH2 = Part.makeLine(PntH2,PntH3) edgeH3 = Part.makeLine(PntH3,PntA1) edgeH4 = Part.makeLine(PntA3,PntH1) hWire=Part.Wire([edgeH1,edgeH2,edgeH3,edgeA1,edgeH4]) # Part.show(hWire) hFace =Part.Face(hWire) roundtool = hFace.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) # create hexagon mhex=Base.Matrix() mhex.rotateZ(math.radians(60.0)) polygon = [] vhex=Base.Vector(s_a/math.sqrt(3.0),0.0,1.0) for i in range(6): polygon.append(vhex) vhex = mhex.multiply(vhex) polygon.append(vhex) hexagon = Part.makePolygon(polygon) hexFace = Part.Face(hexagon) solidHex = hexFace.extrude(Base.Vector(0.0,0.0,-1.0-t_a-depth*1.1)) allen = solidHex.cut(roundtool) #Part.show(allen) allenFaces = [allen.Faces[0]] for i in range(2,9): allenFaces.append(allen.Faces[i]) allenShell = Part.Shell(allenFaces) solidHex.Placement.Base = Base.Vector(0.0,0.0,h_a) allenShell.Placement.Base = Base.Vector(0.0,0.0,h_a) return solidHex, allenShell # ISO 10664 Hexalobular internal driving feature for bolts and screws def makeIso10664_3(self,RType ='T20',t_hl=3.0, h_hl = 0): # t_hl depth of the recess # h_hl top height location of Cutting tool A, B, Re = iso10664def[RType] sqrt_3 = math.sqrt(3.0) depth=A/4.0 offSet = 1.0 # Chamfer cutter for the hexalobular recess PntH1 = Base.Vector(0.0,0.0,-t_hl-depth-1.0) #PntH2 = Base.Vector(A/2.0*1.02,0.0,-t_hl-depth-1.0) #PntH3 = Base.Vector(A/2.0*1.02,0.0,-t_hl) PntH2 = Base.Vector(A,0.0,-t_hl-depth-1.0) PntH3 = Base.Vector(A,0.0,-t_hl+depth) PntH4 = Base.Vector(0.0,0.0,-t_hl-depth) # Points for an arc at the peak of the cone rCone = A/4.0 hyp = (depth*math.sqrt(A**2/depth**2+1.0)*rCone)/A radAlpha = math.atan(A/depth) radBeta = math.pi/2.0 - radAlpha zrConeCenter=hyp - depth -t_hl xArc1=math.sin(radBeta)*rCone zArc1=zrConeCenter - math.cos(radBeta)*rCone xArc2=math.sin(radBeta/2.0)*rCone zArc2=zrConeCenter - math.cos(radBeta/2.0)*rCone zArc3 = zrConeCenter - rCone PntA1 = Base.Vector(xArc1,0.0,zArc1) PntA2 = Base.Vector(xArc2,0.0,zArc2) PntA3 = Base.Vector(0.0,0.0,zArc3) edgeA1 = Part.Arc(PntA1,PntA2,PntA3).toShape() edgeH1 = Part.makeLine(PntH1,PntH2) edgeH2 = Part.makeLine(PntH2,PntH3) edgeH3 = Part.makeLine(PntH3,PntA1) edgeH4 = Part.makeLine(PntA3,PntH1) hWire=Part.Wire([edgeH1,edgeH2,edgeH3,edgeA1]) cutShell = hWire.revolve(Base.Vector(0.0,0.0,0.0),Base.Vector(0.0,0.0,1.0),360) cutTool = Part.Solid(cutShell) Ri = -((B+sqrt_3*(2.*Re-A))*B+(A-4.*Re)*A)/(4.*B-2.*sqrt_3*A+(4.*sqrt_3-8.)*Re) #print '2nd Ri last solution: ', Ri beta=math.acos(A/(4*Ri+4*Re)-(2*Re)/(4*Ri+4*Re))-math.pi/6 #print 'beta: ', beta Rh=(sqrt_3*(A/2.0-Re))/2.0 Re_x = A/2.0 - Re + Re*math.sin(beta) Re_y = Re*math.cos(beta) Ri_y = B/4.0 Ri_x = sqrt_3*B/4.0 mhex=Base.Matrix() mhex.rotateZ(math.radians(60.0)) hexlobWireList = [] PntRe0=Base.Vector(Re_x,-Re_y,offSet) PntRe1=Base.Vector(A/2.0,0.0,offSet) PntRe2=Base.Vector(Re_x,Re_y,offSet) edge0 = Part.Arc(PntRe0,PntRe1,PntRe2).toShape() #Part.show(edge0) hexlobWireList.append(edge0) PntRi = Base.Vector(Ri_x,Ri_y,offSet) PntRi2 = mhex.multiply(PntRe0) edge1 = Part.Arc(PntRe2,PntRi,PntRi2).toShape() #Part.show(edge1) hexlobWireList.append(edge1) for i in range(5): PntRe1 = mhex.multiply(PntRe1) PntRe2 = mhex.multiply(PntRe2) edge0 = Part.Arc(PntRi2,PntRe1,PntRe2).toShape() hexlobWireList.append(edge0) PntRi = mhex.multiply(PntRi) PntRi2 = mhex.multiply(PntRi2) if i == 5: edge1 = Part.Arc(PntRe2,PntRi,PntRe0).toShape() else: edge1 = Part.Arc(PntRe2,PntRi,PntRi2).toShape() hexlobWireList.append(edge1) hexlobWire=Part.Wire(hexlobWireList) #Part.show(hWire) face=Part.Face(hexlobWire) # Extrude in z to create the cutting tool for the screw-head-face Helo=face.extrude(Base.Vector(0.0,0.0,-t_hl-depth-offSet)) # Make the recess-shell for the screw-head-shell hexlob = Helo.cut(cutTool) #Part.show(hexlob) hexlobFaces = [hexlob.Faces[0]] for i in range(2,15): hexlobFaces.append(hexlob.Faces[i]) hexlobShell = Part.Shell(hexlobFaces) hexlobShell.Placement.Base = Base.Vector(0.0,0.0,h_hl) Helo.Placement.Base = Base.Vector(0.0,0.0,h_hl) return Helo, hexlobShell def setThreadType(self, TType = 'simple'): self.simpThread = False self.symThread = False self.rThread = False if TType == 'simple': self.simpThread = True if TType == 'symbol': self.symThread = True if TType == 'real': self.rThread = True def setTuner(self, myTuner = 511): self.Tuner = myTuner def getDia(self,ThreadType): if '(' in ThreadType: threadString = ThreadType.lstrip('(M') dia = float(threadString.rstrip(')')) else: dia=float(ThreadType.lstrip('M')) return dia class ScrewMacro(object): d = QtGui.QWidget() d.ui = Ui_ScrewMaker() d.ui.setupUi(d) if __name__ == '__main__': d.show() def main(): o = ScrewMacro() if __name__ == '__main__': main() }} ==Link== The forum [https://forum.freecadweb.org/viewtopic.php?f=22&t=6558&start=30#p95929 Screw Maker]