Book Image

FreeCAD

By : Brad Collette, Daniel Falck
Book Image

FreeCAD

By: Brad Collette, Daniel Falck

Overview of this book

FreeCAD is a general purpose platform for CAD development. It can be extended to use different workbenches to solve different problems. Targeted squarely at the engineering community, FreeCAD is an open source design application built to be extended. Python, the powerful scripting language, is woven deeply into FreeCAD's DNA and gives users unprecedented power to automate and invent. "FreeCAD [How-to]" is a lean, fast tour of FreeCAD's major workbenches and design philosophy. The reader will get a hands-on introduction to several modeling techniques and learn how Python makes macro automation and design possible. FreeCAD allows users to design in a variety of ways; from drawing 2D designs as lines and circles to combining primitive solids into complex 3D shapes. Objects can even be created or modified by code you write in Python. FreeCAD even allows power users to extend the application itself with new dialogs, panels, and scripts. This book will not only show you how to get started using FreeCAD in a traditional GUI mode, but will teach you how to harness its powerful scripting language for more power.
Table of Contents (9 chapters)

Rotating and extruding to create parts (Should know)


2D drawings are converted into 3D models either by extruding them along an axis, or by rotating them around an axis.

Getting ready

Use the Draft workbench to draw a closed profile of a part. For our example, we're using the timing pulley profile from the Modeling a simple part with the Draft workbench (Must know) recipe.

How to do it...

  1. Switch to the Draft workbench.

  2. Select the wire and click on the Upgrade button to convert it to a face.

  3. Switch to the Part workbench.

  4. Press the Revoke a selected shape button:

  5. In the Revolve dialog, select the shape to rotate.

  6. Select the axis around which to revolve. For our example, use the Y axis. Leave the other settings unchanged and click on OK.

  7. The revolved object is added to the project.

How it works...

FreeCAD has two kinds of wire objects. Draft wires, called dwire in later versions, have additional features and properties on the Data tab. The wire used in our example contains arcs and is a regular wire. If you were to rotate the wire without upgrading it to a face first, the result you would see on screen would look exactly the same. However, the object would be a hollow shell. This can cause problems if you do additional Boolean operations. By rotating a face instead of a wire, the area swept out by the rotation is a solid.

Extruding an object works similarly. A shape is selected and parameters are given for the direction and distance to extrude. Applying an extrusion to our original wire gives a very different result.

The extrude and rotate tools in the Part workbench can be used on many kinds of objects including sketches. The kind of object produced depends on the original object.

Input shape

Output shape

Vertex

Edge

Edge

Face

Wire (closed)

Shell

Dwire

Solid

Face

Solid

Shell

Compound Solid

Sketch

Shell

The Part Design workbench has its own tools for rotating and extruding (called padding) sketches to create parts. The Part Design pad and rotation tools can only be used on sketches. They always create solids if the sketch is closed and will fail otherwise.

There's more...

FreeCAD has another tool for turning 2D geometry into 3D objects.

Lofting

Two or more wires can be used to define the bounds of a solid and the loft tool will create a solid by sweeping the area between them. In the following screenshot, two rectangular shapes were positioned one above the other and rotated slightly. The loft tool creates a twisted cuboid by connecting the two: