Jump to content
Toggle sidebar
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
Assembly
BIM/Arch
CAM/Path
Draft
FEM
Inspection
Material
Mesh
OpenSCAD
Part
PartDesign
Points
Reverse Engineering
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 Component
Arch CurtainWall
Arch CutLine
Arch CutPlane
Arch DAE
Arch Equipment
Arch Fence
Arch Floor
Arch Frame
Arch Grid
Arch IFC
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 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 Assembly
Artwork Assembly3
Artwork BIM
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 Surface
Artwork TechDraw
Artwork Test
Artwork Tux
Assembly
Assembly CreateAssembly
Assembly CreateBom
Assembly CreateJointAngle
Assembly CreateJointBall
Assembly CreateJointBelt
Assembly CreateJointCylindrical
Assembly CreateJointDistance
Assembly CreateJointFixed
Assembly CreateJointGears
Assembly CreateJointParallel
Assembly CreateJointPerpendicular
Assembly CreateJointRackPinion
Assembly CreateJointRevolute
Assembly CreateJointScrew
Assembly CreateJointSlider
Assembly CreateView
Assembly ExportASMT
Assembly InsertLink
Assembly SolveAssembly
Assembly ToggleGrounded
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 Beam
BIM Box
BIM Classification
BIM Clone
BIM Column
BIM Copy
BIM DimensionAligned
BIM DimensionHorizontal
BIM DimensionVertical
BIM Door
BIM IfcElements
BIM IfcExplorer
BIM IfcProperties
BIM IfcQuantities
BIM ingame tutorial
BIM Layers
BIM Leader
BIM Library
BIM Preferences
BIM Preflight
BIM ProjectManager
BIM Setup
BIM Shape2DView
BIM Sketch
BIM Slab
BIM TDPage
BIM TDView
BIM Text
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 ConstraintRigidBody
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
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 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
Material Workbench
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 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 Workbench
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 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 Measure
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
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 FillTemplateFields
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=Sheet Metal Unfolder |Icon=Macro_Sheet_Metal_Unfolder.png |Description=The macro can unfold simple sheet-metal-parts. The parts must have everywhere the same material thickness as typical for sheet-metal-parts. |Author=ulrich1a |Version=17.0 |Date=2018-08-14 |FCVersion=17.0 |Download=[https://www.freecadweb.org/wiki/images/1/16/Macro_Sheet_Metal_Unfolder.png ToolBar Icon] }} ==Description== The macro can unfold simple sheet-metal-parts. The parts must have everywhere the same material thickness as typical for sheet-metal-parts. See example: {{Codeextralink|https://raw.githubusercontent.com/ulrich1a/sheet_ufo/master/sheet_ufo.py}} [[File:Unfolding test2.png]] == Usage == Select a flat face from your part in the 3D-view. Start the macro. == Remarks == The macro creates a lot of text in the report-view. This is still a remains of the debugging process of this macro. The edges of the sheet-metal-part may be round or slanting. But if you "walk" from the upper side to the lower side of the sheet-metal-part you should not cross more than one face. In best case the macro generates a new flat solid from your part. If the macro has problems, you may get only a flat shell or a bunch of flattened faces or only an error message. The macro can be thought of as a companion to the AddWall tool from JMG published here: [http://linuxforanengineer.blogspot.com.es/2014/12/freecad-sheet-metal-tool-add-wall.html FreeCAD: Sheet metal tool "Add Wall"] ==Link== The forum discussion [http://forum.freecadweb.org/viewtopic.php?f=24&t=8789 Sheet metal: add wall tool] An updated version is available at: [https://github.com/ulrich1a/sheet_ufo https://github.com/ulrich1a/sheet_ufo] ==Script== ToolBar Icon [[Image:Macro_Sheet_Metal_Unfolder.png]] '''Sheet Metal Unfolder.py''' {{MacroCode|code= #!/usr/bin/env python # -*- coding: utf-8 -*- # # sheet_ufo.py # # Copyright 2014 Ulrich Brammer <ulrich@Pauline> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # # Refactored version December 2015 # Clear division of tasks between analysis and folding # To do: # change code to handle face indexes in the node instead of faces # sheet_ufo16.py # Die Weiterreichung eines schon geschnittenen Seitenfaces macht Probleme. # Die Seitenfaces passen hinterher nicht mehr mit den Hauptflächen zusammen. # Geänderter Ansatz: lasse die Seitenflächen in der Suchliste und # schneide jeweils nur den benötigten Teil raus. # Ich brauche jetzt eine Suchliste und eine Unfoldliste für die # Face-Indices. # To do: # - handle a selected seam # - handle not-circle-curves in bends # - detect features like welded screws # - make a view-provider for bends # - make the k-factor selectable # - upfold or unfold single bends ''' def main(): return 0 if __name__ == '__main__': main() ''' import Part, FreeCADGui from PySide import QtGui from FreeCAD import Base import DraftVecUtils, DraftGeomUtils, math, time # to do: # - Put error numbers into the text # - Put user help into more texts unfold_error = { # error codes for the tree-object 1: ('starting: volume unusable, needs a real 3D-sheet-metal with thickness'), 2: ('Starting: invalid point for thickness measurement'), 3: ('Starting: invalid thickness'), 4: ('Starting: invalid shape'), # error codes for the bend-analysis 10: ('Analysis: zero wires in sheet edge analysis'), 11: ('Analysis: double bends not implemented'), 12: ('Analysis: more than one bend-child actually not supported'), 13: ('Analysis: counter face not found'), 14: ('Analysis: the code can not handle edges without neighbor faces'), 15: ('Analysis: the code needs a face at all sheet edges'), 16: ('Analysis: did not find startangle of bend, please post failing sample for analysis'), # error codes for the unfolding 20: ('Unfold: section wire with less than 4 edges'), 21: ('Unfold: Unfold: section wire not closed'), 22: ('Unfold: section failed'), 23: ('Unfold: CutToolWire not closed'), 24: ('Unfold: bend-face without child not implemented'), 25: ('Unfold: '), -1: ('unknown error')} def equal_vertex(vert1, vert2, p=5): # compares two vertices return (round(vert1.X - vert2.X,p)==0 and round(vert1.Y - vert2.Y,p)==0 and round(vert1.Z - vert2.Z,p)==0) def equal_vector(vec1, vec2, p=5): # compares two vectors return (round(vec1.x - vec2.x,p)==0 and round(vec1.y - vec2.y,p)==0 and round(vec1.z - vec2.z,p)==0) def radial_vector(point, axis_pnt, axis): chord = axis_pnt.sub(point) norm = axis.cross(chord) perp = axis.cross(norm) # print chord, norm, perp dist_rv = DraftVecUtils.project(chord,perp) #test_line = Part.makeLine(axis_pnt.add(dist_rv),axis_pnt) # test_line = Part.makeLine(axis_pnt.add(perp),axis_pnt) # test_line = Part.makeLine(point, axis_pnt) # Part.show(test_line) return perp.normalize() class Simple_node(object): ''' This class defines the nodes of a tree, that is the result of the analysis of a sheet-metal-part. Each flat or bend part of the metal-sheet gets a node in the tree. The indexes are the number of the face in the original part. ''' def __init__(self, f_idx=None, Parent_node= None, Parent_edge = None): self.idx = f_idx # index of the "top-face" self.c_face_idx = None # face index to the opposite face of the sheet (counter-face) self.node_type = None # 'Flat' or 'Bend' self.p_node = Parent_node # Parent node self.p_edge = Parent_edge # the connecting edge to the parent node self.child_list = [] # List of child-nodes = link to tree structure self.child_idx_lists = [] # List of lists with child_idx and child_edge # need also a list of indices of child faces self.sheet_edges = [] # List of edges without child-face self.axis = None self.facePosi = None self.bendCenter = None self.distCenter = None # self.axis for 'Flat'-face: vector pointing from the surface into the metal self.bend_dir = None # bend direction values: "up" or "down" self.bend_angle = None # angle in radians self.tan_vec = None # direction of translation for Bend nodes self._trans_length = None # length of translation for Bend nodes, k-factor used according to DIN 6935 self.analysis_ok = True # indicator if something went wrong with the analysis of the face self.error_code = None # index to unfold_error dictionary # here the new features of the nodes: self.nfIndexes = [] # list of all face-indexes of a node (flat and bend: folded state) self.seam_edges = [] # list with edges to seams # bend faces are needed for movement simulation at single other bends. # otherwise unfolded faces are recreated from self.b_edges self.node_flattened_faces = [] # faces of a flattened bend node. self.actual_angle = None # state of angle in refolded sheet metal part self.p_wire = None # wire common with parent node, used for bend node self.c_wire = None # wire common with child node, used for bend node self.b_edges = [] # list of edges in a bend node, that needs to be recalculated, at unfolding def get_Face_idx(self): # get the face index from the tree-element return self.idx class SheetTree(object): def __init__(self, TheShape, f_idx): self.cFaceTol = 0.002 # tolerance to detect counter-face vertices # this high tolerance was needed for more real parts self.root = None # make_new_face_node adds the root node if parent_node == None self.__Shape = TheShape.copy() self.error_code = None self.failed_face_idx = None if not self.__Shape.isValid(): print "The shape is not valid!" self.error_code = 4 # Starting: invalid shape self.failed_face_idx = f_idx #Part.show(self.__Shape) # List of indices to the shape.Faces. The list is used a lot for face searches. # Some faces will be cut and the new ones added to the list. # So a list of faces independent of the shape is needed. self.f_list = [] #self.__Shape.Faces.copy() does not work self.index_list =[] self.index_unfold_list = [] # indexes needed for unfolding for i in range(len (self.__Shape.Faces)): #for i in range(len (self.f_list)): # if i<>(f_idx): self.index_list.append(i) self.index_unfold_list.append(i) self.f_list.append(self.__Shape.Faces[i]) #print self.index_list self.max_f_idx = len(self.f_list) # need this value to make correct indices to new faces theVol = self.__Shape.Volume if theVol < 0.0001: print "Shape is not a real 3D-object or to small for a metal-sheet!" self.error_code = 1 self.failed_face_idx = f_idx else: # Make a first estimate of the thickness estimated_thickness = theVol/(self.__Shape.Area / 2.0) print "approximate Thickness: ", estimated_thickness # Measure the real thickness of the initial face: Use Orientation and # Axis to make an measurement vector if hasattr(self.__Shape.Faces[f_idx],'Surface'): # Part.show(self.__Shape.Faces[f_idx]) # print 'the object is a face! vertices: ', len(self.__Shape.Faces[f_idx].Vertexes) F_type = self.__Shape.Faces[f_idx].Surface # fixme: through an error, if not Plane Object print 'It is a: ', str(F_type) print 'Orientation: ', str(self.__Shape.Faces[f_idx].Orientation) # Need a point on the surface to measure the thickness. # Sheet edges could be sloping, so there is a danger to measure # right at the edge. # Try with Arithmetic mean of plane vertices m_vec = Base.Vector(0.0,0.0,0.0) # calculating a mean vector for Vvec in self.__Shape.Faces[f_idx].Vertexes: #m_vec = m_vec.add(Base.Vector(Vvec.X, Vvec.Y, Vvec.Z)) m_vec = m_vec.add(Vvec.Point) mvec = m_vec.multiply(1.0/len(self.__Shape.Faces[f_idx].Vertexes)) print "mvec: ", mvec if hasattr(self.__Shape.Faces[f_idx].Surface,'Position'): s_Posi = self.__Shape.Faces[f_idx].Surface.Position k = 0 # while k < len(self.__Shape.Faces[f_idx].Vertexes): # fixme: what if measurepoint is outside? pvert = self.__Shape.Faces[f_idx].Vertexes[k] pvec = Base.Vector(pvert.X, pvert.Y, pvert.Z) shiftvec = mvec.sub(pvec) shiftvec = shiftvec.normalize()*2.0*estimated_thickness measure_pos = pvec.add(shiftvec) # Description: Checks if a point is inside a solid with a certain tolerance. # If the 3rd parameter is True a point on a face is considered as inside if not self.__Shape.isInside(measure_pos, 0.00001, True): print "Starting measure_pos for thickness measurement is outside!" self.error_code = 2 self.failed_face_idx = f_idx if hasattr(self.__Shape.Faces[f_idx].Surface,'Axis'): s_Axis = self.__Shape.Faces[f_idx].Surface.Axis # print 'We have an axis: ', s_Axis if hasattr(self.__Shape.Faces[f_idx].Surface,'Position'): s_Posi = self.__Shape.Faces[f_idx].Surface.Position # print 'We have a position: ', s_Posi s_Ori = self.__Shape.Faces[f_idx].Orientation s_Axismp = Base.Vector(s_Axis.x, s_Axis.y, s_Axis.z).multiply(2.0*estimated_thickness) if s_Ori == 'Forward': Meassure_axis = Part.makeLine(measure_pos,measure_pos.sub(s_Axismp)) ext_Vec = Base.Vector(-s_Axis.x, -s_Axis.y, -s_Axis.z) # Meassure_axis = Part.makeLine(measure_pos,measure_pos.sub(s_Axis.multiply(2.0*estimated_thickness))) else: # Meassure_axis = Part.makeLine(measure_pos,measure_pos.add(s_Axis.multiply(2.0*estimated_thickness))) Meassure_axis = Part.makeLine(measure_pos,measure_pos.add(s_Axismp)) ext_Vec = Base.Vector(s_Axis.x, s_Axis.y, s_Axis.z) # Part.show(Meassure_axis) lostShape = self.__Shape.copy() lLine = Meassure_axis.common(lostShape) lLine = Meassure_axis.common(self.__Shape) print "lLine number edges: ", len(lLine.Edges) measVert = Part.Vertex(measure_pos) for mEdge in lLine.Edges: if equal_vertex(mEdge.Vertexes[0], measVert) or equal_vertex(mEdge.Vertexes[1], measVert): self.__thickness = mEdge.Length # self.__thickness = lLine.Length if (self.__thickness < estimated_thickness) or (self.__thickness > 1.9 * estimated_thickness): self.error_code = 3 self.failed_face_idx = f_idx print "estimated thickness: ", estimated_thickness, " measured thickness: ", self.__thickness Part.show(lLine) def get_node_faces(self, theNode, wires_e_lists): ''' This function searches for all faces making up the node, except of the top and bottom face, which are already there. wires_e_list is the list of wires lists of the top face without the parent-edge theNode: the actual node to be filled with data. ''' # How to begin? # searching for all faces, that have two vertices in common with # an edge from the list should give the sheet edge. # But we also need to look at the sheet edge, in order to not claim # faces from the next node! # Then we have to treat thoses faces, that belongs to more than one # node. Those faces needs to be cut and the face list needs to be updated. # look also at the number of wires of the top face. More wires will # indicate a hole or a feature. print " When will this be called" found_indices = [] # A search strategy for faces based on the wires_e_lists is needed. # for theWire in wires_e_lists: for theEdge in theWire: analyVert = theEdge.Vertexes[0] search_list = [] for x in self.index_list: search_list.append(x) for i in search_list: for lookVert in self.f_list[i].Vertexes: if equal_vertex(lookVert, analyVert): if len(theEdge.Vertexes) == 1: # Edge is a circle if not self.is_sheet_edge_face(theEdge, theNode): found_indices.append(i) # found a node face theNode.child_idx_lists.append([i,theEdge]) #self.index_list.remove(i) # remove this face from the index_list #Part.show(self.f_list[i]) else: nextVert = theEdge.Vertexes[1] for looknextVert in self.f_list[i].Vertexes: if equal_vertex(looknextVert, nextVert): if not self.is_sheet_edge_face(theEdge, theNode): found_indices.append(i) # found a node face theNode.child_idx_lists.append([i,theEdge]) #self.index_list.remove(i) # remove this face from the index_list #Part.show(self.f_list[i]) print "found_indices: ", found_indices def is_sheet_edge_face(self, ise_edge, tree_node): # ise_edge: IsSheetEdge_edge # idea: look at properties of neighbor face # look at edges with distance of sheet-thickness. # if found and surface == cylinder, check if it could be a bend-node. # look at number of edges: # A face with 3 edges is at the sheet edge Cylinder-face or triangle (oh no!) # need to look also at surface! # A sheet edge face with more as 4 edges, is common to more than 1 node. # get the face which has a common edge with ise_edge the_index = None has_sheet_distance_vertex = False for i in self.index_list: for sf_edge in self.f_list[i].Edges: if sf_edge.isSame(ise_edge): the_index = i break if the_index <> None: break # Simple strategy applied: look if the connecting face has vertexes # with sheet-thickness distance to the top face. # fix me: this will fail with sharpened sheet edges with two faces # between top and bottom. if the_index <> None: distVerts = 0 vertList = [] F_type = str(self.f_list[tree_node.idx].Surface) # now we need to search for vertexes with sheet_thickness_distance #if F_type == "<Plane object>": for F_vert in self.f_list[i].Vertexes: if self.isVertOpposite(F_vert, tree_node): has_sheet_distance_vertex = True if len(self.f_list[i].Edges)<5: tree_node.nfIndexes.append(i) self.index_list.remove(i) #Part.show(self.f_list[i]) else: # need to cut the face at the ends of ise_edge self.divideEdgeFace(i, ise_edge, F_vert, tree_node) break else: tree_node.analysis_ok = False tree_node.error_code = 15 # Analysis: the code needs a face at all sheet edges self.error_code = 15 self.failed_face_idx = tree_node.idx Part.show(self.f_list[tree_node.idx]) return has_sheet_distance_vertex def isVertOpposite(self, theVert, theNode): F_type = str(self.f_list[theNode.idx].Surface) vF_vert = Base.Vector(theVert.X, theVert.Y, theVert.Z) if F_type == "<Plane object>": distFailure = vF_vert.distanceToPlane (theNode.facePosi, theNode.axis) - self.__thickness if F_type == "<Cylinder object>": distFailure = vF_vert.distanceToLine (theNode.bendCenter, theNode.axis) - theNode.distCenter # print "counter face distance: ", dist_v + self.__thickness if (distFailure < self.cFaceTol) and (distFailure > -self.cFaceTol): return True else: return False def divideEdgeFace(self, fIdx, ise_edge, F_vert, tree_node): print "Sheet edge face has more than 4 edges!" # first find out where the Sheet edge face has no edge to the opposite side of the sheet # There is a need to cut the face. # make a cut-tool perpendicular to the ise_edge # cut the face and select the good one to add to the node # make another cut, in order to add the residual face(s) to the face list. # Search edges in the face with a vertex common with ise_edge F_type = str(self.f_list[tree_node.idx].Surface) needCut0 = True firstCutFaceIdx = None for sEdge in self.f_list[fIdx].Edges: if equal_vertex(ise_edge.Vertexes[0], sEdge.Vertexes[0]) and \ self.isVertOpposite(sEdge.Vertexes[1], tree_node): needCut0 = False theEdge = sEdge if equal_vertex(ise_edge.Vertexes[0], sEdge.Vertexes[1]) and \ self.isVertOpposite(sEdge.Vertexes[0], tree_node): needCut0 = False theEdge = sEdge if needCut0: #print "need Cut at 0 with fIdx: ", fIdx nFace = self.cutEdgeFace(0, fIdx, ise_edge, tree_node) tree_node.nfIndexes.append(self.max_f_idx) self.f_list.append(nFace) firstCutFaceIdx = self.max_f_idx self.max_f_idx += 1 #self.f_list.append(rFace) #self.index_list.append(self.max_f_idx) #self.max_f_idx += 1 #self.index_list.remove(fIdx) #Part.show(nFace) #else: # Part.show(theEdge) needCut1 = True for sEdge in self.f_list[fIdx].Edges: if equal_vertex(ise_edge.Vertexes[1], sEdge.Vertexes[0]): if self.isVertOpposite(sEdge.Vertexes[1], tree_node): needCut1 = False theEdge = sEdge if equal_vertex(ise_edge.Vertexes[1], sEdge.Vertexes[1]): if self.isVertOpposite(sEdge.Vertexes[0], tree_node): needCut1 = False theEdge = sEdge if needCut1: if needCut0: fIdx = firstCutFaceIdx tree_node.nfIndexes.remove(fIdx) #print "need Cut at 1 with fIdx: ", fIdx nFace = self.cutEdgeFace(1, fIdx, ise_edge, tree_node) tree_node.nfIndexes.append(self.max_f_idx) self.f_list.append(nFace) firstCutFaceIdx = self.max_f_idx self.max_f_idx += 1 #self.f_list.append(rFace) #self.index_list.append(self.max_f_idx) #self.max_f_idx += 1 #if not needCut0: # self.index_list.remove(fIdx) #Part.show(nFace) #else: # Part.show(theEdge) def cutEdgeFace(self, eIdx, fIdx, theEdge, theNode): ''' This function cuts a face in two pieces. one piece is connected to the node. The residual pieces is given for assignment to other nodes. The function returns both pieces of the original face. ''' # print "now the face cutter" if eIdx == 0: otherIdx = 1 else: otherIdx = 0 origin = theEdge.Vertexes[eIdx].Point F_type = str(self.f_list[theNode.idx].Surface) if F_type == "<Plane object>": tan_vec = theEdge.Vertexes[eIdx].Point - theEdge.Vertexes[otherIdx].Point #o_thick = Base.Vector(o_vec.x, o_vec.y, o_vec.z) tan_vec.normalize() vec1 = Base.Vector(theNode.axis.x, theNode.axis.y, theNode.axis.z) # make a copy crossVec = tan_vec.cross(vec1) crossVec.multiply(3.0*self.__thickness) vec1.multiply(self.__thickness) # defining the points of the cutting plane: Spnt1 = origin - theNode.axis - crossVec Spnt2 = origin - theNode.axis + crossVec Spnt3 = origin + theNode.axis + vec1 + crossVec Spnt4 = origin + theNode.axis + vec1 - crossVec if F_type == "<Cylinder object>": ePar = theEdge.parameterAt(theEdge.Vertexes[eIdx]) print "Idx: ", eIdx, " ePar: ", ePar otherPar = theEdge.parameterAt(theEdge.Vertexes[otherIdx]) tan_vec = theEdge.tangentAt(ePar) if ePar < otherPar: tan_vec.multiply(-1.0) #tan_line = Part.makeLine(theEdge.Vertexes[eIdx].Point.add(tan_vec), theEdge.Vertexes[eIdx].Point) #Part.show(tan_line) edge_vec = theEdge.Vertexes[eIdx].copy().Point radVector = radial_vector(edge_vec, theNode.bendCenter, theNode.axis) if theNode.bend_dir == "down": radVector.multiply(-1.0) #rad_line = Part.makeLine(theEdge.Vertexes[eIdx].Point.add(radVector), theEdge.Vertexes[eIdx].Point) #Part.show(rad_line) crossVec = tan_vec.cross(radVector) crossVec.multiply(3.0*self.__thickness) vec1 = Base.Vector(radVector.x, radVector.y, radVector.z) # make a copy vec1.multiply(self.__thickness) # defining the points of the cutting plane: Spnt1 = origin - radVector - crossVec Spnt2 = origin - radVector + crossVec Spnt3 = origin + radVector + vec1 + crossVec Spnt4 = origin + radVector + vec1 - crossVec Sedge1 = Part.makeLine(Spnt1,Spnt2) Sedge2 = Part.makeLine(Spnt2,Spnt3) Sedge3 = Part.makeLine(Spnt3,Spnt4) Sedge4 = Part.makeLine(Spnt4,Spnt1) Sw1 = Part.Wire([Sedge1, Sedge2, Sedge3, Sedge4]) Sf1=Part.Face(Sw1) # cut_solid = Sf1.extrude(tan_vec.multiply(5.0)) #Part.show(cut_solid) #cut_opposite = Sf1.extrude(tan_vec.multiply(-5.0)) cutFaces_node = self.f_list[fIdx].cut(cut_solid) for cFace in cutFaces_node.Faces: for myVert in cFace.Vertexes: if equal_vertex(theEdge.Vertexes[eIdx], myVert): nodeFace = cFace #print "The nodeFace" #Part.show(nodeFace) break ''' cutFaces_residue = self.f_list[fIdx].cut(cut_opposite) for cFace in cutFaces_residue.Faces: for myVert in cFace.Vertexes: if equal_vertex(theEdge.Vertexes[eIdx], myVert): residueFace = cFace #print "the residueFace" #Part.show(residueFace) break ''' return nodeFace #, residueFace def is_sheet_edge3(self, ise_edge, tree_node): # ise_edge: IsSheetEdge_edge # idea: look at properties of neighbor face # look at edges with distance of sheet-thickness. # if found and surface == cylinder, check if it could be a bend-node. # look at number of edges: # A face with 3 edges is at the sheet edge Cylinder-face or triangle (oh no!) # need to look also at surface! # A sheet edge face with more as 4 edges, is common to more than 1 node. # get the face which has a common edge with ise_edge the_index = None has_sheet_distance_vertex = False for i in self.index_list: for sf_edge in self.f_list[i].Edges: if sf_edge.isSame(ise_edge): the_index = i break if the_index <> None: break if the_index <> None: distVerts = 0 vertList = [] F_type = str(self.f_list[tree_node.idx].Surface) # now we need to search for vertexes with sheet_thickness_distance #if F_type == "<Plane object>": for F_vert in self.f_list[i].Vertexes: vF_vert = Base.Vector(F_vert.X, F_vert.Y, F_vert.Z) if F_type == "<Plane object>": distFailure = vF_vert.distanceToPlane (tree_node.facePosi, tree_node.axis) - self.__thickness if F_type == "<Cylinder object>": distFailure = vF_vert.distanceToLine (tree_node.bendCenter, tree_node.axis) - tree_node.distCenter # print "counter face distance: ", dist_v + self.__thickness if (distFailure < self.cFaceTol) and (distFailure > -self.cFaceTol): has_sheet_distance_vertex = True break else: tree_node.analysis_ok = False tree_node.error_code = 15 # Analysis: the code needs a face at all sheet edges self.error_code = 15 self.failed_face_idx = tree_node.idx Part.show(self.f_list[tree_node.idx]) return has_sheet_distance_vertex def make_new_face_node(self, face_idx, P_node, P_edge, wires_e_lists): # e_list: list of edges of the top face of a node without the parent-edge (P_edge) # analyze the face and get type of face ("Flat" or "Bend") # search the counter face, get axis of Face # In case of "Bend" get angle, k_factor and trans_length # put the node into the tree newNode = Simple_node(face_idx, P_node, P_edge) F_type = str(self.__Shape.Faces[face_idx].Surface) # This face should be a node in the tree, and is therefore known! # removed from the list of all unknown faces self.index_list.remove(face_idx) # This means, it could also not be found as neighbor face anymore. #newNode.node_faces.append(self.f_list[face_idx].copy()) newNode.nfIndexes.append(face_idx) such_list = [] for k in self.index_list: such_list.append(k) if F_type == "<Plane object>": newNode.node_type = 'Flat' # fixme print "Face", face_idx+1, " Type: ", newNode.node_type s_Posi = self.__Shape.Faces[face_idx].Surface.Position newNode.facePosi = s_Posi s_Ori = self.__Shape.Faces[face_idx].Orientation s_Axis = self.__Shape.Faces[face_idx].Surface.Axis if s_Ori == 'Forward': ext_Vec = Base.Vector(-s_Axis.x, -s_Axis.y, -s_Axis.z) else: ext_Vec = Base.Vector(s_Axis.x, s_Axis.y, s_Axis.z) newNode.axis = ext_Vec axis_line = Part.makeLine(s_Posi.add(ext_Vec), s_Posi) # Part.show(axis_line) # nead a mean point of the face to avoid false counter faces faceMiddle = Base.Vector(0.0,0.0,0.0) # calculating a mean vector for Vvec in self.__Shape.Faces[face_idx].OuterWire.Vertexes: faceMiddle = faceMiddle.add(Vvec.Point) faceMiddle = faceMiddle.multiply(1.0/len(self.__Shape.Faces[face_idx].OuterWire.Vertexes)) # search for the counter face for i in such_list: counter_found = True for F_vert in self.f_list[i].Vertexes: vF_vert = Base.Vector(F_vert.X, F_vert.Y, F_vert.Z) dist_v = vF_vert.distanceToPlane (s_Posi, ext_Vec) - self.__thickness # print "counter face distance: ", dist_v + self.__thickness if (dist_v > self.cFaceTol) or (dist_v < -self.cFaceTol): counter_found = False if counter_found: # nead a mean point of the face to avoid false counter faces counterMiddle = Base.Vector(0.0,0.0,0.0) # calculating a mean vector for Vvec in self.__Shape.Faces[i].OuterWire.Vertexes: counterMiddle = counterMiddle.add(Vvec.Point) counterMiddle = counterMiddle.multiply(1.0/len(self.__Shape.Faces[i].OuterWire.Vertexes)) distVector = counterMiddle.sub(faceMiddle) counterDistance = distVector.Length if counterDistance < 3*self.__thickness: print "found counter-face", i + 1 newNode.c_face_idx = i self.index_list.remove(i) newNode.nfIndexes.append(i) # Part.show(self.__Shape.Faces[newNode.c_face_idx]) else: counter_found = False print "faceMiddle: ", str(faceMiddle), "counterMiddle: ", str(counterMiddle) #if newNode.c_face_idx == None: # Part.show(axis_line) if F_type == "<Cylinder object>": newNode.node_type = 'Bend' # fixme s_Center = self.__Shape.Faces[face_idx].Surface.Center s_Axis = self.__Shape.Faces[face_idx].Surface.Axis newNode.axis = s_Axis newNode.bendCenter = s_Center edge_vec = P_edge.Vertexes[0].copy().Point print "edge_vec: ", str(edge_vec) if P_node.node_type == 'Flat': dist_c = edge_vec.distanceToPlane (s_Center, P_node.axis) # distance to center else: P_face = self.__Shape.Faces[P_node.idx] radVector = radial_vector(edge_vec, P_face.Surface.Center, P_face.Surface.Axis) if P_node.bend_dir == "down": dist_c = edge_vec.distanceToPlane (s_Center, radVector.multiply(-1.0)) else: dist_c = edge_vec.distanceToPlane (s_Center, radVector) if dist_c < 0.0: newNode.bend_dir = "down" thick_test = self.__Shape.Faces[face_idx].Surface.Radius - self.__thickness else: newNode.bend_dir = "up" thick_test = self.__Shape.Faces[face_idx].Surface.Radius + self.__thickness newNode.distCenter = thick_test # print "Face idx: ", face_idx, " bend_dir: ", newNode.bend_dir print "Face", face_idx+1, " Type: ", newNode.node_type, " bend_dir: ", newNode.bend_dir # need to define the bending angle relative to the Center and the # Axis of the bend surface: # search for line-edges with no common point with edge_vec and fixme: not in the same line # fixme: there could be more than one edge meeting the criteria! number_c_edges = 0 for s_edge in self.__Shape.Faces[face_idx].Edges: c_edg_found = True type_str = str(s_edge.Curve) if type_str.find('Line') == -1: c_edg_found = False # print "found circle in c_edge search" else: # print "found line in c_edge search" for E_vert in s_edge.Vertexes: if equal_vertex(E_vert, P_edge.Vertexes[0]): c_edg_found = False if c_edg_found: c_edge = s_edge number_c_edges = number_c_edges + 1 # print " found the second Line edge of the bend face" # Part.show(c_edge) if number_c_edges > 1: newNode.analysis_ok = False # the code can not handle bend faces with more than one child! newNode.error_code = 12 # ('more than one bend-childs') self.error_code = 12 self.failed_face_idx = face_idx #Start to investigate the angles at self.__Shape.Faces[face_idx].ParameterRange[0] angle_0 = self.__Shape.Faces[face_idx].ParameterRange[0] angle_1 = self.__Shape.Faces[face_idx].ParameterRange[1] length_0 = self.__Shape.Faces[face_idx].ParameterRange[2] length_1 = self.__Shape.Faces[face_idx].ParameterRange[3] # idea: identify the angle at edge_vec = P_edge.Vertexes[0].copy().Point # This will be = angle_start # identify rotSign from angle_end minus angle_start # The tangentvector will be in direction of position at angle_sta + rotSign*90° # calculate the tan_vec from valueAt parPos00 = self.__Shape.Faces[face_idx].valueAt(angle_0,length_0) parPos01 = self.__Shape.Faces[face_idx].valueAt(angle_0,length_1) parPos10 = self.__Shape.Faces[face_idx].valueAt(angle_1,length_0) parPos11 = self.__Shape.Faces[face_idx].valueAt(angle_1,length_1) if equal_vector(edge_vec, parPos00): print "got case 00" angle_start = angle_0 angle_end = angle_1 len_start = length_0 else: if equal_vector(edge_vec, parPos01): print "got case 01" angle_start = angle_0 angle_end = angle_1 len_start = length_1 else: if equal_vector(edge_vec, parPos10): print "got case 10" angle_start = angle_1 angle_end = angle_0 len_start = length_0 else: if equal_vector(edge_vec, parPos11): print "got case 11" angle_start = angle_1 angle_end = angle_0 len_start = length_1 else: newNode.analysis_ok = False newNode.error_code = 16 # Analysis: did not find startangle of bend self.error_code = 16 self.failed_face_idx = face_idx print "did not found start angle, to do to fix" newNode.bend_angle = angle_end - angle_start if newNode.bend_angle < 0.0: angle_tan = angle_start - math.pi/2.0 # newNode.bend_angle = -newNode.bend_angle else: angle_tan = angle_start + math.pi/2.0 tanPos = self.__Shape.Faces[face_idx].valueAt(angle_tan,len_start) tan_vec = radial_vector(tanPos, s_Center, s_Axis) newNode.tan_vec = tan_vec first_vec = radial_vector(edge_vec, s_Center, s_Axis) cross_vec = first_vec.cross(tan_vec) triple_prod = cross_vec.dot(s_Axis) print " the new bend_angle: ", math.degrees(newNode.bend_angle), "triple_prod: ", triple_prod # testing showed, that the bend_angle has to be changed in sign # at the following conditions. if ((triple_prod > 0.0) and (newNode.bend_angle > 0.0)) or \ ((triple_prod < 0.0) and (newNode.bend_angle < 0.0)): newNode.bend_angle = -newNode.bend_angle print "minus bend_angle" if newNode.bend_dir == 'up': k_Factor = 0.65 + 0.5*math.log10(self.__Shape.Faces[face_idx].Surface.Radius/self.__thickness) print "Face", newNode.idx+1, " k-factor: ", k_Factor newNode._trans_length = (self.__Shape.Faces[face_idx].Surface.Radius + k_Factor * self.__thickness/2.0) * newNode.bend_angle else: k_Factor = 0.65 + 0.5*math.log10((self.__Shape.Faces[face_idx].Surface.Radius - self.__thickness)/self.__thickness) newNode._trans_length = (self.__Shape.Faces[face_idx].Surface.Radius - self.__thickness \ + k_Factor * self.__thickness/2.0) * newNode.bend_angle if newNode._trans_length < 0.0: newNode._trans_length = -newNode._trans_length # the _trans_length is always positive, due to correct tan_vec # calculate mean point of face: # fixme implement also for cylindric faces # Search the face at the opposite site of the sheet: #for i in range(len(such_list)): for i in such_list: counter_found = True for F_vert in self.f_list[i].Vertexes: vF_vert = Base.Vector(F_vert.X, F_vert.Y, F_vert.Z) dist_c = vF_vert.distanceToLine (s_Center, s_Axis) - thick_test if (dist_c > self.cFaceTol) or (dist_c < -self.cFaceTol): counter_found = False if counter_found: # to do calculate mean point of counter face #print "found counter Face", such_list[i]+1 newNode.c_face_idx = i self.index_list.remove(i) newNode.nfIndexes.append(i) # Part.show(self.__Shape.Faces[newNode.c_face_idx]) break # Part.show(self.__Shape.Faces[newNode.c_face_idx]) # Part.show(self.__Shape.Faces[newNode.idx]) if newNode.c_face_idx == None: newNode.analysis_ok = False newNode.error_code = 13 # Analysis: counter face not found self.error_code = 13 self.failed_face_idx = face_idx print "No counter-face Debugging Thickness: ", self.__thickness Part.show(self.__Shape.Faces[face_idx]) # now we call the new code self.get_node_faces(newNode, wires_e_lists) #for nFace in newNode.nfIndexes: # Part.show(nFace) if P_node == None: self.root = newNode else: P_node.child_list.append(newNode) return newNode def search_face(self, sf_edge, the_node): # search for the connecting face to sf_edge in the faces of a node search_List = the_node.nfIndexes[:] search_List.remove(the_node.idx) the_index = None for i in search_List: #self.index_list: for n_edge in self.f_list[i].Edges: if sf_edge.isSame(n_edge): the_index = i #if the_index == None: # the_node.analysis_ok = False # the code can not handle? edges without neighbor faces # the_node.error_code = 14 # Analysis: the code can not handle? edges without neighbor faces # self.error_code = 14 # self.failed_face_idx = the_node.idx return the_index def Bend_analysis(self, face_idx, parent_node = None, parent_edge = None): # This functions traverses the shape in order to build the bend-tree # For each relevant face a t_node is created and linked into the tree # the linking is done in the call of self.make_new_face_node #print "Bend_analysis Face", face_idx +1 , # analysis_ok = True # not used anymore? # edge_list = [] wires_edge_lists = [] wire_idx = -1 for n_wire in self.f_list[face_idx].Wires: wire_idx += 1 wires_edge_lists.append([]) #for n_edge in self.__Shape.Faces[face_idx].Edges: for n_edge in n_wire.Edges: if parent_edge: if not parent_edge.isSame(n_edge): #edge_list.append(n_edge) wires_edge_lists[wire_idx].append(n_edge) # else: #edge_list.append(n_edge) wires_edge_lists[wire_idx].append(n_edge) if parent_node: print " Parent Face", parent_node.idx + 1 print "Die Liste: ", self.index_list t_node = self.make_new_face_node(face_idx, parent_node, parent_edge, wires_edge_lists) # Need also the edge_list in the node! print "Die Liste nach make_new_face_node: ", self.index_list # in the new code, only the list of child faces will be analyzed. removalList = [] for child_info in t_node.child_idx_lists: if child_info[0] in self.index_list: print "child in List: ", child_info[0] self.Bend_analysis(child_info[0], t_node, child_info[1]) else: print "remove child from List: ", child_info[0] t_node.seam_edges.append(child_info[1]) # give Information to the node, that it has a seam. print "node faces before: ", t_node.nfIndexes self.makeSeamFace(child_info[1], t_node) removalList.append(child_info) print "node faces with seam: ", t_node.nfIndexes otherSeamNode = self.searchNode(child_info[0], self.root) print "counterface on otherSeamNode: Face", otherSeamNode.c_face_idx+1 self.makeSeamFace(child_info[1], otherSeamNode) #t_node.analysis_ok = False # the code can not handle? edges without neighbor faces #t_node.error_code = 14 # Analysis: the code can not handle? edges without neighbor faces #self.error_code = 14 #self.failed_face_idx = t_node.idx #break for seams in removalList: t_node.child_idx_lists.remove(seams) def searchNode(self, theIdx, sNode): # search for a Node with theIdx in sNode.idx print "my Idx: ", sNode.idx if sNode.idx == theIdx: return sNode else: result = None childFaces = [] for n_node in sNode.child_list: childFaces.append(n_node.idx) print "my children: ", childFaces for n_node in sNode.child_list: nextSearch = self.searchNode(theIdx, n_node) if nextSearch <> None: result = nextSearch break if result<>None: print "this is the result: ", result.idx else: print "this is the result: ", None return result # suche bei mir. wenn ja liefere ab # sonst sind Kinder da? # Wenn Kinder vorhanden, frag solange Kinder bis gefunden # oder kein Kind mehr da. def makeSectionWire(self, theEdge, W_node, Dir = 'up'): #print "mSW Face", W_node.idx +1 # makes a Section wire through the shape # The section wire is used to generate a new flat shell # for the bend faces. origin = theEdge.Vertexes[0].Point o_vec = theEdge.Vertexes[1].Point - theEdge.Vertexes[0].Point o_thick = Base.Vector(o_vec.x, o_vec.y, o_vec.z) o_thick.normalize().multiply(2.0 * self.__thickness) s_Center = self.f_list[W_node.idx].Surface.Center s_Axis = self.f_list[W_node.idx].Surface.Axis vec1 = radial_vector(origin, s_Center, s_Axis) vec1.multiply(self.__thickness) # defining the points of the section plane: if W_node.bend_dir == 'up': Spnt1 = origin - vec1 - o_thick Spnt2 = origin - vec1 + o_vec + o_thick Spnt3 = origin + vec1 + vec1 + o_vec + o_thick Spnt4 = origin + vec1 + vec1 - o_thick else: Spnt4 = origin - vec1 - vec1 - o_thick Spnt3 = origin - vec1 - vec1 + o_vec + o_thick Spnt2 = origin + vec1 + o_vec + o_thick Spnt1 = origin + vec1 - o_thick Sedge1 = Part.makeLine(Spnt1,Spnt2) Sedge2 = Part.makeLine(Spnt2,Spnt3) Sedge3 = Part.makeLine(Spnt3,Spnt4) Sedge4 = Part.makeLine(Spnt4,Spnt1) Sw1 = Part.Wire([Sedge1, Sedge2, Sedge3, Sedge4]) Sf1=Part.Face(Sw1) # # Part.show(Sf1) # find the nearest vertex of theEdge to a plane through s_Center # The section-wire should start at this vertex if (theEdge.Vertexes[0].Point.distanceToPlane(s_Center, s_Axis) < theEdge.Vertexes[1].Point.distanceToPlane(s_Center, s_Axis)): next_pnt = theEdge.Vertexes[1] start_pnt = theEdge.Vertexes[0] start_idx = 0 end_idx = 1 else: next_pnt = theEdge.Vertexes[0] start_pnt = theEdge.Vertexes[1] start_idx = 1 end_idx = 0 # for i in self.index_list: for i in W_node.nfIndexes: singleEdge = Sf1.section(self.f_list[i]) # Part.show(singleEdge) #print "section edges: ", len(singleEdge.Edges) for j in range(len(singleEdge.Edges)): if (equal_vertex(singleEdge.Edges[j].Vertexes[0], start_pnt)): lastEdge = singleEdge.Edges[j].copy() lastConnect = 1 if (equal_vertex(singleEdge.Edges[j].Vertexes[1], start_pnt)): lastEdge = singleEdge.Edges[j].copy() lastConnect = 0 if (equal_vertex(singleEdge.Edges[j].Vertexes[0], next_pnt)): nextEdge = singleEdge.Edges[j].copy() nextConnect = 1 if (equal_vertex(singleEdge.Edges[j].Vertexes[1], next_pnt)): nextEdge = singleEdge.Edges[j].copy() nextConnect = 0 startEdge = Part.makeLine(start_pnt.Point, next_pnt.Point) middleEdge = Part.makeLine(nextEdge.Vertexes[nextConnect].Point, lastEdge.Vertexes[lastConnect].Point) Swire1 = Part.Wire([startEdge, nextEdge, middleEdge, lastEdge ]) # Part.show(Swire1) print "finisch mSW Face", W_node.idx +1 return Swire1 def generateBendShell(self, bend_node): #print "genBendShell Face", bend_node.idx +1 # make new flat faces for the bend_node and return them # the k-Factor is already included in bend_node._trans_length # Part.show(self.__Shape.copy()) flat_shell = [] trans_vec = bend_node.tan_vec * bend_node._trans_length # o_edge: originating edge of the bend = parent edge o_edge = bend_node.p_edge.copy() # We want a section wire at the start of the bend_node, in order # to regenerate a flat body with this section wire. # 3 vectors are needed to generate a section plane: vec1 and # a vector from o_edge and a vector with same direction of o_edge, # but with a length of two times the thickness o_wire = self.makeSectionWire(o_edge, bend_node, bend_node.bend_dir) #Part.show(o_wire) # The same vectors are needed for the other side of the bend face if len(bend_node.child_list)>=1: child_node = bend_node.child_list[0] # fixme: there could be more than one child node for a bend face. # bend_edge = bend_node.edge_pool[child_node.idx][0] bend_edge = child_node.p_edge.copy() b_wire = self.makeSectionWire(bend_edge, bend_node, bend_node.bend_dir).copy() else: number_c_edges = 0 for s_edge in self.f_list[bend_node.idx].Edges: c_edg_found = True type_str = str(s_edge.Curve) if type_str.find('Line') == -1: c_edg_found = False print "found circle in c_edge search in bend Face", bend_node.idx+1 else: print "found line in c_edge search in bend Face", bend_node.idx+1 for E_vert in s_edge.Vertexes: if equal_vertex(E_vert, bend_node.p_edge.Vertexes[0]): c_edg_found = False if c_edg_found: bend_edge = s_edge number_c_edges = number_c_edges + 1 print " found the second Line edge of the bend Face", bend_node.idx+1 #Part.show(bend_edge) t_idx = self.search_face(bend_edge, bend_node) # Part.show(self.f_list[t_idx]) if t_idx <> None: topFace = self.f_list[t_idx].copy() topFace.rotate(self.f_list[bend_node.idx].Surface.Center,bend_node.axis,math.degrees(bend_node.bend_angle)) topFace.translate(trans_vec) flat_shell.append(topFace) s_Center = self.f_list[bend_node.idx].Surface.Center s_Axis = self.f_list[bend_node.idx].Surface.Axis # find the nearest vertex of bend_edge to a plane through s_Center # The section-wire should start at this vertex if (bend_edge.Vertexes[0].Point.distanceToPlane(s_Center, s_Axis) < bend_edge.Vertexes[1].Point.distanceToPlane(s_Center, s_Axis)): next_pnt = bend_edge.Vertexes[1].Point start_pnt = bend_edge.Vertexes[0].Point start_idx = 0 end_idx = 1 else: next_pnt = bend_edge.Vertexes[0].Point start_pnt = bend_edge.Vertexes[1].Point start_idx = 1 end_idx = 0 b_wireList = self.f_list[t_idx].Edges[:] #for remEdge in b_wireList: # print "in b_wireList" # Part.show(remEdge) for remEdge in b_wireList: # Part.show(remEdge) if remEdge.isSame(bend_edge): b_wireList.remove(remEdge) break for singleEdge in b_wireList: #Part.show(singleEdge) # print "section edges: ", len(singleEdge.Edges) if len(singleEdge.Edges) == 1: if (DraftVecUtils.equals(singleEdge.Edges[0].Vertexes[0].Point, start_pnt)): lastEdge = singleEdge.Edges[0].copy() lastConnect = 1 if (DraftVecUtils.equals(singleEdge.Edges[0].Vertexes[1].Point, start_pnt)): lastEdge = singleEdge.Edges[0].copy() lastConnect = 0 if (DraftVecUtils.equals(singleEdge.Edges[0].Vertexes[0].Point, next_pnt)): nextEdge = singleEdge.Edges[0].copy() nextConnect = 1 if (DraftVecUtils.equals(singleEdge.Edges[0].Vertexes[1].Point, next_pnt)): nextEdge = singleEdge.Edges[0].copy() nextConnect = 0 startEdge = Part.makeLine(start_pnt, next_pnt) middleEdge = Part.makeLine(nextEdge.Vertexes[nextConnect].Point, lastEdge.Vertexes[lastConnect].Point) b_wire = Part.Wire([startEdge, nextEdge, middleEdge, lastEdge ]) # Part.show(Swire1) else: print "Found no Face?!" # there is a seam in the metal sheet. # Generate a new face for the seam. ''' b_wire = self.makeSectionWire(bend_edge, bend_node, bend_node.bend_dir).copy() topFace = Part.Face(b_wire) #self.f_list.append(topFace) topFace.rotate(self.f_list[bend_node.idx].Surface.Center,bend_node.axis,math.degrees(bend_node.bend_angle)) topFace.translate(trans_vec) flat_shell.append(topFace) ''' ''' # find the nearest vertex of bend_edge to a plane through s_Center # The section-wire should start at this vertex if (bend_edge.Vertexes[0].Point.distanceToPlane(s_Center, s_Axis) < bend_edge.Vertexes[1].Point.distanceToPlane(s_Center, s_Axis)): next_pnt = bend_edge.Vertexes[1].Point start_pnt = bend_edge.Vertexes[0].Point start_idx = 0 end_idx = 1 else: next_pnt = bend_edge.Vertexes[0].Point start_pnt = bend_edge.Vertexes[1].Point start_idx = 1 end_idx = 0 # find the nextEdge in the node faces search_List = bend_node.nfIndexes[:] search_List.remove(bend_node.idx) the_index = None next_idx = None for i in search_List: for theEdge in self.f_list[i].Edges: if len(theEdge.Vertexes)>1: if equal_vector(theEdge.Vertexes[0].Point, next_pnt): next_idx = 1 if equal_vector(theEdge.Vertexes[1].Point, next_pnt): next_idx = 0 if next_idx <> None: if self.isVertOpposite(theEdge.Vertexes[next_idx], bend_node): nextEdge = theEdge.copy() search_List.remove(i) the_index = i break else: next_idx = None if the_index <> None: break #find the lastEdge last_idx = None for i in search_List: for theEdge in self.f_list[i].Edges: if len(theEdge.Vertexes)>1: if equal_vector(theEdge.Vertexes[0].Point, start_pnt): last_idx = 1 if equal_vector(theEdge.Vertexes[1].Point, start_pnt): last_idx = 0 if last_idx <> None: if self.isVertOpposite(theEdge.Vertexes[last_idx], bend_node): lastEdge = theEdge.copy() search_List.remove(i) the_index = i break else: last_idx = None if the_index <> None: break # find the middleEdge for theEdge in self.f_list[bend_node.c_face_idx].Edges: if len(theEdge.Vertexes)>1: if equal_vector(theEdge.Vertexes[0].Point, start_pnt): last_idx = 1 if equal_vector(theEdge.Vertexes[1].Point, start_pnt): last_idx = 0 if last_idx <> None: if self.isVertOpposite(theEdge.Vertexes[last_idx], bend_node): lastEdge = theEdge.copy() search_List.remove(i) the_index = i break else: last_idx = None ''' b_wire.rotate(self.f_list[bend_node.idx].Surface.Center,bend_node.axis,math.degrees(bend_node.bend_angle)) b_wire.translate(trans_vec) #Part.show(b_wire) #for vert in b_wire.Vertexes: # print "b_wire1 tol: ", vert.Tolerance #for ed in b_wire.Edges: # print "b_wire1 tol: ", ed.Vertexes[0].Tolerance, " ", ed.Vertexes[1].Tolerance sweep_path = Part.makeLine(o_wire.Vertexes[0].Point, b_wire.Vertexes[0].Point) #Part.show(sweep_path) Bend_shell = Part.makeRuledSurface (o_wire, b_wire) # Part.show(Bend_shell) for shell_face in Bend_shell.Faces: flat_shell.append(shell_face ) #Part.show(self.__Shape.copy()) #print "finish genBendShell Face", bend_node.idx +1 return flat_shell def makeSeamFace(self, sEdge, theNode): ''' This function creates a face at a seam of the sheet metal. It works currently only at a flat node. ''' print "now make a seam Face" nextVert = sEdge.Vertexes[1] startVert = sEdge.Vertexes[0] start_idx = 0 end_idx = 1 search_List = theNode.nfIndexes[:] print "This is the search_List: ", search_List search_List.remove(theNode.idx) the_index = None next_idx = None for i in search_List: for theEdge in self.f_list[i].Edges: if len(theEdge.Vertexes)>1: if equal_vertex(theEdge.Vertexes[0], nextVert): next_idx = 1 if equal_vertex(theEdge.Vertexes[1], nextVert): next_idx = 0 if next_idx <> None: if self.isVertOpposite(theEdge.Vertexes[next_idx], theNode): nextEdge = theEdge.copy() search_List.remove(i) the_index = i #Part.show(nextEdge) break else: next_idx = None if the_index <> None: break #find the lastEdge last_idx = None print "This is the search_List: ", search_List for i in search_List: #Part.show(self.f_list[i]) for theEdge in self.f_list[i].Edges: print "find last Edge in Face: ", i, " at Edge: ", theEdge if len(theEdge.Vertexes)>1: if equal_vertex(theEdge.Vertexes[0], startVert): last_idx = 1 if equal_vertex(theEdge.Vertexes[1], startVert): last_idx = 0 if last_idx <> None: print "test for the last Edge" if self.isVertOpposite(theEdge.Vertexes[last_idx], theNode): lastEdge = theEdge.copy() search_List.remove(i) the_index = i #Part.show(lastEdge) break else: last_idx = None if last_idx <> None: break # find the middleEdge mid_idx = None midEdge = None for theEdge in self.f_list[theNode.c_face_idx].Edges: if len(theEdge.Vertexes)>1: if equal_vertex(theEdge.Vertexes[0], nextEdge.Vertexes[next_idx]): mid_idx = 1 if equal_vertex(theEdge.Vertexes[1], nextEdge.Vertexes[next_idx]): mid_idx = 0 if mid_idx <> None: if equal_vertex(theEdge.Vertexes[mid_idx], lastEdge.Vertexes[last_idx]): midEdge = theEdge.copy() #Part.show(midEdge) break else: mid_idx = None if midEdge: break seam_wire = Part.Wire([sEdge, nextEdge, midEdge, lastEdge ]) seamFace = Part.Face(seam_wire) self.f_list.append(seamFace) theNode.nfIndexes.append(self.max_f_idx) self.max_f_idx += 1 def showFaces(self): for i in self.index_list: Part.show(self.f_list[i]) def unfold_tree2(self, node): # This function traverses the tree and unfolds the faces # beginning at the outermost nodes. #print "unfold_tree face", node.idx + 1 theShell = [] nodeShell = [] for n_node in node.child_list: if self.error_code == None: theShell = theShell + self.unfold_tree2(n_node) if node.node_type == 'Bend': trans_vec = node.tan_vec * node._trans_length for bFaces in theShell: bFaces.rotate(self.f_list[node.idx].Surface.Center,node.axis,math.degrees(node.bend_angle)) bFaces.translate(trans_vec) if self.error_code == None: nodeShell = self.generateBendShell(node) else: if self.error_code == None: # nodeShell = self.generateShell(node) for idx in node.nfIndexes: nodeShell.append(self.f_list[idx].copy()) #if len(node.seam_edges)>0: # for seamEdge in node.seam_edges: # self.makeSeamFace(seamEdge, node) print "ufo finish face",node.idx +1 return (theShell + nodeShell) mylist = Gui.Selection.getSelectionEx() # print 'Die Selektion: ',mylist # print 'Zahl der Selektionen: ', mylist.__len__() if mylist.__len__() == 0: mw=FreeCADGui.getMainWindow() QtGui.QMessageBox.information(mw,"Error","""One flat face needs to be selected!""") else: if mylist.__len__() > 1: mw=FreeCADGui.getMainWindow() QtGui.QMessageBox.information(mw,"Error","""Only one flat face has to be selected!""") else: o = Gui.Selection.getSelectionEx()[0] print o.ObjectName if len(o.SubObjects)>1: mw=FreeCADGui.getMainWindow() QtGui.QMessageBox.information(mw,"SubelementError","""Only one flat face has to be selected!""") else: subelement = o.SubObjects[0] if hasattr(subelement,'Surface'): s_type = str(subelement.Surface) if s_type == "<Plane object>": mw=FreeCADGui.getMainWindow() #QtGui.QMessageBox.information(mw,"Hurra","""Lets try unfolding!""") print "name: ",subelement f_number = int(o.SubElementNames[0].lstrip('Face'))-1 #print f_number startzeit = time.clock() TheTree = SheetTree(o.Object.Shape, f_number) # initializes the tree-structure if TheTree.error_code == None: TheTree.Bend_analysis(f_number, None) # traverses the shape builds the tree-structure endzeit = time.clock() print "Analytical time: ",endzeit-startzeit if TheTree.error_code == None: # TheTree.showFaces() theFaceList = TheTree.unfold_tree2(TheTree.root) # traverses the tree-structure if TheTree.error_code == None: unfoldTime = time.clock() print "time to run the unfold: ", unfoldTime - endzeit try: newShell = Part.Shell(theFaceList) except: print("couldn't join some faces, show only single faces") for newFace in theFaceList: Part.show(newFace) else: try: TheSolid = Part.Solid(newShell) solidTime = time.clock() print "time to make the solid: ", solidTime - unfoldTime except: print ("couldn't make a solid, show only a shell, Faces in List: ", len(theFaceList)) Part.show(newShell) showTime = time.clock() print "Show time: ", showTime - unfoldTime else: Part.show(TheSolid) showTime = time.clock() print "Show time: ", showTime - solidTime, " total time: ", showTime - startzeit if TheTree.error_code <> None: print "Error ", unfold_error[TheTree.error_code], print " at Face", TheTree.failed_face_idx+1 QtGui.QMessageBox.information(mw,"Error",unfold_error[TheTree.error_code]) else: print "unfold successful" else: mw=FreeCADGui.getMainWindow() QtGui.QMessageBox.information(mw,"Selection Error","""Sheet UFO works only with a flat face as starter!\n Select a flat face.""") else: mw=FreeCADGui.getMainWindow() QtGui.QMessageBox.information(mw,"Selection Error","""Sheet UFO works only with a flat face as starter!\n Select a flat face.""") }}