100% found this document useful (1 vote)
139 views478 pages

FreeCAD for Electronics Applications

The document is a book titled 'FreeCAD for Electronics Applications' by Dr. Thomas Duden, which serves as a practical introduction to 3D modeling for electronics projects. It covers various aspects of using FreeCAD, including creating parts, working with sheet metal, and assembling projects, with a focus on practical applications and efficiency. The author, who has a background in physics and experience in designing scientific instruments, emphasizes the importance of mastering FreeCAD for effective electronics design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
139 views478 pages

FreeCAD for Electronics Applications

The document is a book titled 'FreeCAD for Electronics Applications' by Dr. Thomas Duden, which serves as a practical introduction to 3D modeling for electronics projects. It covers various aspects of using FreeCAD, including creating parts, working with sheet metal, and assembling projects, with a focus on practical applications and efficiency. The author, who has a background in physics and experience in designing scientific instruments, emphasizes the importance of mastering FreeCAD for effective electronics design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 478

>

books
books books
books

FreeCAD for Electronics Applications – Dr. Thomas Duden


FreeCAD for
FreeCAD for
Electronics Applications Electronics Applications
Practical Introduction to 3D Modeling
Practical Introduction to 3D Modeling from
from Enclosure to Front Panel
Embedding a vintage component, creating a professional looking home Thomas Duden studied Physics
Enclosure to Front Panel
for a circuit board, or even designing a complex apparatus complete in Clausthal-Zellerfeld, where
he also received his PhD. For
with a chassis – these and many other challenges turn into a stimulating
research purposes, the experiments
pleasure with FreeCAD. Once you have internalized the basic processes, required the design of many
there are virtually no limits to your imagination. instruments. These developments
also included electronics (mainly
Starting to use a new software is never straightforward – especially with stable high voltage and current
sources), programming of PCs
a tool as versatile as FreeCAD. Manageable, but at the same time easily
and microcontrollers plus the
usable individual components provide the starting point in this book. calculation of electron-optical
Putting these components together later results in assemblies. components with their aberrations.
Meanwhile, mechanical designs
In the FreeCAD universe, a workable trajectory is demonstrated. The covered ultrahigh vacuum systems,
components for electron microscopy
described procedure is illustrative so the examples are easily applied
and diffraction instruments, often
to custom tasks. The devices were made by the author and illustrated in combination with spin-polarized
with photos. electron beams. Longer work
phases abroad took place at the
Creating a 3D design is requiring some effort but the initial investment pays IBM Almaden Research Center
(San Jose), at Arizona State
off soon. Besides the impressive spatial representation of the projects, the
University, and at the National
extracted drawings yield a solid base for documentation and production. Center for Electron Microscopy of
Extended FreeCAD capabilities like the unfolding of sheet metal parts the Lawrence Berkeley National
enormously add to efficiency and pushes models forward into practical Laboratory. Thomas Duden obtained
assembly. his ham radio license at the age of 16
and currently operates a consulting
service for the development of
Soon you will definitely not want to do without FreeCAD! scientific instruments.

www.elektor.com

Dr. Thomas Duden

SKU20591_COV_FreeCAD for Electronics Applications.indd All Pages 29/08/2023 11:31


FreeCAD for Electronics
Applications
Practical Introduction to 3D Modeling from
Enclosure to Front Panel

Dr. Thomas Duden

FreeCAD for Electronics Applications.indd 3 24-08-2023 14:29


● This is an Elektor Publication. Elektor is the media brand of
Elektor International Media B.V.
PO Box 11, NL-6114-ZG Susteren, The Netherlands
Phone: +31 46 4389444

● All rights reserved. No part of this book may be reproduced in any material form, including photocopying, or
storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this
publication, without the written permission of the copyright holder except in accordance with the provisions of the
Copyright Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licencing Agency
Ltd., 90 Tottenham Court Road, London, England W1P 9HE. Applications for the copyright holder's permission to
reproduce any part of the publication should be addressed to the publishers.

● Declaration
The author, editor, and publisher have used their best efforts in ensuring the correctness of the information contained
in this book. They do not assume, and hereby disclaim, any liability to any party for any loss or damage caused by
errors or omissions in this book, whether such errors or omissions result from negligence, accident or any other cause.
All the programs given in the book are Copyright of the Author and Elektor International Media. These programs
may only be used for educational purposes. Written permission from the Author or Elektor must be obtained before
any of these programs can be used for commercial purposes.

● British Library Cataloguing in Publication Data


A catalogue record for this book is available from the British Library

● ISBN 978-3-89576-574-2 Print


ISBN 978-3-89576-575-9 eBook

● © Copyright 2023: Elektor International Media B.V.


Editors: Alina Neacsu; Jan Buiting MA
Prepress Production: D-Vision, Julian van den Berg
Print: Ipskamp Printing, Enschede (NL)

Elektor is the world's leading source of essential technical information and electronics products for pro engineers,
electronics designers, and the companies seeking to engage them. Each day, our international team develops and delivers
high-quality content - via a variety of media channels (including magazines, video, digital media, and social media) in
several languages - relating to electronics design and DIY electronics. www.elektormagazine.com

●4

FreeCAD for Electronics Applications.indd 4 24-08-2023 14:29


Contents

Contents
Chapter 1 ● Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Chapter 2 ● Starting Out With FreeCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.1 Extending the Functionality of FreeCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.1.1 AddOns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.1.2 Workbenches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.1.3 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.1.4. Starting the new Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.2 Workbenches and Context Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.3 Automatic Workbench Switchover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.4 The Tree View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.5 The Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Chapter 3 ● Project Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.1 Std-Part-Container versus Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.1.1. Placement versus Attachment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.1.2 Assembly or Std-Part-Container? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.2 The Topological Naming Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.3 Sketches and Datum Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.4 Other Strategies to Avoid the Topological Naming Problem . . . . . . . . . . . . . . . . . 19

3.5 Avoidance of Repetitive Work by Project Structure . . . . . . . . . . . . . . . . . . . . . . . 19

3.6 Always Start with the Std-Part-Container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.7 Shape Binder and SubShapeBinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.7.1 The Shape Binder (blue) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.7.2 The SubShapeBinder (green) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.7.3 How to Reference Cut-and-Pasted Std-Part-Containers . . . . . . . . . . . . . . . . . . . 22

3.7.4 Redefining the References after Paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Chapter 4 ● Creating Parts — First Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

4.1 How Much Fidelity is Needed? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

4.2 Simple Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

4.2.1 The Simple Spacer, Step by Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

4.3 Color versus Appearance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

●5

FreeCAD for Electronics Applications.indd 5 24-08-2023 14:29


FreeCAD for Electronics Applications

4.4 Compound Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.4.1 Fasteners for the Simple Spacer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.5 Parts Packaged with Fasteners Save Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

4.6 Displaying and Hiding Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

4.7 More Examples of Compound Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Chapter 5 ● Working with Sheet Metal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.1 Example: 9 V 6LR61 Battery Holder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.2 Creating the Unfold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

5.3 Exporting the Unfold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

5.4 Creating a Drawing of the Battery Holder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.5 Create a Plan for the Bending Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

5.6 Example Photos of the Battery Holder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

Chapter 6 ● Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

6.1 “Assembly” Workbenches or Std-Part Container? . . . . . . . . . . . . . . . . . . . . . . . . 88

Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel
Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

7.1 Project Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

7.2 Preparation – Starting the New Project Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

7.3 Modeling the Front panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

7.4 Insertion of the Rotary Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

7.5 Generate an Associative Footprint with the SubShapeBinder . . . . . . . . . . . . . . . . 96

7.6 The Knob and its Place in the Tree View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

7.7 Testing the Associativity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

7.8 The Binding Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

7.9 Placement of the Panel Meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

7.10 Placing Components to the Rear Surface: The Anchor Plates . . . . . . . . . . . . . . 123

7.11 Inserting the Battery Holder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

7.12 Inserting the Circuit Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

Chapter 8 ● Finalizing the Front Panel with Graphic Elements . . . . . . . . . . . . . . . 148

8.1 Drawing Guide Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

8.1.1 Sketch versus Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

8.1.2 Guide Lines for the Rotary Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

●6

FreeCAD for Electronics Applications.indd 6 24-08-2023 14:29


Contents

8.2 A Guide Line for the Potentiometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

8.3 The Engravings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

8.4 The 'TechDraw' Workbench and the DXF Export . . . . . . . . . . . . . . . . . . . . . . . . 170

Chapter 9 ● A More Complex Design: The Lab Transformer . . . . . . . . . . . . . . . . . 174

9.1 The Front Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

9.1.1 Setting up File and Std-Part-Container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

9.1.2 Creating the Panel Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

9.1.3 Placement of the Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

9.1.4 Punching the Holes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

9.1.5 Adding the Engraving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

9.2 The Rear Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

9.2.1 Prepare File and Std-Part-Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

9.2.2 Placing the Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

9.2.3 Punching the Holes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

9.2.4 Adding the Engraving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

9.3 The Chassis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

9.3.1 Preparation of File and Std-Part-Container . . . . . . . . . . . . . . . . . . . . . . . . . . 211

9.3.2 Bolts for the Chassis Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

9.4 Assembling the Chassis, Front and Rear Panel . . . . . . . . . . . . . . . . . . . . . . . . . 231

9.5 Placing the Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

9.6 Placing the Anchor Plates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

9.7 Associative Generation of the Sheet Metal Cover . . . . . . . . . . . . . . . . . . . . . . . 252

9.7.1 Where to Pick the References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

9.7.2 Creating the Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

9.8 Where do the Fasteners Belong? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278

9.8.1 Fasteners for the Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278

9.8.2 Fasteners for the Chassis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

9.8.3 Fasteners for Front and Rear Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

9.9 Creating the Unfold of the Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

9.10 Example Photos – Meeting the Reality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

9.11 What to do Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

9.12 Component Libraries – Design Recycling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

●7

FreeCAD for Electronics Applications.indd 7 24-08-2023 14:29


FreeCAD for Electronics Applications

9.13 Importing STEP Model Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

Chapter 10 ● FreeCAD and KiCad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

10.1 Importing Data from KiCad to FreeCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

10.2 Creating 3D Models for KiCad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

Chapter 11 ● Community Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

Appendix A ● The Rotary Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

Appendix B ● The Potentiometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

Appendix C ● The Banana Jack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

Appendix D ● The Pilot Lamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362

Appendix E ● The Toggle Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400

Appendix F ● The IEC Power Inlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433

Appendix G ● The 9 V Block (6F22) Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474

●8

FreeCAD for Electronics Applications.indd 8 24-08-2023 14:29


Chapter 1 ● Introduction

In the world of modern mechanical design, 3D tools have become an indispensable re-
source. They allow the interactive modeling of instrument cases and compartments, control
elements, as well as the complex arrangements of all bits and pieces that form a complete
apparatus. During the design process, the packing density of components can be max-
imized, which saves volume. Alongside this process, it can be verified that no collisions
between the different parts occur. This saves time and disappointment, when the assembly
is completed later on, meeting with the real world.

For the longest time, 3D design tools have been available only to commercial businesses,
which were able to spend 5-digit amounts for acquisition and maintenance. For students,
academic packages exist at more affordable price tags, as well as floating campus licenses.
In contrast, private users and hobbyists did not enjoy easy access to these tools.

Especially during the last decade, suppliers of circuit boards opened business to private
customers, and the availability of 3D printers at affordable prices dramatically increased.
Bundled together with interesting software, this propelled a wide distribution of 3D print-
ing technology. With these advances, the community developed two remarkable software
projects, which have meanwhile matured into a highly useful state: KiCad for circuit boards
and FreeCAD for mechanical design work. KiCad allows, besides the design of the sche-
matic and the circuit board, also the export of step models — an exciting interface to the
mechanical world, which can be used to introduce the 3D circuit board models directly into
mechanical designs.

This book is intended to deliver a useful take-off angle for technologists who were main-
ly developing electronics before and want to extend their designs towards a mechanical
framework. It can by no means be a complete description of the FreeCAD universe, which
has countless facets and extensions. Also, with a complex tool like FreeCAD, there usually
exist many ways to achieve a result. With that in mind, the special pathways to the exam-
ples in this book are given for the reader's reference and experimentation, and to ease the
start of their learning process with the software.

Usually, integrating a circuit board into a compartment, or a little chassis, only requires a
minor subset of FreeCAD's possibilities. Therefore, the focus will be cast onto some small,
but typical projects: The design of a front panel, or the assembly of a simple apparatus with
front- and back panels, chassis, and cover. Once these design processes are mastered, the
extension to more complex applications is straightforward. Following the described path-
ways should allow the successful assembly of the projects later on, with hopefully not too
many surprises.

All examples, also the circuit board design, are electronically available in the supplement-
ed materials online. Fully appropriate in the spirit of FreeCAD they can be modified, freely
shared, and used.

●9

FreeCAD for Electronics Applications.indd 9 24-08-2023 14:29


FreeCAD for Electronics Applications

In this book, as one example, the assembly of a small lab safety transformer is described.
Here is an important statement concerning the use of electricity:

According to VDE code, voltages exceeding 50 VAC or 120 VDC constitute life-threatening
hazards. Only trained and certified electricians are allowed to do the electrical work should
a project be put forward towards practical implementation.

● 10

FreeCAD for Electronics Applications.indd 10 24-08-2023 14:29


Chapter 2 ● Starting Out With FreeCAD

Chapter 2 ● Starting Out With FreeCAD

FreeCAD is available nowadays in the package management systems and repositories of


some Linux distributions. In this book, FreeCAD 0.20 will be used on a Tumbleweed plat-
form from openSUSE. It is, however, also possible to install FreeCAD on the Microsoft Win-
dows® operating system.

Figure 2-1

The functionality of FreeCAD is grouped into different workbenches. The selection of


workbenches is contained in the Combo Box (Figure 2-1). The most frequently used
workbenches in this book are Part Design to create 3D Objects, and Part, mainly for the
attachment of 3D objects during an assembly. Sometimes, Draft will be utilized to generate
geometry and character contours for engraving, and TechDraw for the extraction of draw-
ings from the models, as well as for the DXF export of data to the milling machine. For sheet
metal parts, the add-on called Sheet Metal by Shai Seeger will be used, and the placement
of fasteners is exercised with the extension called BoltsFC.

2.1 Extending the Functionality of FreeCAD


We will start off with the installation of the extensions that will be used in this book. The
way of installing the extensions depends on the form in which they are available (e.g.,
macro or workbench). Most conveniently, add-ons are installed with the integrated Ad-
dOn-Manager (Figure 2-2).

● 11

FreeCAD for Electronics Applications.indd 11 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 2-2

2.1.1 AddOns
In order to operate the AddOn Manager, a connection to the internet is required. The AddOn
Manager is started by selecting Tools | AddOn Manager from the main menu. A warning ap-
pears, which states that the offered extensions are not checked or approved by the FreeC-
AD developer team. After acknowledging the warning with OK, a world of interesting addi-
tional functionality opens which is made available by the user community at no charge. This
may be a good moment to reflect on reciprocating action to these impressive gifts later.

2.1.2 Workbenches
For working with sheet metal, we select the Sheet Metal workbench from Shai Seeger from
the list. When the list entry is clicked, a partly animated description of the new functionality
is presented. Take some time and scroll down the window to enjoy the collected information
and source citations for further reading. Clicking the Install button at the top right of the
AddOn Manager installs the workbench, very similar to the app stores on a smartphone.
A convenient luxury! The workbench is then listed in the Combo Box of the main window
(Figure 2-1).

2.1.3 Macros
Whereas the installation of the Sheet Metal workbench went quasi fully automated, the
next extension requires a small intervention, before it can be used. The additional step is
also described in the online documentation for BoltsFC, which is displayed in the AddOn
Manager window.

● 12

FreeCAD for Electronics Applications.indd 12 24-08-2023 14:29


Chapter 2 ● Starting Out With FreeCAD

If not already done, please click the Back button in the AddOn Manager (top left, the arrow
pointing to the left side), in order to return to the main selection page. Then select BoltsFC
and click the Install button again.

To render BoltsFC usable, the downloaded macro has to be manually installed. In order to
retrieve the file, activate the display of hidden files in your file manager. Then, navigate to
'\home\username\.local\share\FreeCAD\Mod\BOLTSFC' and look for the file 'start_bolts.
FCMacro'. Copy this file into the location:
\home\username\.local\share\FreeCAD\Macro\

Unfortunately, with Windows© systems, the installation of BoltsFC is not as easy. As an


alternative, consider installing the Fasteners workbench and use that instead. [FRE 2023].

2.1.4. Starting the new Extensions


Whereas workbenches, like the previously installed Sheet Metal workbench, are launched
by selecting the corresponding entry from the Combo Box of the main window (Figure 2-1),
the BoltsFC macro is executed by selecting Macro from the list in the main menu entry
Macro | Recent Macros.

2.2 Workbenches and Context Menus


The amount of functionality present in FreeCAD necessitates the splitting into various work-
benches. In each selected workbench, only certain menu entries and tool buttons will be
visible — FreeCAD would be difficult to handle and probably rendered unusable if this would
not be the case. Because of this separation of functionality, it is important to remember
the current workbench selection. Sometimes, a function or menu button cannot be found.
If this is the case, check the workbench selection as that may reveal the cause. Some of
the workbenches are not compatible with each other. Luckily, it is only rarely necessary to
swap between them.

The workbench concept can be frustrating when you start out using FreeCAD. However, this
is just a matter of exercise and will quickly get easier after you have used the program for
some time.

2.3 Automatic Workbench Switchover


Only some workbenches are automatically selected. For example, if a blue 'body' icon
is double-clicked in the tree view of the model. FreeCAD will then select the Part Design
workbench.

The same is true for the Sketcher workbench, when you click the Sketcher tool button (in
Part Design), or you double-click a sketch in the tree view. These switchovers are invoked
by the selection of corresponding tasks and follow the user entry in a straightforward way,
so there is little probability for confusion with missing tool buttons or the changed context
menu.

● 13

FreeCAD for Electronics Applications.indd 13 24-08-2023 14:29


FreeCAD for Electronics Applications

2.4 The Tree View


On the left-hand side of Combo View (Figure 2-3), when you select the tab Model, the
project hierarchy is depicted in the shape of a tree view. Std-Part-Containers are shown in
yellow, and the bodies of 3D geometry are shown in blue.

Figure 2-3

In the tree view, each object can be expanded to inspect the components it contains. If a
body object is expanded, all invisible entries of its structure list appear grayed out (Figure
2-3, Tree View). It is possible to display or hide every object in the tree view by marking
the listed entry and pressing the SPACE key. The reaction of FreeCAD will be different,
depending on the category of the selected object: Sketches, datum planes or other ref-
erence objects will be shown or hidden as intuitively expected. This is, however, different
with generated 3D geometry within a body. The last state of the body design, called 'tip'
(imagine the visible tip of an iceberg), will turn gray if an earlier state of the body design is
made visible. Marking such a state, and subsequent pressing of the SPACE key, reverts the
view up to the selected, now displayed design step. All later steps, including the previous
tip, are then hidden (grayed out) and suppressed. In this way, changes can be invoked on
the selected, earlier design step. After completion of the modification, it is good practice to
activate the tip for display again so that all details following the change are invoked again.
Possibly, some other, later, design features will then show the need for changes as well. If
you omit displaying the tip again, and possibly collapse the view of the modified body, this
can lead to confusing situations when, for example, some details of the assembled object
appear to have vanished.

● 14

FreeCAD for Electronics Applications.indd 14 24-08-2023 14:29


Chapter 2 ● Starting Out With FreeCAD

2.5 The Output Window


The output window is located at the bottom of the main window. There, warnings and error
messages are listed. Warnings can be triggered, for example, by scope violations when
references across the boundaries of objects are asserted. Even though the design and its
associative properties could function properly despite these warnings, it is good practice to
investigate the root cause for their appearance and proceed to provide a suitable remedy.
Whereas warnings are displayed in orange, errors are listed in red. Some error messages
result from temporary issues — possibly, a figure for a dimension was typed in as a number
without units, which is the normal procedure during practical work. FreeCAD, in this case,
will supply the missing unit(s) automatically.

The output window can be emptied of accumulated messages by right-clicking into the
window and selecting Clear from the context menu. After that, it is advisable to initiate a
recalculation, in order to find out whether an error message or warning persists. Objects
which received changes are not always recalculated automatically. To make sure this hap-
pens, right-click on the questionable object in the tree view and manually select 'Mark for
recalculation' from the context menu. Otherwise, you could conclude that some changes
resolved an error that reoccurs later on (when the whole object is recomputed for some
other reason). This can cause headaches when working on several things concurrently.

● 15

FreeCAD for Electronics Applications.indd 15 24-08-2023 14:29


FreeCAD for Electronics Applications

Chapter 3 ● Project Organization

When starting a new design project with FreeCAD, it pays to reflect on its organization right
from the start. This prevents the project from turning into a mess with too many items
residing at the same hierarchy level in the tree view. Also, a lot of extra work can result
from inserting a component into a project (like a bunch of spacers) and adding the associ-
ated screws later, one by one. The goal of a properly organized project is not only to view
a nicely pruned project tree but also to prevent many repetitive tasks when finalizing the
design with all its cosmetic additions.

Furthermore, the structuring consideration “what belongs to whom?" is useful to move re-
lated objects together within the context of a larger assembly. When, for example, far down
the project a potentiometer is shifted, and miraculously the mounting holes in the front panel
follow, as well as the engraving and the control knob, then the highly desirable state of asso-
ciativity has reached perfection. This is very useful for achieving, for example, enclosure vol-
ume optimization together with an agreeable front panel design. On top of it, the probability
of errors is minimized because none of the relevant, now coupled, details can be forgotten.

If a project structure is changed later in the process, the tools to do so naturally exist. But
changes of this nature, like moving objects between different Std-Part-Containers, could
result in unexpected side effects like the invalidation of references at object scope bound-
aries. These surprises, and strategies for their prevention, will be examined in some depth
later, when the more complex assemblies are described.

3.1 Std-Part-Container versus Body


The design of an individual part as well as that of an assembly, should always start with
the generation of a new Std-Part-Container. This choice is not automatically invoked by
FreeCAD. It is also possible but less useful to start with a new body object right away (for
example, when the project consists of only of this one piece of material). The initial choice
to generate the Std-Part-Container may look like an unnecessary complication at first. But
it buys a lot of convenience later: All bodies which are inserted into the new Std-Part-Con-
tainer are placed inside their own, encapsulated coordinate system. Right from the start,
they can therefore be moved together by just affecting the references of the enclosing
Std-Part-Container, even when the contained bodies themselves have no other relations
with each other. The placement of the contained objects can be manipulated by changing
their position and angles in the Property list. To do this, expand the Placement property and
click on the Value field that you want to modify. A slight touch of virtual reality is delivered
with the possibility to change the selected property by turning the mouse wheel — the live
update of the 3D view is excitingly close to actually touching the object itself!

In FreeCAD, every Body (not: everybody ) can consist of just one continuous piece of
material. This is not a limitation for the creation of a complex part though, because the
Std-Part-Container can contain many bodies. If pockets and other subtractive features are
designed into one body, it is important that the actual object is not separated into multi-
ple pieces by the removal of the material, as that would trigger an error message and be
aborted as a process.

● 16

FreeCAD for Electronics Applications.indd 16 24-08-2023 14:29


Chapter 3 ● Project Organization

When a part is finished, consider inserting it into another assembly by just copying and
pasting its enclosing Std-Part-Container. All the locally defined placement and attachment
parameters are preserved by this move. Nevertheless, they can be modified by accessing
the corresponding items in the Property list, for example, to turn a potentiometer control
knob, or flip a toggle switch.

3.1.1. Placement versus Attachment


As already mentioned, newly generated bodies are initially only placed in the enclosed
Std-Part-Container. Two ways to manipulate the placement parameters work. You can ei-
ther expand the line Placement and enter values into the corresponding edit fields (or use
the mouse wheel) as described above. Alternatively, you can click into the edit field which
lines up with the label Placement. This click triggers the appearance of a small button. If
you click that, a task window opens, in which the values for the placement parameters can
be accessed as well. The task window needs to be closed with the OK button when done.

Alternatively, you can decide to attach a body to another body within the container. In
order to define an attachment, it is necessary to switch to the 'Part' workbench. Next, the
body to be attached has to be marked in the tree view. On selection of 'Part | Attachment'
from the main menu, a task window opens in which the attachment relation can be defined.
The attachment overrules the prior placement, which therefore appears gray in the proper-
ty list of the body once the attachment relation is in place.

When defining an attachment relation, a placement needs to be selected (e.g., 'On plane'
or 'Concentric'). This method resembles the creation of an assembly, the only difference
being that the related objects are bodies and that the scope is limited to the enclosing
Std-Part-Container. More precisely, the scope of an individual body is already encapsulated
with respect to another body in the same Std-Part-Container. With the aid of a reference
object, the 'Shape Binder', these boundaries can be made transparent for some references,
as described below.

Once the attachment has been defined (or even an attachment definition was unsuccess-
fully canceled), a special section, with the heading 'Attachment', appears in the property
list of that body. In that section, it is possible to access the 'Attachment Mode' task window
by clicking into the 'Value' field of the 'Map Mode' line and issuing a subsequent click the
button appearing in that field. This opens a task window in which the attachment mode
is changed by the selection from the list, and by the entry of suitable offsets and rotation
angles below.

Clicking on the 'Support' field in the same way opens the 'Link' dialog, in which a reference
object can be selected to which the attachment is intended to relate. Because it is possible
to relate to more than one reference object, it is important to remember that the previous
reference is not removed automatically if you pick a new one. If you want to abandon the
old reference, mark the highlighted entry in the list and click the 'Clear' button. If you
clicked in error somewhere and wish to revert to the initial reference, you can click the
'Reset' button. To set a new reference object, after having cleared the old ones, just mark
it in the list and click 'OK' to close the 'Link' dialog.

● 17

FreeCAD for Electronics Applications.indd 17 24-08-2023 14:29


FreeCAD for Electronics Applications

Embedding multiple bodies in one Std-Part-Container also make great sense to provision
fasteners to a part. Fasteners are often needed to fix it to a real assembly and include items
like screws, washers, and nuts. The supplied attachment modes including the concentric
orientation, allow the quick and associative arrangement of items like washers directly at
the edge of mounting holes or material boundaries.

3.1.2 Assembly or Std-Part-Container?


In version 0.20.1, FreeCAD lacks an official assembly workbench. However, a Std-Part-Con-
tainer can also contain more Std-Part-Containers. This offers the possibility to construct an
assembly merely from a set of nested Std-Part-Containers, with their relationships defined
as described in the preceding paragraph. In principle, these are all the tools needed to
furnish assembled designs. Throughout this book, this is the preferred method. As a result
of each design step, a Std-Part-Container is again generated, which offers a high degree
of portability and compatibility. Other methods to generate assemblies will be discussed in
Chapter 6.

3.2 The Topological Naming Problem


Chugging on happily in 3D land, you are likely to bump into a severe but manageable limi-
tation of FreeCAD (which you may sometimes even find with the commercial systems): The
core system enumerates all facets of the generated 3D geometry. This in itself would go
mainly unnoticed if there wasn't any chance of an unexpectedly triggered re-enumeration.
Triggering events include the deletion of a chamfer or fillet.

Even that would again be harmless if there was no detail referenced to a certain facet, e.g.,
a hole in the end face of a cylinder. After the re-enumeration, the former reference number
of that end face could be assigned to any other facet, taking the hole with it to an unexpect-
ed site. If worse comes to worst, the hole (if not the whole part) is rendered impossible to
generate, and error messages pile up in the output window. The former design breaks and
can only be recovered by redefining all the affected references one by one.

Such events can be quite nerve wrecking and time consuming. Luckily, the appearance of
these phenomena can be fenced to some degree by safeguards and strategies that will be
described below.

3.3 Sketches and Datum Objects


One way out of this topological misery can be taken by the definition of datum objects.
These objects, as well as references pointing to them, are not affected by re-enumeration.
Furthermore, references to sketches or parts thereof — like individual contours or curves
— also survive the number storm. Unlike jumping from facet to facet in 3D land, it is a bit
harder to climb up the geometry mountains when nailing in these safety anchors.

The additional effort can pay dividends if the defined planes refer to important design pa-
rameters like the length of a spacer. In this case, it could be sufficient to change just that
parameter in order to generate many variants later. Besides this straightforward concept,
in a complex project, it would also suffice to reposition many related parts by changing just
one number. It is obvious that the associativity empowered by these assignments plays an

● 18

FreeCAD for Electronics Applications.indd 18 24-08-2023 14:29


Chapter 3 ● Project Organization

important role when, for example, the volume of a module needs to be minimized, or some
other part needs to be inserted in between during the design update.

3.4 Other Strategies to Avoid the Topological Naming Problem


It will not always be feasible to strictly avoid references to generated facets. One pragmatic
strategy could be to define all principal shapes of a part until no noticeable need for addi-
tions exists anymore. An exception from this could include the adaption of certain dimen-
sions. Only then, cosmetic features like chamfers or fillets should be added — they usually
lead to many, newly generated facets. But here, too, a major pitfall lurks: for example, in
case an altered dimension leads to the loss of a major detail — like a surface on the prin-
cipal shape — a re-numeration could be triggered, which irreversibly breaks the design.
'Irreversible' in the sense that even clicking the helpful 'Undo' button will not restore the
previous shape anymore. In that case, all earlier design steps of the affected body need to
be reviewed and their references updated manually — one by one.

3.5 Avoidance of Repetitive Work by Project Structure


The previously described situation demonstrates an obvious idea: It is meant to divide a
project into many easy-to-overlook, separate parts. Each of these could be defined and
finalized in its own Std-Part-Container before the sphere of larger assemblies is entered.
On the side, these separate parts, saved into individual files, can be grouped, and subse-
quently stored to form a nice and valuable library of design resources that saves a lot of
time later on. This does not limit the option to modify an individual instance of such a part
when it is copied into an assembly.

3.6 Always Start with the Std-Part-Container


As a golden rule in the making: The Std-Part-Container should always be your first step,
which is very easy to do: start a new file by selecting 'File | new' from the main menu and
save it with a descriptive name. As the initial step, switch to the workbench 'Part Design'
and click the yellow 'Part' tool button (Figure 3-1). In the tree view, the yellow icon of the
Std-Part-Container appears. The title of this container can be changed by a right-clicking
it, and the selection of 'Rename' from the Context Menu. Alternatively, it can be edited by
pressing the F2 key once the container has been marked in the tree view. Using a descrip-
tive name is rewarding even though it may seem superficial at times, because you will use
Copy and Paste later on to insert the Std-Part-Container into assemblies. Watch out where
the mouse points to when you press F2. If the mouse points into the 'Description' column of
the tree entry (which is not visibly separated below), the cursor will appear in that column,
which can be confusing. To delete unwanted input from the 'Description' column, just point
the mouse to it again and press F2 to access the entry.

● 19

FreeCAD for Electronics Applications.indd 19 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 3-1:

It's also possible to start off with a single, new body object right away. This, however, would
block many opportunities for structuring the project with special appearance attributes,
various placement options, and others. For example, a rocker switch could have a casing
made of black plastic, a movable actuator, which could be red and transparent, and con-
tacts, which could appear metallic and shiny.

Also, operations like the projection of sketches to curved surfaces required for, say, letter-
ing on switch actuators, will generate new body objects. These should be grouped together
with the body in an enclosed Std-Part-Container to allow easy insertion of the part into
assemblies later on.

3.7 Shape Binder and SubShapeBinder


When a project is assembled from different Std-Part-Containers, there is sometimes the
necessity to modify a part in relation to others. An example of such a 'creative carving'
process is the insertion of openings into a front panel, which relate to the contours of the
corresponding control elements placed on it. An associative relation between the mounting
holes and the control elements implies communication between body objects residing in
different Std-Part-Containers. Because the scope for such details is very limited, special
reference objects exist which allow making the connection across Std-Part-Container and
body limits: The Shape Binder (blue icon) and the SubShapeBinder (green icon).

● 20

FreeCAD for Electronics Applications.indd 20 24-08-2023 14:29


Chapter 3 ● Project Organization

3.7.1 The Shape Binder (blue)


The Shape Binder is always created in an activated body object. The body can be activated
by double-clicking its tree view entry. In the activated state, the title of the body will ap-
pear in bold letters in the tree view. If it was forgotten to activate one, FreeCAD presents a
dialog, from which a body can be selected. As an alternative, listed in the selection dialog,
the creation of a new body object could also be chosen, into which the new Shape Binder
is subsequently placed.

With a valid selection, be it in tree view or in the selection dialog, a task window opens for
the definition of the Shape Binder. This task window contains two collectors, one named
Object and one named Add Geometry. Each collector is activated by clicking its button,
which turns dark gray. Then the entry field next to the button needs addressing by another
click into it — the rim of it turns blue. This multi-click feature is a thing to get used to.

If the collector called 'Object' is chosen, it is possible to switch the Combo View tab to 'Mod-
el' — with the task staying alive. In the tree view, sketches or datum planes can be selected
even when they are currently hidden from the 3D view. Also, objects, which may be difficult
to pick from the 3D view, can be selected in the tree view with greater ease. Alternatively,
it is possible to point and click details from the 3D view directly. After one item has been
selected, it will be listed in the 'Object' field of the task window. Then, in the second step,
the 'Add Geometry' button allows the selection of the desired detail.

Often, clicking the collector 'Add Geometry' is sufficient for updating 'Object' and 'Geome-
try' list entries simultaneously, for example, when borders or facets of an object in the 3D
view are selected. It is also possible to add multiple details of an object to the 'Geometry'
list. In order to do so, the 'Add Geometry' button must be clicked each time again to enable
the next selection. Importantly, Sketches do not need to be selected as an entity only —
also individual contours from a sketch can be picked, e.g., the mounting holes of a complex
footprint.

Finally, the task window can be closed with the 'OK' button. In this book, a constant effort
is made to name each item in the tree view with a self-explanatory name. This is also good
practice for shape binders — and makes it easy to understand the concepts embedded in a
design, also after months, if not years, of lying dormant in the project folder.

If shape binders get momentarily piled up in a hasty manner, their references can be dis-
played or hidden in the 3D view like any other object for identification (mark them in the
tree view and press the SPACE key). The other way also works — if a Shape Binder receives
a click in the 3D view, FreeCAD will expand the tree view and expose the corresponding,
highlighted item.

Last but not least, the Shape Binder does not follow changes of the referenced object auto-
matically, unless its property 'Trace Support' in the property list is set to 'true'.

● 21

FreeCAD for Electronics Applications.indd 21 24-08-2023 14:29


FreeCAD for Electronics Applications

3.7.2 The SubShapeBinder (green)


In contrast to the Shape Binder, the SubShapeBinder (green icon) can also be generated
outside of bodies or Std-Part-Containers.

The selection of the referenced objects also differs: At first, the detail is selected by marking
it in the 3D view or tree view. Multiple details can be selected as well by holding down the
CTRL key and marking all of them. Only then, the green tool button 'Create a sub object(s)
shape binder' from the workbench menu should be clicked. The green SubShapeBinder ob-
ject icon then appears either in the branch of an activated body object, Std-Part-Container
or — if none was activated — in the root node of the tree view.

The SubShapeBinder could also reference objects from external files — but in this book,
you will not utilize this option. By default, the SubShapeBinder is always actively tracking
its reference. You can change its behavior using the property 'Bind Mode'. The default value
'Synchronized' can be changed to 'Frozen' to disable the tracking, or to 'Detached', in order
to copy the referenced shape once, and reference the independent copy only.

The SubShapeBinder can show slightly unexpected behavior when it is referencing a plane
(or a datum plane), e.g., the XY plane of an object. When the Std-Part-Container, in which
the SubShapeBinder resides, is attached later to a plane of different orientation (e.g., the
YZ-Plane of the assembly into which it is embedded), then the SubShapeBinder will retain
its original orientation literally (e.g., reference the XY plane of the assembly). In contrast,
the blue Shape Binder with activated 'TraceSupport' will follow these transformations, albeit
with different side effects, as discussed later.

3.7.3 How to Reference Cut-and-Pasted Std-Part-Containers


The supplemented materials include a small sample project allowing the effects of the dif-
ferent types of shape binders to be studied. The file location is: 'Sample Projects | Shape
Binder Test | Test Front Panel.FCStd'. It contains a front panel and two pilot lamps attached
in different ways. The blue pilot lamp uses the Shape Binder, and the green one the Sub-
ShapeBinder. The two pilot lamps each have a fastener on the back side, and the Shape
Binders reference the position of these fasteners with respect to the pilot lamp body.

The 'Trace Support' property of the blue Shape Binder is convenient. In the Std-Part-Con-
tainer of the blue pilot lamp, the fastener is added such that it follows the position of the
pilot light casing body. This seems a bit fancy in this example case with only one single fas-
tener but makes more sense if there are more parts in the Std-Part-Container, like multiple
stacked nuts and washers, and multiple mounting holes.

If the Std-Part-Container of the blue pilot lamp is inserted into the project by cut-and-paste,
the Shape Binder reference breaks up and an error message is produced (Figure 3-2):

● 22

FreeCAD for Electronics Applications.indd 22 24-08-2023 14:29


Chapter 3 ● Project Organization

Figure 3-2:

<Exception> Global placement cannot be calculated on recompute


Recompute failed! Please check report view.

In contrast, if a SubShapeBinder reference is used as with the green pilot light, no error
message results.

A simple and often sufficient method to resolve these issues consists of omitting the at-
tachment of supplementary parts and fasteners, and simply leaving them inside the just
placed enclosing container. Then, however, all of these parts have to be taken to their final
positions in the assembly manually, one by one.

Alternatively, the property 'Trace Support' of the conflicting Shape Binder could be set to
'false' after the sub-assembly has been finished. This suppresses the error message but
freezes the position of the fastener (Figure 3-3). If things are to be moved around for opti-
mization later on, the frozen positions might increase the error probability.

● 23

FreeCAD for Electronics Applications.indd 23 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 3-3:

As an intermediate result, the use of the SubShapeBinders avoids errors when recomput-
ing the global coordinates. However, this comes at a cost: Their reference sometimes does
not follow re-orientations of the parent Std-Part-Container when being rotated to different
assembly planes. Therefore, some experimentation remains to be done, in order to find the
smoothest solution.

It can also be useful to redefine the references of the inserted components in the final as-
sembly. This adds some more work, and the components are to some extent less portable
when copied out of the assembly for recycling at a later time.

3.7.4 Redefining the References after Paste


As an example of the redefinition of the references, in the supplementary materials, there
is another version of the sample project, in the file:
'Sample Projects | Shape Binder Test | Test Front Panel Shape Binders on Backside.DCStd'.

There, an attempt is seen to reference the back surface of the panel for the positioning of
the fasteners with both types of shape binders, as a demonstration of certain error cases.
To change the reference for the blue Shape Binder, double-click the blue shape binder entry
in the tree view to display the task window. There, delete the old entries for 'Object' and
'Geometry'. Then, activate the 'Add Object' collector, switch to the model tab, and select
the reference plane in the 'Panel' object by clicking on it. Close the task window with the
'OK' button. Because the Shape Binder is now referencing a plane, change the attachment
mode of the 'Pilot Lamp Nut' to 'XY on Plane' by editing the property 'Support'. Again, the
computation of the global coordinates fails.

● 24

FreeCAD for Electronics Applications.indd 24 24-08-2023 14:29


Chapter 3 ● Project Organization

Figure 3-4

This can also be seen in the 3D view — the fastener is not located concentrically with the
pilot light casing anymore (Figure 3-4). Resetting the 'Trace Support' property to 'false'
restores the orientation but disables the position tracking of the reference plane — this not
a useful result either (Figure 3-5).

Figure 3-5

● 25

FreeCAD for Electronics Applications.indd 25 24-08-2023 14:29


FreeCAD for Electronics Applications

The green SubShapeBinder cannot be edited with a task window. It is easiest to delete it
and regenerate it from scratch. After deleting the SubShapeBinder in the tree view, click
the defining reference plane in the body 'Front Panel Sheet' and click the tool button 'Sub-
ShapeBinder' in the workbench menu.

In the green pilot lamp, the attachment of the fastener can be changed by editing the
property 'Support'. In the selection dialog, delete the former entry and select the new Sub-
ShapeBinder. This brings up yet another error message:

PositionBySupport: TopoDS::Face

The green SubShapeBinder cannot create a reference of the fastener to an infinite object
(the reference plane). In order to resolve the issue, you could choose to define the SubSha-
peBinder as a reference to a non-infinite object (e.g. the sketch of the panel).

As a working remedy, you could create a datum plane locally in the Std-Part-Container of
the pilot lamp and define the SubShapeBinder reference between these two planes (plane
to plane — works). The fastener, you can then set up to follow this new, local datum plane
(by editing the 'Support' properties).

Even though the concept with the plane-to-plane reference looks a bit awkward — an
'intermediate' datum plane is necessary — it can be an advantage, for example, when
referencing many fasteners to this 'intermediate' plane and associating that later on with a
single assignment to, say, the back of the panel.

Figure 3-6

● 26

FreeCAD for Electronics Applications.indd 26 24-08-2023 14:29


Chapter 3 ● Project Organization

In the example file, you will find that the sketch of the 'Pad' for the front panel was chosen
as a reference mainly because it coincides with the back of the panel. (Figure 3-6). The
fastener is now following the back side of the panel.

As a result, when references are updated, the green SubShapeBinder seems a bit more
complicated (no task window to edit!) but responds more robustly to the recalculation of
the global coordinates. This is favorable and easier, as long as no re-orientations of the
enclosing Std-Part-Container are invoked by its attachment in an assembly. Later, you get
to study an example where such a re-orientation has to be dealt with.

● 27

FreeCAD for Electronics Applications.indd 27 24-08-2023 14:29


FreeCAD for Electronics Applications

Chapter 4 ● Creating Parts — First Steps

After the description of some concepts, it is now the time to move toward the practical
application.

4.1 How Much Fidelity is Needed?


A digital caliper is useful to determine the component's dimensions but flipping datasheet
pages to sections with mechanical drawings is even better and time saving.

As a pragmatic approach, it is meaningful to realize that the 3D models created from the
components are often used to define mounting holes and cutouts in a given panel. That
task is easier to complete when the parts are drawn such that they describe the openings
rather than the part itself — by adding some excess to the corresponding contours. With
this often subtle modification, an appropriate fit between component and mounting hole
results, by simply referencing the component contours for pockets or holes.

Although it is tempting to focus on the beautiful outside of a front panel, with 3D design it
is as important to have a meaningful representation of the parts that extend to the inside.
These parts can appear simplified, as long as they allow the analysis of collisions, the ac-
cessibility for the wiring harness, and other important spatial properties.

On the outside of a panel, it is often sufficient to have a coarse outline of the control el-
ements only. But the true pleasure of using FreeCAD comes when beautiful and realistic
representations of the work are created and viewed. This can deliver strong motivation, if
not appetite, to finalize often lengthy and elaborate projects. Therefore, the effort to mas-
ter details and appearance seems well invested, besides all the necessary technicalities.

4.2 Simple Parts


A simple part could be a spacer. It consists of only one body object, more precisely an ex-
truded, round plastic tube. Such objects can be generated with little time and be associated
with realistic appearance attributes. With these parts, it is easy to decide whether their
design is finalized. After the assignment of all the properties (color, material), they can be
stored in a nice library for picking later during assembly.

4.2.1 The Simple Spacer, Step by Step


1. Preparations
Start FreeCAD and select from the main menu 'File | New'. Save the file as 'Spacer'.
Select the 'Part Design' workbench from the Combo Box. In the Combo View on the
left-hand side, a task window opens, offering basic things to do. For the moment, this
can be left aside. Select the 'Model' tab in the Combo View to display the still empty
tree view.

● 28

FreeCAD for Electronics Applications.indd 28 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Figure 4-1

Click on the yellow 'Part' tool button in the workbench menu (Figure 4-1), to generate a new
Std-Part-Container. In the tree view, you can see that the Std-Part-Container is created to-
gether with its own coordinate system named 'Origin' (grayed). Rename the Std-Part-Con-
tainer to 'Spacer Complete' by right-clicking the entry in the tree view and selecting 'Re-
name' from the context menu. Alternatively, it is possible to mark the Std-Part-Container in
the tree view and press F2. But caution — then, it depends on the mouse pointer position,
which field is updated. This can be confusing: If the mouse pointer is pointing underneath
the 'Labels and Attributes' column, renaming works as expected. If the mouse pointer rests
underneath the 'Description' column, the description field opens for editing. The name
'Spacer Complete' sounds a bit overkill — as the spacer consists of just one body object.
But it is good practice to think of multiple bodies right away. Along with the spacer, you will
later add the screw, washer and nut, to the same container.

As a last preparation, you activate the new Std-Part-Container by double-clicking on its


tree view line (the title of the item is then displayed in bold letters) and selecting the blue
'Body' tool button from the workbench menu. Rename the new body object in the tree view
to 'Spacer', using one of the methods described above. In Figure 4-1, all these steps have
been completed for your reference.

2. Now, in order to create the first part, define the cross-section of the spacer as a
sketch. Click on the 'Create Sketch' tool button in the workbench menu (Figure 4-1,
number 5). A task window opens, in which it is possible to select the sketch plane. You
can either select the plane from the list or click on a plane representation in the 3D
view. As the sketching plane, select the XY-Plane001 from the list and close the task
window with the 'OK' button (on the top of the task window). The sketcher workbench

● 29

FreeCAD for Electronics Applications.indd 29 24-08-2023 14:29


FreeCAD for Electronics Applications

opens, which changes the selection of tool buttons and context menu items. Also, in the
Combo View, two new list boxes appeared ('Constraints' and 'Elements'), which will be
populated in the course of the sketch creation.

Figure 4-2

The work with the sketcher is not always straightforward. Sketches need to be properly
defined by constraining, but not over-constraining, all degrees of freedom. The designer,
with his ideas, may sometimes feel entrenched with this methodology. But without these
strict definitions, how could the computer know which requirement has priority? Some time
and nerve-saving strategies that result in fully constrained sketches will be shown in detail
later. With the simple example here, you do not need to worry too much (yet).

The spacer has a simple structure — its cross-section is described by just two circles,
concentric to the origin. To start the sketch, select 'Create circle' from the sketcher menu
(Figure 4-2, step 1). The mouse pointer will change its shape into a little crosshairs with
an attached symbol. It is easy to overlook the small crosshairs, but as tiny as they are,
they are the center of action. To start a circle, approach the origin with the little crosshairs,
until the red dot representing the origin changes its color to yellow. Only then, the pointer
is locked to the origin (any other point object which you want to select behaves like that).
This is important! If you miss the origin (or target point) only by small amounts, additional
degrees of freedom would result (here for the position of the circle center). With the origin
clicked, you can pull the circle to some diameter, which will be specified more precisely in a
later step. Using the same method, draw a second circle, concentric to the first one. When
the second circle is finished, the 'circle' symbol still sticks to the mouse pointer, happily
expecting more circles to come. To end the command, just issue a right-click into the blue.
This works with all the other drawing commands in the same way.

● 30

FreeCAD for Electronics Applications.indd 30 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

3. In the Combo View to the left, the 'Elements' list has been populated with the two
circles (Figure 4-2). Also, in the list 'Constraints', two symbols for 'Coincidence' are
listed, because the two center points of the circles are constrained to coincide with the
origin.

The two circles are still displayed in white. In the list 'Solver Messages' on top of the Combo
View, the first line reads 'Underconstrained: 2 DoF(s)' (degrees of freedom). In order to
display the under-constrained offenders, click on the hyperlink '2 DoF(s)'. In contrast to
the white ones, elements that are fully constrained will then show in light green, when the
constraints have been properly defined. The art is now, to select the degrees of freedom
such, that just the correct number of constraints results. This can be quite a headache if
the shapes are more complex. Luckily, the present example is simple: As the origins of the
circles are already fixed, the only remaining freedom is the selection of their diameters (or
radius).

4. To define the constraint, in the 'Elements' list, right-click the outer circle. Its color
changes to green, in order to indicate that work with it is in progress. In the top part
of the context menu, the available constraints are listed with red symbols (Figure 4-3).

Figure 4-3

Select 'Diameter Constraint' from the context menu and enter 7 mm in the small pa-
rameter dialog which then opens. Now, the green color of the circle is persistent, indi-
cating it is fully constrained. The green flavors are important: If you click now on the
hyperlink '1 DoF(s), the remaining underconstrained object is taking the green color,
whereas the fully constrained one is displayed in light green. This color play is very
useful, especially when a sketch stubbornly refuses to be fully constrained.

● 31

FreeCAD for Electronics Applications.indd 31 24-08-2023 14:29


FreeCAD for Electronics Applications

In the same manner, change the diameter of the inner circle to 3.5 mm. The success ap-
pears twofold: The whole sketch changes the color to bright green, and in the 'Solver Mes-
sages' window, in green letters 'Fully constrained' is proclaimed (Figure 4-4).

Figure 4-4

In case an error occurred during the entry of the diameter, or a change of it is required, a
single left-click on the corresponding item in the 'Constraints' list opens a dialog window,
in which the parameter can be edited. When the sketch looks finalized, close the sketcher
by clicking the 'Close' button on top of the task window. Sometimes, it is difficult to find
because the other lists have expanded. Soon, you will scroll automatically to the top of the
sketcher task to find the 'Close' button.

5. After closing the sketcher, the sketch is displayed in the 3D window to the right. In
order to create the spacer, mark the sketch in the tree view and select the 'Pad' tool
button from the workbench menu (Figure 4-5).

● 32

FreeCAD for Electronics Applications.indd 32 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Figure 4-5

The 3D geometry appears, and a task window opens. There, select for the type 'Di-
mension' (which is preset), and for the length 10 mm (also selected by default). The
3D-geometry updates when you change parameters, e.g., by clicking into the 'Length'
edit field and rolling the mouse wheel (Figure 4-6).

Figure 4-6

● 33

FreeCAD for Electronics Applications.indd 33 24-08-2023 14:29


FreeCAD for Electronics Applications

Close the task window with the 'OK' button. This flips the tab of the Combo View back
to the 'Model' tab.

6. In the 3D view, the spacer still appears in its standard color (Figure 4-7). With a
right-click of the 'Spacer' body, you can select the item 'Appearance...' from the context
menu (Figure 4-7).

Figure 4-7

A new task window opens (Figure 4-8), which allows selecting the viewing mode (to
suppress the lines in the objects, you can select 'Shaded'), but also color and reflectiv-
ity presets for different materials: From the combo box 'Material' select 'Shiny Plastic',
which defaults to a black shape color (sometimes dark gray can be better distinguisha-
ble). This task window is closed with the 'Close' Button at the bottom.

● 34

FreeCAD for Electronics Applications.indd 34 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Figure 4-8

After the closure of the task, the new spacer gloriously appears in the 3D view, with an
astonishing resemblance to something you have used probably thousands of times before
(Figure 4-9). <CTRL-S> saves it for later use.

Figure 4-9

4.3 Color versus Appearance


When newly created, 3D geometry is displayed with the gray default color. If a project is
assembled, special colors can render the individual components more distinguishable. On
top of that, as just seen with the spacer, setting the 'Appearance' attributes can render the
display very realistic and beautiful.

● 35

FreeCAD for Electronics Applications.indd 35 24-08-2023 14:29


FreeCAD for Electronics Applications

In the tree view, if you right-click a tip of a body, you can find the item 'Set Colors' in the
context menu. With that function, you can paint individual facets of a body to your liking.
Unfortunately, the coloration is bound to that tip, which means that it will disappear once
another design step is undertaken with that body. They only reappear if you revert the state
of the body by making that special design step visible again, by marking and pressing the
SPACE key.

Therefore, it is more meaningful to use the 'Appearance' attributes with the different bodies
in a project, as was done with the spacer in the previous example. These attributes are per-
sistent with respect to design changes. Also, the variety of preset material profiles, which
determine color, reflectivity, and transparency at the same time, allow the creation of an
astonishingly realistic representation of the work.

4.4 Compound Parts


A part composed of multiple bodies could be, e.g., a rocker switch which has a casing,
an actuator and contacts. The actuator could carry lettering (like 1 and 0) and should
be movable in order to represent a switch position. Rocker switches with curved and flat
actuators are provided with the supplemented material online. The advantage of having
the Std-Part-Container as an encapsulation for all these different body parts is evident
with these objects. Because some details can be more involved (like lettering attached to
a curved surface), you will continue to use our simple spacer and extend the example to
some degree.

4.4.1 Fasteners for the Simple Spacer


Our spacer could be nicely extended to a compound part by adding fasteners to it. This
comes with an increased utility: When the spacer is pasted into an assembly later, there is
no need to add the mounting screw, washer, or nut one by one. Plus there is associativity
between fasteners and spacer, because all these internals refer to the same coordinate sys-
tem of the enclosing Std-Part-Container. The use of a macro-based functionality in FreeCAD
can be demonstrated by utilizing the extension BoltsFC.

In the first pass, you will intentionally introduce a small, but instructive error, when defining
the relations between the fasteners and the spacer.

1. If it was closed in the meantime, reopen the file 'Spacer.FCStd'. In order to


activate the spacer body, right-click the body 'Spacer' and select 'Toggle active
body' from the context menu (alternatively, double-click the body line in the tree
view). The title of the body will be displayed in bold print when it is activated.
Also, the enclosing Std-Part-Container is activated by this step.

2. From the main menu, select 'Macro | Recent Macros | start_bolts'. On the right-
hand side of the main window, the BOLTS Parts selector opens.

● 36

FreeCAD for Electronics Applications.indd 36 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Figure 4-10

3. From the list, select 'Standard | DIN | DIN 7991Hexagon socket countersunk
head', leave the key at the default 'M3' and set the length l to 16 mm (Figure
4-10). Then click the 'Add Part' button at the bottom of 'BOLTS Parts selector'.

4. The screw appears in the 3D view. In the tree view, however, it is not yet listed
as a part of the Std-Part-Container 'Spacer Complete'. Also, the surface of the
screw head is displayed discontinuously (Figure 4-11).

Figure 4-11

● 37

FreeCAD for Electronics Applications.indd 37 24-08-2023 14:29


FreeCAD for Electronics Applications

This effect is caused by the coincidence of the screw head surface with the spac-
er surface – the association of the plane with an object is not unique, so FreeCAD
displays them all at once.

In order to associate the screw with the spacer, in the tree view, it can be moved
by drag-and-drop into the Std-Part-Container 'Spacer Complete'.

5. After the move, the screw appears as an object embedded in 'Spacer Complete'
(Figure 4-12). In the Property list, only 'Placement' parameters are listed.

Figure 4-12

The body of the screw is thus only placed, and not attached to other bodies.
You can expand the property list by using the arrow keys on the left-hand side
(Figure 4-12). The arrows allow you to navigate to the z coordinate (listed in
the item 'Position'). Here, usual the usual thickness for a chassis plate could be
entered. Once the edit field next to a coordinate identifier is clicked, it is also
possible to manipulate the displayed values with the mouse wheel. In this way,
screws could be 'tightened' also later on.

6. The position of the screw is still unsatisfactory. When a 2-mm aluminum sheet
is usually taken for the chassis, it is useful to move the screw to the correct
position right away. In this simple case, you do not have to define attachments.
Simply click the edit field for z and roll the mouse wheel, or enter the value of
-2.01 mm manually, with the small offset of 0.01 mm added for the clear display
of the screw (Figure 4-13). The resulting offset of the screw with respect to the
spacer is displayed in the 3D view with an immediate update.

● 38

FreeCAD for Electronics Applications.indd 38 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Figure 4-13

7. From the 'BOLTS Parts Selector', choose 'DIN | DIN12 | DIN125 A Plain washer,
metric sizes', with key M3 (preset), and click the 'Add Part' button (Figure 4-14,
steps 1 and 2). The washer appears in the 3D view. In the tree view, it needs
to be dragged-and-dropped into the Std-Part-Container 'Spacer Complete', in
order to gather the belongings.

8. Again, the placement parameters could be used to bring the spacer to an appro-
priate position. However, it is better to define an attachment for the automation
of that step. This is useful, if later e.g., variants of the part are needed which
differ in length. Then, after the change of just the length parameter, the washer
(and also nut, later) will follow the designer diligently. In order to define the at-
tachment relation, switch to the 'Part' workbench (Figure 4-14, step 3).

● 39

FreeCAD for Electronics Applications.indd 39 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 4-14

9. In the tree view, because of the preceding steps, 'Plain washer DIN125A M3'
should be still marked, otherwise click the item. From the main menu, select
'Part | Attachment' (Figure 4-14, step 4). A task window opens, in which you can
proceed with defining the new relation.

Figure 4-15

● 40

FreeCAD for Electronics Applications.indd 40 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Upon opening the task window, the collector for 'Reference1' is already acti-
vated (the button label reads 'Selecting…'). Click into the edit field next to it,
which then receives the focus (i.e., gets a blue rim). In the 3D view, click the
rim of the spacer, which is opposite to the head of the screw, where the washer
should go to (Figure 4-5). In the task window, select the attachment mode 'Con-
centric' (Figure 4-15, step 3) and close the task window with the 'OK' button.
This brings the washer already close to the end of the spacer (Figure 4-16).
Sometimes, the selection of the reference in the 'Attachment' task window is
not functioning right away (maybe something else was clicked in between the
steps). Then, the collector needs to be activated again, by clicking its button
until its color is dark gray, and the label reads 'Selecting…' again. After that, click
the edit field next to it, to grant it the focus (indicated by the blue rim). Only
then, the collector is ready to receive a feature.

Figure 4-16

10. Often, a circuit board is mounted with the spacer. It is therefore useful to de-
fine a default attachment Z offset, which accounts for the board thickness. This
usually amounts to 1.5 mm (or 1.55 mm, depending on the unit base). The pa-
rameter can be accessed by expanding the 'Attachment Offset' property in the
Combo View (Figure 4-16, number 2).

● 41

FreeCAD for Electronics Applications.indd 41 24-08-2023 14:29


FreeCAD for Electronics Applications

When you decided to enter the offset in the 'Attachment' task window already, the 3D view
is updated when you either roll the mouse wheel with one of the parameters selected or
click either the 'Apply' or 'OK' button, the latter closing the task window.

If a small blue check mark appears on the tree view item of the washer, the component
has not been recalculated yet. Then, trigger the recalculation with the F5 key. A warning
message is issued: (Figure 4-16; output window at the bottom):

'Part::Feature: Link(s) to object(s) 'Pad' go out of the allowed scope 'BOLTS_


part001'. Instead, the linked object(s) reside within 'Part Part'.'

This is (just) a warning but flags a formal shortcoming of the defined relation. You can in-
spect what's going on by selecting 'Tools | Dependency graph' from the main menu (Figure
4-17).

Figure 4-17

The dependency graph shows that the body 'Spacer' resides in its own, enclosed name
space (scope). The arrow for the offending relation between the washer and spacer is dis-
played in red.

It is better to correct the problem right away. A valid reference is needed across the scope
boundaries. For this purpose, you already met with two objects in Chapter 3, the two fla-
vors of shape binders.

● 42

FreeCAD for Electronics Applications.indd 42 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

As another useful addition, a datum plane controlling the spacer length will help later on
with the attachment of other parts:

11. Close the dependency graph and return to the 'Model' tab.

12. To be able to control the spacer length by it, the datum plane needs to be cre-
ated in the 'Spacer' body. The 'Spacer' body must be activated to do this, oth-
erwise the datum plane is created in the currently activated entity, which could
hide somewhere else. Activate 'Spacer' by double-clicking its item line in the tree
view. Expand the coordinate system in it and select the XY plane by clicking the
item line (Figure 4-18, number 1), as the alignment of the datum plane should
be parallel to it.

Figure 4-18

Click on the 'Create a Datum Plane' tool button (Figure 4-18, number 2). A task window
opens. Because the XY plane was marked before the task was started, the plane is already
attached to it and the attachment mode is preset to 'Plane Face' (Figure 4-19). Set the
attachment offset in the z-direction to 10 mm, i.e., the intended length of the spacer. Then
close the task window with the 'OK' button (top of window). The trick is now to define the
spacer length with respect to the new datum plane and refer the washer to the plane po-
sition. Then, the washer will diligently follow length changes of the spacer. This looks a bit
indirect but provides a rock solid reference to the spacer end face.

● 43

FreeCAD for Electronics Applications.indd 43 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 4-19

13. In the tree view, the new datum plane appears in the body 'Spacer' as 'Datum-
Plane'. If a number of them piles up, that can become confusing, so rename it to
'Spacer Length'. This helps later to catch up with the ideas again (Figure 4-20).

● 44

FreeCAD for Electronics Applications.indd 44 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Figure 4-20

14. Now, in order to set the associative connection, the length of the spacer needs
to be controlled by this new datum plane. Click twice on the tip (the last design
state) of the spacer in the body 'Spacer' to edit it. It is listed as 'Pad'. The task
window of the pad opens. Select for the 'Type' 'Up to face' from the combo box.
By this selection, the collector 'Select face' already has a focus (dark gray).
Then, click the yellow datum plane in the 3D view to select it. The term 'Datum-
Plane' appears in edit field of the collector (Figure 4-21). Close the task window
with the OK button (on top). Hide the datum plane by marking it in the tree view
and pressing the SPACE key.

● 45

FreeCAD for Electronics Applications.indd 45 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 4-21

15. Next, the SubShapeBinder can be created. From the last step, the body 'Spacer'
should be still activated (its title been shown in bold in the tree view). In the
3D view, mark the boundary of the spacer as shown in Figure 4-22 and click
the green 'Create SubShapeBinder' tool button in the workbench menu. (If you
would want to fix the SubShapeBinder even more rigorously, you could sketch a
circle onto the new datum plane, which coincides with the spacer, and use that
as input for the SubShapeBinder).

● 46

FreeCAD for Electronics Applications.indd 46 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Figure 4-22

16. In the tree view, rename the new SubShapeBinder as 'Spacer End Face'.

Instead of the green SubShapeBinder, the blue Shape Binder could have been used. In the
context of a single Std-Part-Container, this works just as well. However, complications can
arise when the Std-Part-Container is copied into assemblies later on. Then, the recalcula-
tion of the global coordinates will fail, as described in Chapter 3.

17. In order to allow other body objects in 'Spacer Complete' to refer to the new
SubShapeBinder, drag and drop it into the Std-Part-Container 'Spacer Com-
plete'. It is then listed at the same hierarchical level as the washer and screw
(Figure 4-23).

● 47

FreeCAD for Electronics Applications.indd 47 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 4-23

18. Now, the attachment of the washer needs to be repaired. Click on the washer in
the tree view, and on to the property field 'Support' (Figure 4-24).

Figure 4-24

● 48

FreeCAD for Electronics Applications.indd 48 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

Clicking the button on the right-hand side of the edit field opens a selection dialog in
which the object 'Pad' appears still marked. Click on the 'Clear' button to remove this selec-
tion (Figure 4-25) and mark the SubShapeBinder 'Spacer End Face' instead (Figure 4-26).
Then, close the list with the 'OK' button.

Figure 4-25

Figure 4-26

19. In the Property list, click the entry field for 'Map Mode', and then on to the
button appearing on the right-hand side. This opens a task window. There,
the attachment mode 'Concentric' is still selected, which makes no sense with
respect to a plane. From the list, select 'XY on plane' instead (Figure 4-27).

● 49

FreeCAD for Electronics Applications.indd 49 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 4-27

To allow the circuit board to be inserted between spacer and washer later, select
a z offset of 1.5 mm (Figure 4-28).

Figure 4-28

After closing the task window with the 'OK' button (top), the washer appears at
the correct position.

● 50

FreeCAD for Electronics Applications.indd 50 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

20. In order to check whether the scope violation has been rectified, clear the output
by right-clicking the selection of 'Clear' from the context menu. Then, right-click
the Std-Part-Container and select 'Recompute object' from the context menu.
No new warnings should appear in the output window.

21. Now, add the hex nut: From the BOLTS Parts selector, pick 'DINENISO | DINEN-
ISO 4035 thin hexagon nut, metric sizes' from the list. The M3 key is already
preset. Click the 'Add part' button to insert the nut into the project. Drag and
drop the nut into the Std-Part-Container 'Spacer Complete'.

22. The nut is usually attached to the corresponding washer. To define the attach-
ment, mark the nut in the tree view and switch to the 'Part'-workbench. From
the main menu, select 'Part | Attachment'. The task window opens with a previ-
ously activated collector for Reference1. Click the top edge of the washer (e.g.,
the inner edge, Figure 4-29, step 1). For the attachment mode, select 'Concen-
tric'. Then, close the task window with the 'OK' button. The nut now appears at
the correct location.

Figure 4-29

23. The associativity can be evaluated by changing the position of the datum plane
'Spacer Length'. In the tree view, double-click the datum plane, and change the
attachment z offset to, for example, 5 mm. This time, the 3D view will not follow
in live fashion. After closing the task window with the 'OK' button, there is still a
recalculation needed in order to update the 3D view (Figure 4-30).

● 51

FreeCAD for Electronics Applications.indd 51 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 4-30

24. In the final step, set the length of the spacer to 10 mm again and hide the Sub-
ShapeBinder 'Spacer End Face' by selecting it in the 3D view and pressing the
SPACE key. Now, the spacer is ready for use (Figure 4-31).

Figure 4-31

● 52

FreeCAD for Electronics Applications.indd 52 24-08-2023 14:29


Chapter 4 ● Creating Parts — First Steps

The procedure may look complicated, especially when following the step-by-step descrip-
tion. It is, however, not particularly difficult. The associativity will pay off later, for example,
when components are fitted into an enclosure, or a protective cover needs to be added to a
display — in that case, the length of spacers might need adapting in some cases.

On top of that, the encapsulation of parts and fasteners later allows the insertion in a single
step, by means of cut-and-paste.

4.5 Parts Packaged with Fasteners Save Time


With the spacer, it became evident that grouping the parts together with their accessories
in a Std-Part-Container can be a big time saver. This is especially true if a part is intro-
duced in a design multiple times, like a 4-mm banana jack with its with insulating bushing
and nuts. If a standard thickness for the panels is known in advance, the fasteners can be
preset to the correct positions right away. But it is not difficult to edit the positions of these
parts later on, in order to 'secure' the hardware.

4.6 Displaying and Hiding Elements


Sometimes, elements like a datum plane can be disturbing. It is easy to hide objects by
selecting them in the tree view and by pressing the SPACE key. This is useful not only dur-
ing a visual inspection of an assembly, but also when engravings and lettering have to be
added to surfaces, as described below.

4.7 More Examples of Compound Parts


For the example projects described in this book, further components are needed. In Appen-
dices A through G, the creation of the following components is described in step-by-step
instructions:

• The Rotary Switch


• The Potentiometer
• The (4 mm) Banana Jack
• The Pilot Lamp
• The Toggle Switch
• The IEC Power Inlet
• The 9 V Battery (PP3; 6LR61; 'Block')

All other components in the example projects are available with their supplementary mate-
rials online and can be inspected for their specific way of making. Working with the Sketch-
er is covered in a multitude of instructions both online and in books. Some information
about these sources is given in Chapter 11, Community Resources.

● 53

FreeCAD for Electronics Applications.indd 53 24-08-2023 14:29


FreeCAD for Electronics Applications

Chapter 5 ● Working with Sheet Metal

The 'Sheet Metal' workbench is not included with the standard functionality of FreeCAD. It
can, however, be smoothly installed with the Addon Manager — if that wasn't done already
while digesting Chapter 2.

5.1 Example: 9 V 6LR61 Battery Holder


For the 6LR61 (a.k.a. 'Block' or 'PP3') battery holder, a representation is needed first. With
some excess tolerance in the dimensions of that model, you can make sure that the real
battery will fit into the finished holder with not too much pressure exerted onto the casing.
The step-by-step instructions to create the battery model are given in Appendix G.

The battery model is copied as a Std-Part-Container into the Std-Part-Container of the


holder. The battery holder is thus already a mini-Assembly in its own right, with the nested
Std-Part-Container of the battery (not forgetting … the fasteners!).

The usefulness of this project organization method is evident: All parts for the battery
'complex' come together in one Container. They are not scattered all over the tree view,
but nicely sorted into their branch. Also, when the holder has been mounted, one click, and
the SPACE key displays the contained battery and the necessary collection of other little
additions, too. This saves a lot of time and meddling, especially when the component is
inserted more than once. Also, this grouping of components again has the outer form of
an Std-Part-Container, which can reappear as a node in a more complex assembly again.
And again...

1. The first steps follow the standard procedure: Create a new file, rename it to '9V
Battery Holder', generate the parent Std-Part-Container, and designate it '9V
Battery Holder Complete'.

2. In the next step, insert the battery which has been created following the steps
in Appendix G. If you decide to skip the battery model creation, you find the file
in the online materials. The insertion of components by cut-and-paste is used
quite extensively in this book.

3. Locate and open the file '9V Block Battery'. Now, both files are visible in the tree
view. Click once the yellow Std-Part-Container '9V Block Battery Complete' and
copy it with CTRL-C. A dialog window appears, in which you could also limit the
selection of details that will be copied. Do not change the default selection and
confirm the copy operation with the 'OK' button.

4. In order to activate the destination of the copied battery model, double-click


the previously created new (and yet empty) Std-Part-Container 'Battery Hold-
er Complete'. Paste the battery model by CTRL-V. If you forgot to activate the
correct destination, the battery model may have been pasted to the root of the
tree view. Then, drag-and-drop the model into 'Battery Holder Complete'. In the
tree view, close the file '9V Block Battery' (right-click, 'Close' from the context

● 54

FreeCAD for Electronics Applications.indd 54 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

menu). These preparations result in a tree view shown in Figure 5-1. The typi-
cal accident happens when the model is pasted into the source document node
again. Then, the pair should be deleted there, just to keep things in good order,
or you could simply reverse the erroneous copy operation with CTRL-Z. Close the
document node '9V Block Battery'.

Figure 5-1

5. In order to start with the battery holder sheet metal, a reference to the top of
the battery is needed. To identify the top face, you can briefly show the coor-
dinate system of the parent Std-Part-Container. The reference will be a shape
binder. To generate that in the correct location, activate the body 'Block Battery'
(the title appears in bold letters if activated). Then, in the 3D view, mark the
top face and click the 'Create a Shape Binder' tool button (Figure 5-2). Now, you
have created a reference to a facet – which could break by re-enumeration. But
you may allow for that because the battery can be considered as a established
part, for which no further changes are expected. If you decide to add more elab-
orate contact representations later, the design could break! In such a case, more
robust references with a datum plane and a sketch should be considered. For the
sake of simplicity, that's skipped here.

● 55

FreeCAD for Electronics Applications.indd 55 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-2

A task window opens, in which the object and geometry are already preset (Figure 5-3).
Close the task window with the OK button. If details are well accessible in the 3D view,
marking them before clicking a tool button can save time, because the selection then often
appears correctly preset in the tool task windows.

Figure 5-3

● 56

FreeCAD for Electronics Applications.indd 56 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

6. Rename the shape binder to 'Battery Top Face'. In order to make it accessible
for other objects in the parent Std-Part-Container, drag and drop it into '9V
Battery Holder Complete'. The Std-Part-Container '9V Battery Complete' can be
collapsed in the tree view (Figure 5-4). Leave the trace support of this shape
binder set to 'false', because you do not expect changes to the battery anymore.

Figure 5-4

7. Activate the Std-Part-Container '9V Battery Holder Complete'. For our battery
holder, click the blue 'Create Body' tool button and rename the new body to
'Holder Sheet Metal' (Figure 5-5).

● 57

FreeCAD for Electronics Applications.indd 57 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-5

8. Switch to the 'Sheet Metal' workbench (Figure 5-5).

9. In the tree view, mark the shape binder 'Battery Top Face' and click the 'Make
Base Wall' tool button (Figure 5-6). In the tree view, expand the body 'Holder
Sheet Metal' and mark the new object 'base bend'. Insert a value of 1.5 mm into
both property fields 'radius' and 'thickness' (Figure 5-6).

● 58

FreeCAD for Electronics Applications.indd 58 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

Figure 5-6

10. Select one top edge of the new sheet metal piece and click the 'Make Wall' tool
button (Figure 5-7).

Figure 5-7

● 59

FreeCAD for Electronics Applications.indd 59 24-08-2023 14:29


FreeCAD for Electronics Applications

11. In the tree view, click the new wall 'Bend' and set its length property to 14 mm
(Figure 5-8).

Figure 5-8

12. In the 3D view, mark the outer, lower edge of the sheet metal piece and again
click the 'Make Wall' tool button (Figure 5-9).

Figure 5-9

● 60

FreeCAD for Electronics Applications.indd 60 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

13. In the tree view, mark the new wall ('Bend001') and set the 'Invert' property to
'true'. For the length, insert 8 mm (Figure 5-10).

Figure 5-10

14. In the same way, attach two walls to the opposite side of the battery holder
(Figure 5-11).

Figure 5-11

● 61

FreeCAD for Electronics Applications.indd 61 24-08-2023 14:29


FreeCAD for Electronics Applications

15. On the back side of the holder, a little stop would define the position of the bat-
tery nicely. Mark the back edge on top and generate a small bend there (Figure
5-12).

Figure 5-12

16. In the tree view, click the new wall to display its properties. In the property list,
enter the following property values:
Length = 3 mm; gap1 = gap2 = 2 mm (these are the lateral distances to the
edges); reliefd = reliefw = 0.00 mm (these are cuts to reduce strain when bend-
ing the part, which you do not use here, Figure 5-13). To find the relief proper-
ties, scroll down the property list.

Figure 5-13

● 62

FreeCAD for Electronics Applications.indd 62 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

The sheet metal creation is finished at this point. Switch back to the 'Part Design' work-
bench to add some more features, which make the work with the part more agreeable, like
some rounded edges. Also, the mounting holes need to be added. These will be addressed
next:

17. The mounting hole will be sketched first. Click on the sketcher tool button and
select the XY plane (on which the battery rests). Close the sketch and reo-
pen it by double-clicking its icon in the tree view (this will show the previously
generated geometry). To eliminate distortions by perspective, and to have a
clearer view, select from the main menu 'Sketch | View Section' and 'View |
Orthographic View'.

18. Click the 'Create Circle' tool button and draw a circle approximately where the
mounting hole should go. No special precision is required with this drawing yet
(Figure 5-14).

Figure 5-14

19. Click the 'External geometry' tool button and mark two edges of the sheet met-
al flange where the hole should be located on. The edges appear highlighted
in violet, indicating that they are available as construction lines for the sketch
(Figure 5-15).

● 63

FreeCAD for Electronics Applications.indd 63 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-15

20. To place the circle in the center of the flange, mark two diagonally placed corner
points of the new construction lines, and then the center of the circle. Clicking
the 'Constrain symmetrical' tool button brings the circle to the center of the
flange (Figure 5-16).

Figure 5-16

● 64

FreeCAD for Electronics Applications.indd 64 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

21. Right-click the circle in the 'Elements' list and select 'Diameter Constraint' from
the context menu. Set the diameter to 3.2 mm (for an M3 screw, Figure 5-17).
Close the sketch.

Figure 5-17

22. In the tree view, mark the new sketch and click the 'Pocket' tool button (Figure
5-18).

● 65

FreeCAD for Electronics Applications.indd 65 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-18

23. A task window for the pocket opens. Select 'Through all' for the type and check
the 'Reversed' check mark (Figure 5-19).

Figure 5-19

● 66

FreeCAD for Electronics Applications.indd 66 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

24. In the tree view, mark the tip and select 'Part Design | Apply a pattern | Mir-
rored' from the main menu (Figure 5-20).

Figure 5-20

25. A task window opens, and possible mirror planes are shown in the 3D view.
Select the YZ plane (Figure 5-21, step 1) and close the task window with the
'OK' button.

Figure 5-21

● 67

FreeCAD for Electronics Applications.indd 67 24-08-2023 14:29


FreeCAD for Electronics Applications

26. To avoid sharp corners on the part, mark the four outer edges of the sheet metal
piece and select 'Fillet' (Figure 5-22).

Figure 5-22

27. In the task window, enter for the radius: 5 mm (Figure 5-23), and close the task
window.

Figure 5-23

● 68

FreeCAD for Electronics Applications.indd 68 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

The sheet metal part is finished now. With the fasteners added, the holder would be all
self-contained and ready to be inserted into an assembly. You can add the fasteners using
the same methods described in the previous chapter. At this point, however, it is more im-
portant to cover some other steps required to actually manufacture the part.

5.2 Creating the Unfold


When a sheet metal part has been designed, during the first step of its making, it is cut out
of a larger, plain sheet of material. In order to know the contour of the flattened part, you
need to unfold the 3D design. Fortunately, there is functionality provided with the 'Sheet
metal' workbench — this saves a lot of time and effort. Besides showing the flattened
contour, the positions of the bends are also given, which are needed to bring the part into
shape once it has been cut.

28. First, in the tree view, hide the battery so it's not disturbing the view of the next
steps (mark it and press the SPACE key).

29. Switch to the 'Sheet Metal' workbench. In the 3D view, mark the top face of the
battery holder. Then, click the 'Unfold' tool button (Figure 5-24).

Figure 5-24

30. A task window opens. Check the box for 'Separate projection layers', select DIN,
and leave the K factor at its default value (0.4). Then, close the task window
with the OK button (Figure 5-25).

● 69

FreeCAD for Electronics Applications.indd 69 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-25

31. In the stem of the tree view, some new items appear (Figure 5-26). One is
the object 'Unfold', which represents (in the 3D view transparent) a model of
the flattened part. Furthermore, there are nicely sorted out sketches 'Unfold_
Sketch_Outline (the outer contour), Unfold_Sketch_Internal (with all the inter-
nal openings of the sheet), and Unfold_Sketch_bends (the positions where the
part needs to be folded). You may find this division useful because your milling
machine has to add radius corrections that differ for outlines and internals.

Figure 5-26

● 70

FreeCAD for Electronics Applications.indd 70 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

32. Now, consider if it makes sense to have the manufacturing data inside the
Std-Part-Container of '9V Battery Holder Complete'. If you opt for this, drag and
drop the required items into the container. This makes the file slightly larger but
it is evident which data has been used to fabricate the prototype. On the other
hand, you could always extract the data later, following the method described
next.

5.3 Exporting the Unfold


For the actual making of parts, it is necessary to export the data into a useful, portable
format. These days, many machine controllers can read DXF files. This is also true for, for
example, NC EAS(Y)5 from the EAS company [EAS 2022]. Exporting and re-importing are
demonstrated here with the battery holder example. For this, a drawing of the flattened
part is needed: Figure 5-27.

Figure 5-27

33. First, bring the battery holder into the exact 'top' orientation. To achieve this,
click either on the control cube (Figure 5-27, step 1) or the 'Top' tool button
(same figure, alternative step 1). The precise orientation is important: A slight
misalignment of the object would be projected onto the drawing, changing the
dimension values. This is difficult to spot by eye and can be disappointing later.

34. Switch to the 'TechDraw' workbench. Click the 'Insert Default Page' tool button
(Figure 5-27, step 2). In the tree view, a new object 'Page' appears, with a 'Tem-
plate' object for the frame of the drawing. Rename the 'Page' object to 'Unfold
Drawing'.

● 71

FreeCAD for Electronics Applications.indd 71 24-08-2023 14:29


FreeCAD for Electronics Applications

35. In the tree view, mark 'Unfold_Sketch_Outline' and 'Unfold_Sketch_Internal'.


Then, click the 'Insert View' tool button (Figure 5-28, steps 1 and 2). Mark the
'View' object, and adjust X, Y and 'Rotation' parameters (step 3), until the view
object appears in the center of the drawing. For the translations, you could also
drag-and-drop the view. Check the 'Scale' to be set to 1.00 (important!). Then,
scroll to the 'Projection' section of the property list, and verify the 'Perspective'
is set to 'false' (this avoids distortions), and that the 'Direction' property reads
'[0,00 0,00 1,00]' (the unit vector of the z direction = top view, Figure 5-28,
step 4).

Figure 5-28

36. On the drawing, the view as well as the fields of the frame are displayed with
small, green markings. Click those in order to edit the content of the fields (Fig-
ure 5-28, step 5). Some work on the documentation makes it easier to under-
stand later what the intentions were. For the DXF export, the frame around the
viewport is disturbing. You can right-click it and select 'Toggle Frames' from the
context menu to hide the frame as well as the green edit markings on the other
fields. (Figure 5-29).

● 72

FreeCAD for Electronics Applications.indd 72 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

Figure 5-29

37. In order to export the view contents, right-click the view again (with the frame
hidden — it's not needed for exporting). Then, select 'Export DXF' (Figure 5-30).

Figure 5-30

● 73

FreeCAD for Electronics Applications.indd 73 24-08-2023 14:29


FreeCAD for Electronics Applications

38. The import to NC EAS(Y) works straightforward (Figure 5-31), which is running
on a Windows© platform. The precision of the data is very good, which has been
verified by manufacturing several parts in the way described.

Figure 5-31

5.4 Creating a Drawing of the Battery Holder


Parts are not always manufactured with the aid of CNC machines. Sometimes, the simplic-
ity of a part does not justify the programming effort, or a machine is simply not available.
In these cases, a drawing needs to be furnished, which contains all the necessary informa-
tion needed by a mechanical workshop. Technical drafting is a profession in its own right,
requiring training. The following sections provide only a very brief introduction into the
matter. For those who want to read more about the topic, reference manuals and books
exist, like [Hoi 2000, Arz 2001]. This in mind, you can proceed and use the battery holder
as a simple example.

1. Switch to the 'TechDraw' workbench and create a new drawing page, similar to
the one created in 5-3-2. Rename this page to 'Mechanical Drawing' and fill in
the fields of the drawing frame.

● 74

FreeCAD for Electronics Applications.indd 74 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

Figure 5-32

2. In the tree view, mark 'Unfold_Sketch_Outline' and 'Unfold_Sketch_Internal'


and click the 'Insert View' tool button (Figure 5-32).

3. Move the view upwards, to accommodate for the measures that will be inserted
next. To do this, you can either drag the view with the mouse, or edit the X and
Y parameters in the 'Base' property list. When you want to drag the view, pick a
part of it that is not occupied by the part itself. Hide the frame with a right click,
and the selection of 'Toggle frames' from the context menu.

● 75

FreeCAD for Electronics Applications.indd 75 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-33

4. The part is symmetric. A symmetry line could deliver this information to the
machinist. To add this line, click the part and select 'TechDraw | Add Lines | Add
center line to faces' from the main menu (Figure 5-34).

Figure 5-34

● 76

FreeCAD for Electronics Applications.indd 76 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

5. In the task window, select a weight (width) of 0.25 mm, and set the 'Extend By'
parameter to 10 mm (Figure 5-35).

Figure 5-35

Because of the symmetry, it would be accepted practice to add measures between opposite
details. This is a nice shortcut and keeps the drawing simple. However, this is done in prac-
tice, but is at hand not helpful when you have to actually make the part. In the real world,
it is better to have dimensions that help you to mark the sheet with a scribe:

6. First, the distance of a mounting hole to the edge of the part could be specified.
To pick the circle position, center lines for the hole are needed. Mark the hole
contour on the drawing and click the 'Add Circle Center lines' tool button (Figure
5-36).

● 77

FreeCAD for Electronics Applications.indd 77 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-36

7. Mark the vertical edge close to the hole, and the vertical center line of the hole.
Then, click the 'Insert horizontal dimension' tool button (Figure 5-37). Drag the
dimension to a free space underneath the part contour. In order to move a di-
mension, drag on the image itself, not on arrows or leader lines.

Figure 5-37

8. In the same fashion, mark the vertical edge on the side, the corresponding ver-
tical edge of the lower protrusion and add the dimension (Figure 5-38).

● 78

FreeCAD for Electronics Applications.indd 78 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

Figure 5-38

9. To complete the horizontal dimensions, add the total extension of the part, edge
to edge.

10. Then, add the center lines to the other hole, as described in step 6, and add all
the vertical dimensions displayed in Figure 5-39.

Figure 5-39

● 79

FreeCAD for Electronics Applications.indd 79 24-08-2023 14:29


FreeCAD for Electronics Applications

11. In the drawing, mark one of the two circles and click the 'Insert Diameter Di-
mension' tool button. The circle is present twice. Not always, this is as evident
as here. Machinists usually like a hint to the total number of similar features.
Therefore, in the tree view, double-click the diameter dimension. A task window
opens. In the field for 'Format Specifier', add '(2×)' behind the cryptic format
string. That addition will show on the drawing as typed (Figure 5-40). Close the
task with the OK button.

Figure 5-40

12. Then, mark one of the rounded corners and click the 'Insert Radius Dimension'
tool button. In the tree view, double-click the radius dimension and add '(4×)'
to the 'Format Specifier' field (Figure 5-41).

Figure 5-41

● 80

FreeCAD for Electronics Applications.indd 80 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

13. Now, the drawing is nearly done. Some dimensions are given with a precision
or 1/100 mm – this is very precise, maybe too precise for manual production
with the punching machine. When given to a machine shop, such drawings can
raise – for a good reason – discussions about the necessary effort. Specifying
the dimensions with 1/10 mm seems already fairly good for this part. In order to
change all the questionable figures at once, in the tree view, mark all the linear
dimensions showing two digits behind the comma. In the property list, locate
the field 'Format Spec', and change the format string to '%.1w'. The figure in
front of the 'w' designates the number of digits shown.

14. Now, hopefully there will be no discussions about the precision coming up. A
comment specifying the material is still missing. From the main menu, select
'TechDraw | Annotations | Insert Annotation' (Figure 5-42).

Figure 5-42

15. The annotation can be dragged to a free space on the drawing. It is eventually
difficult to pick – in this case, right-click the drawing and select 'Toggle frames'
from the context menu. Then, it is easier to pick the annotation frame for drag-
ging.

16. The text of the annotation can be modified by clicking the property list entry for
'Text', and subsequent clicking the button to the right. A dialog opens, into
which the text can be entered. Type some additions for the material and the
tolerances, as shown in Figure 5-43.

● 81

FreeCAD for Electronics Applications.indd 81 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-43

With these steps, the drawing is completed. You could already dare to see a machine shop
with it (Figure 5-44). As already mentioned, technical drafting is a profession in its own
right, and the creation of fully constrained drawings is a kind of art. However, a few small
steps are taken. On top of it, the drawing will help you in the shed wielding the saw.

Figure 5-44

● 82

FreeCAD for Electronics Applications.indd 82 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

5.5 Create a Plan for the Bending Machine


For the bending, a plan is needed. It contains information about the position of the bends,
the direction of the bending and eventually a sequence in which the bending should be
done.

1. For the bending plan, generate a new page by clicking on the 'Insert Default
Page' tool button (leftmost in the workbench menu). Rename the new page to
'Bending Plan'.

2. In the tree view, mark the sketches 'Unfold_Sketch_Outline', 'Unfold_Sketch_


Internal' and 'Unfold_Sketch_Bends'. Then, click the 'Add view' tool button. (Fig-
ure 5-45). When the components in the view are not aligned properly, delete the
view again, and sync the placement parameters of the different unfold sketches.

Figure 5-45

3. Pick the view in the frame, or a free area inside, and drag it to a free spot on
the drawing surface. Adjust the 'Rotation' property if needed. Fill in the drawing
frame fields with name, date, etc.

4. As described in 5-4-4, add a vertical symmetry line. If the setup is failing, you
can remove the line again by marking it in the drawing and then selecting 'Tech-
Draw | Remove Cosmetic Object' from the main menu.

5. Add the dimensions given in Figure 5-46. These dimensions connect bending
positions with outer edges, which is useful for marking with a scribe. If you have
very good equipment, try the 1/100 mm for the marks on the sheet metal, or

● 83

FreeCAD for Electronics Applications.indd 83 24-08-2023 14:29


FreeCAD for Electronics Applications

the bending machine guides. If you use a ruler and a manual scribe, you could
reduce the precision of the dimensions to 1/10 mm, as described in 5-4-12.

Figure 5-46

6. With the bending plan, the succession of the different bends is important, be-
cause some of them, when done, might make others inaccessible for the bend-
ing tool. Anticipating this in advance may save some frustrations later. It is
already evident that the small stop which points to the bottom is not easy to
bend after the large flaps on the sides have been folded. To give the small bend
on the bottom the highest priority, mark it and add an annotation by selecting
'TechDraw | Annotations | Add Balloon Annotation' (Figure 5-47). A task window
opens. Insert for the text the order ('1') and the bending direction('d').

● 84

FreeCAD for Electronics Applications.indd 84 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

Figure 5-47

7. In the same way, add the annotations given in Figure 5-48. Please note: The
order of the bends depends on your bending machine and its capabilities.

● 85

FreeCAD for Electronics Applications.indd 85 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 5-48

5.6 Example Photos of the Battery Holder


After all this work in the virtual world, the question remains whether the result is mean-
ingful. The sheet metal part was made in the classical way: With your scribe, punching
machine, file, and calipers. The bending was done 'blind', without intermediate checking
with a battery. The only difference being that for the battery dimensions, the center of the
tolerance field was used. In consequence, some batteries might not fit well.

Figure 5-49

● 86

FreeCAD for Electronics Applications.indd 86 24-08-2023 14:29


Chapter 5 ● Working with Sheet Metal

Figure 5-50

Figures 5-49 and 5-50 show the result: The battery fits tightly but is not overly pressurized
by the part. The 'Sheet Metal' workbench from Shai Seeger works like a charm! It is also
good to look a bit more into the documentation which comes with it. With this simple ex-
ample, you have just scratched the surface of the possibilities available.

● 87

FreeCAD for Electronics Applications.indd 87 24-08-2023 14:29


FreeCAD for Electronics Applications

Chapter 6 ● Assemblies

6.1 “Assembly” Workbenches or Std-Part Container?


For FreeCAD, various assembly workbenches exist as AddOns. The ones used the most are
probably Assembly2, A2plus and Assembly4. The gigantic advantage of these AddOns is
evident: the ease of assembling components with defined degrees of freedom, plus a whole
catalog of meaningful relations. Whereas Assembly2 offers conditions that are intuitive and
easy to utilize, Assembly4 exclusively uses local coordinate systems for the link between
different objects. An introduction to Assembly2 is given in [Kis 2018], in Chapter 3, while
A2Plus is explained in [Kis 2019] and Chapter 9.

The ease of mounting assemblies with a few clicks also comes with a small caveat: The
assembled parts have changed their format away from the Std-Part-Container, since the
defined relations are now integrated into the component files. This makes the design recy-
cling or porting of components between assemblies more difficult. Also, the ability to open
and modify such assemblies relies on the availability of the workbenches themselves.

Another drawback is surfacing, i.e., when one of the parts is formed with its 'bodies' and
modified in relation to other parts during the assembly. You will get to work on such an ex-
ample in the next chapter: The design of a front panel, onto which components are placed.
In this case, it is desirable to link some of the parts such that, for example, mounting holes
or footprints show associative connections with the defining objects. Then, moving the
component will cause all the related details to follow in a synchronized way. Therefore, it is
necessary to shape the body objects of, for example, the dependent panel.

Furthermore, it is desirable to retain the ability to nest the design entities in arbitrary num-
bers and hierarchy levels. This allows the creation of nicely structured, complex designs,
which are broken up into manageable smaller entities. Following this path, a completed
assembly could resurface as a component of the next-level assembly.

This portability is already built into the basic concept of FreeCAD, with the inclusion of the
Std-Part-Container. Even though the popular 'Assembly' workbenches with their comforta-
ble utility can be of great help, also when simulating mechanisms, you will not proceed to
use them in the following chapters and stick with the Std-Part-Container only. That may
seem purist, but once this method is internalized, you can even better appreciate the “As-
sembly”-workbenches too and utilize them with applications they excel in — like making a
complex mechanism move.

● 88

FreeCAD for Electronics Applications.indd 88 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Chapter 7 ● A
 n Assembly Example: The Elektor ESR
Meter as a Front Panel Project

Sometimes, the compartment for a small piece of equipment exists before the idea for the
insides arrives. This was true with the author as well. From the flea market, there was a
leftover wooden box with a hinged lid, which seemed just right to use for the Elektor ESR
meter. To turn boxes like this into an instrument, the only structural part needed is a front
panel, maybe with some spacer feet in the corners, for the assembly. A meter in a wooden
box? Looks a bit retro. But then, why not? The circuit has been around for a long time, and
the addition of a recycled mechanical panel meter kind of reinforces the style.

7.1 Project Organization


Some initial thought about the organization of a new project is always meaningful. There
is one special part which will change and be adapted when other parts are merged into the
project tree: The front panel itself. For that reason, it should be packed into the project tree
right on top and in its own Std-Part-Container. The associative cutouts and mounting holes
that accumulate during the assembly can be conveniently collected there. If it is the first
branch in the tree view, it can be easily located for access.

Into the project, other components are added, like the binding posts. In their own
Std-Part-Containers, they are completely self-contained but eventually get associated with
engraved labels later on which should relocate together with these entities when they are
moved, for example, during the design optimization.

Other components are additions to already inserted objects like the control knob for the
potentiometer, which controls the scale zero position. Furthermore, these control elements
will very likely have associated labels and guide lines on the front panel. The same is true
for the rotary switch (ON/OFF and battery test position). The circuit board will rest on spac-
ers and have associated fasteners.

It is meaningful to group these related parts in enclosing Std-Part-Containers. This has


the nice side effect of generating a tidy and concise project tree. Furthermore, a lot of the
required associativity follows from this embedding practice, by reference to the coordinate
systems of the enclosing Std-Part-Containers — even when the grouped parts are only
placed (not attached) in there.

7.2 Preparation – Starting the New Project Tree


Start a new file and save it as 'ESR Meter'. Then, start a new Std-Part-Container and re-
name that to 'ESR Meter Complete'. For the front panel, start another Std-Part-Container
and rename that to 'Front Panel Complete'. Drag and drop the new Std-Part-Container into
'ESR Meter Complete'. The front panel is the only part that will be created and modified
over the course of the assembly. Switch to the 'Part Design' workbench and click the 'Cre-
ate body' tool button. Rename the new body object to 'Front Panel'. Figure 7-1 shows the
structure.

● 89

FreeCAD for Electronics Applications.indd 89 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-1

7.3 Modeling the Front panel


1. The wooden box constrains the dimensions of the front panel: Both the width
and the height have to equal 160 mm in order to fit inside. To prepare the de-
sign, double-click the 'Front Panel' body to activate it (its title is then shown in
bold letters). This selects the 'Front Panel' body as the destination for the opera-
tions to be applied next. In a complex project tree, it is important to track which
object is activated.

2. Start the sketcher and select the XY plane from the initial selection dialog. Click
the 'OK' button to proceed. Click on the 'Create a centered rectangle' tool button
and draw a rectangle, which is centered around the origin (Figure 7-2). End the
drawing command with a right click. Mark a horizontal line of the rectangle and
click the 'Constrain horizontal distance' tool button. Enter a value of 160 mm. In
a similar way, constrain the height of the rectangle to 160 mm. Close the sketch.

● 90

FreeCAD for Electronics Applications.indd 90 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-2

3. Parts that are attached to the front side of the front panel need a reference,
which is immune against re-enumeration (the front panel will change a lot dur-
ing the assembly process). This is easiest done with a datum plane. In the tree
view, display the coordinate system of the 'Front Panel' body (mark it and press
the SPACE key).

4. In the 3D view, click on blue to deselect the whole coordinate system. Then
mark the XY plane. Click on the 'Create a datum plane' tool button. In the task
window, thanks to our prior marking, the XY plane is already preset. Set the
attachment Z offset to 2 mm (the sheet metal thickness, Figure 7-3). Hide the
coordinate system again with the SPACE key. Rename the new datum plane to
'Front Panel Top Face'.

● 91

FreeCAD for Electronics Applications.indd 91 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-3

5. In the tree view, mark the new sketch and click the 'Pad' tool button. In the task
window, set the type to 'Up to face'. Then, in the 3D view, click the representa-
tion of the datum plane (Figure 7-4). Close the task window with the 'OK' button.

● 92

FreeCAD for Electronics Applications.indd 92 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-4

6. In the tree view, mark the datum plane and hide it with the SPACE key. Also,
hide the coordinate system. Collapse the 'Front Panel Complete' branch.

7.4 Insertion of the Rotary Switch


1. In the directory 'Sample Projects | ESR Meter | Components', locate the file
'Rotary Switch' and open it. In the file just opened, mark the Std-Part-Contain-
er 'Rotary Switch Complete' and copy it by pressing CTRL-C. A selection dialog
opens (Figure 7-5). Do not change the standard selection, and click the OK
button to proceed.

● 93

FreeCAD for Electronics Applications.indd 93 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-5

2. In the tree view, double-click the root of the file 'ESR Meter', in order to activate
it as the destination for the following paste operation. Then, paste in the rotary
switch with CTRL-V.

3. Drag and drop the Std-Part-Container 'Rotary Switch Complete' into the
Std-Part-Container 'ESR Meter Complete'. Close the file 'Rotary Switch' by
right-clicking its root node and selecting 'Close document' from the context
menu (Figure 7-6). Sometimes, if the activation of the destination file has been
omitted, the pasted object appears in the source document. If this happens,
delete the misplaced object (or press CTRL-Z) and start over.

● 94

FreeCAD for Electronics Applications.indd 94 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-6

4. The position of the rotary switch can be adapted by editing the 'Placement'
parameters. To display a task window with these parameters, in the tree view,
mark the Std-Part-Container 'Rotary Switch Complete'. In the property list, click
into the 'Placement' edit field, then click the button appearing on the right-
hand side of that field.

5. In the task window, click the X Translation field and roll either the mouse wheel
(this is a fun part, due to the live update!) or enter the value manually. Set the
X translation to –41 mm. In the same way, set the Y translation to –60 mm. If
you enter the value manually, do not press the ENTER key if further changes
are intended, as the ENTER key will close the task window. Just click the next
edit field for more changes. If you are done, close the task window with the 'OK'
button (Figure 7-7).

● 95

FreeCAD for Electronics Applications.indd 95 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-7

7.5 Generate an Associative Footprint with the SubShapeBinder


With a nice CAD program, there is no need to draw the mounting holes for a component
manually. When a SubShapeBinder is used, all of this can be done with a few clicks:

1. In the tree view, hide all components except the 'Rotary Switch' body by mark-
ing the items and subsequently pressing the SPACE key.

2. In the tree view, double-click the Std-Part-Container 'Front Panel Complete' to


set the destination for the new SubShapeBinder. This works even though the
container is hidden. The title of the container appears in bold letters once it is
activated. In the container, also double-click the 'Front Panel' body to activate it.
Here, you want the SubShapeBinder to go.

3. In the 3D view, while holding down the CTRL key, select the two contours that
define the front panel footprint. Mark the contours at the base of the geometry,
because for the following, the height of the curves has to match. Then, click the
'Create a sub object(s) shape binder' tool button (Figure 7-8).

● 96

FreeCAD for Electronics Applications.indd 96 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-8

4. Scroll up the tree view and locate the new, green SubShapeBinder in the body
'Front Panel'. Rename it to 'Footprint Rotary Switch' (Figure 7-9).

Figure 7-9

● 97

FreeCAD for Electronics Applications.indd 97 24-08-2023 14:29


FreeCAD for Electronics Applications

5. In the tree view, show again the Std-Part-Container 'Front Panel Complete'
(mark it and press the SPACE key).

6. In the tree view, mark the new SubShapeBinder and click the 'Pocket' tool but-
ton (Figure 7-10).

Figure 7-10

7. In the task window, select for the type 'Through all' and check the 'Reversed'
checkbox (Figure 7-11).

● 98

FreeCAD for Electronics Applications.indd 98 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-11

8. In the tree view, display the washer and the nut of the rotary switch again (with
the SPACE key).

If you hide the Std-Part-Container 'Rotary Switch Complete' (mark in the tree view, and
press the SPACE key), you can see the mounting holes in the front panel (Figure 7-12).

Figure 7-12

● 99

FreeCAD for Electronics Applications.indd 99 24-08-2023 14:29


FreeCAD for Electronics Applications

The SubShapeBinder keeps track of the referenced item by default (in contrast, the Sha-
peBinder has a 'Tracking' property that needs to be set to True to do that). Therefore, the
mounting holes will follow changes of the rotary switch placement — very comfortable!

Figure 7-13

Figure 7-14

● 100

FreeCAD for Electronics Applications.indd 100 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Please note that the rotary switch will follow modifications of its placement parameters
instantaneously (Figure 7-13), but not the footprint in the front panel. In order to update
the front panel, either click the 'Apply' or the 'OK' button (Figure 7-14).

7.6 The Knob and its Place in the Tree View


Now, a control knob can be added for the switch. This is easiest done by adding the knob
to the 'Rotary Switch Complete' Std-Part-Container. Embedded there, the knob will then
follow true and steady if the placement of the switch is changed. Furthermore, a nice tree
structure results, because all the bits and pieces belonging to the switch are now contained
in one branch, which can be collapsed to gain more overview. As a candidate for the control
knob, a model made for a recycled one is contained in the directory with the components.
Yes, with FreeCAD, such lovely old pieces can also obtain a second life!

1. In the directory 'Sample Projects | ESR Meter | Components', locate the file
'Knob Recycling', and open it. Copy the Std-Part-Container 'Knob Recycling
Complete' with CTRL-C. In the displayed selection dialog, do not change the
default selection and click 'OK' to proceed.

2. In the tree view, double-click the root node 'ESR Meter' (to set the paste desti-
nation) and insert the knob with CTRL-V. Then, drag-and-drop the new container
into the Std-Part-Container 'Rotary Switch Complete'. Close the document 'Knob
Recycling' (Figure 7-15). The placement of the knob is already correct in X and
Y coordinates.

Figure 7-15

● 101

FreeCAD for Electronics Applications.indd 101 24-08-2023 14:29


FreeCAD for Electronics Applications

3. The knob still scratches on the front panel. In order to give it some Z offset, in
the tree view, mark the Std-Part-Container 'Knob Recycling Complete', and edit
its placement in the property list. Either expand the list entries until you can ac-
cess the Z position ('Placement | Position | Z') or open a task window by clicking
into the 'Placement' edit field, and then on the button to the right. Set the Z
translation to 4 mm (Figure 7-16).

Figure 7-16

7.7 Testing the Associativity


A small test demonstrates the associativity: Change the placement of the rotary switch,
i.e., set the X translation to zero (Figure 7-17). As expected, the objects move and the
footprint waits for a recalculation.

● 102

FreeCAD for Electronics Applications.indd 102 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-17

To update the front panel, in the task window, either the 'Apply' or the 'OK' button must be
pressed (Figure 7-18). If you press the 'Apply' button too early, the objects get deselected.
This also happens if you click somewhere in the 3D view. In this case, you need to close
and reopen the task window again and start over.

Figure 7-18

● 103

FreeCAD for Electronics Applications.indd 103 24-08-2023 14:29


FreeCAD for Electronics Applications

As an exercise, you can add the potentiometer with its control knob to the assembly. The
steps are similar to the ones for the rotary switch. The coordinates for the potentiometer
are: X = 11 mm, Y = –60 mm. The result is shown in Figure 7-19.

Figure 7-19

On the rear of the front panel, the terminals of the potentiometer point in an unfavorable
direction (Figure 7-20).

Figure 7-20

● 104

FreeCAD for Electronics Applications.indd 104 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

The orientation of the potentiometer is easily changed. In the tree view, mark the
Std-Part-Container 'Potentiometer Complete'. In the property list, click into the edit field of
the 'Placement' field and then on the button. Change the rotation angle to –90° (Figure
7-21). In the 3D view, turn the front panel around. You can change the orientation of the
control knobs in a similar way. Locate the Std-Part-Containers of the knobs by expanding
the corresponding branches of the tree view.

Figure 7-21

7.8 The Binding Posts


1. Locate and open the file 'Sample Projects | Components | Binding Post.FC-
Std'. Mark the Std-Part-Container 'Binding Post Complete' and copy it, pressing
CTRL-C. In the pop-up selection dialog, do not change the standard selection
and click the 'OK' button to proceed.

2. Double-click the 'ESR Meter' root node of the tree. Press CTRL-V to in-
sert the Std-Part-Container 'Binding Post Complete'. Drag-and-drop the new
Std-Part-Container into 'ESR Meter Complete'.

The binding post is placed too low – the front side insulating washer coincides with the rear
of the front panel (Figure 7-22). It should, however, be attached to the front side of the
panel.

● 105

FreeCAD for Electronics Applications.indd 105 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-22

To correct the issue, several possibilities exist:

3. The front panel thickness is assumed to never change (there is only one piece of
aluminum sheet in the basement). In this case, editing the 'Placement' parame-
ters can transport the binding post to the correct position. For most of the cases,
this quick and simple approach is fully sufficient.

4. The front panel is the top Std-Part-Container, and it will not be copied further
and pasted into other assemblies. In this case, you can define a blue shape bind-
er which refers to the top face of the front panel. To make that accessible for the
attachment of other objects, it can be dragged and dropped to, for example, the
parent Std-Part-Container.

An issue may arise though: Should the front panel be copied and pasted later on, then the
calculation of the global coordinates will fail with the shape binder. Still, you could use the
shape binder while designing the panel and set its 'Tracking Support' to False when the
design stage is finished.

5. The most complex case arises if the front panel is a sub-assembly of a larger
project and the insertion with copy-and-paste is intended, plus the associativity
with the panel thickness has to be provided. As a solution, a green SubSha-
peBinder could be used. One inherent limitation has yet to be overcome though.

● 106

FreeCAD for Electronics Applications.indd 106 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

If the SubShapeBinder references an infinite shape like a datum plane (e.g.,


'Font Panel Top Face' in the 'Front Panel' body), it will not allow you to attach
other objects. As a solution, you can create a sketch of the outline on the 'Front
Panel Top Face' and refer the SubShapeBinder to that (finite) object. Then, the
attachment of components to the top face of the panel works, and the complet-
ed sub-assembly can be copied and pasted into other work (we will do that in
another project later).

This discussion seems a tad academic. But let's spend a little extra time now to shed light
on these methods so you can proceed faster at a later time. Let's add the sketch to the
front panel:

6. Double-click the body called 'Front Panel' (expand the 'Front Panel Complete'
Std-Part-Container to locate it). Mark the 'Front Panel Top Face' datum plane and
start the sketcher (Figure 7-23).

Figure 7-23

7. Click the 'External geometry' tool button and mark all 4 lines of the outer front
panel contour (Figure 7-24).

● 107

FreeCAD for Electronics Applications.indd 107 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-24

8. Click the 'Create a rectangle' tool button and draw a rectangle on top of the
violet construction lines (Figure 7-25). Close the sketch with the 'Close' button
(top). Rename the sketch to 'Front Panel Top Face Contour'.

● 108

FreeCAD for Electronics Applications.indd 108 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-25

9. Now, you create the SubShapeBinder. It will appear in the currently activated
object. The SubShapeBinder is needed at a location where it is accessible for
other objects. The most meaningful destination is the Std-Part-Container called
'ESR Meter Complete'. To deactivate the body 'Front Panel', right-click it in the
tree view, and select 'Toggle active body' from the context menu. The title of the
deactivated 'Front Panel' body now appears in normal type.

10. In the deactivated body, mark the sketch 'Front Panel Top Face Contour'. Then,
click the green 'Create a sub object(s) shape binder' tool button (Figure 7-26).
Hide the sketch 'Front Panel Top Face Contour'.

● 109

FreeCAD for Electronics Applications.indd 109 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-26

11. Rename the new SubShapeBinder to 'Front Panel Top'. Drag-and-drop it in the
Std-Part-Container 'ESR Meter Complete' (Figure 7-27). Then, hide the new
SubShapeBinder.

Figure 7-27

● 110

FreeCAD for Electronics Applications.indd 110 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Now, you have created a robust reference to the front panel top face. In order to have the
maximum use of it, all related elements could be attached to this reference. The resulting
associativity would make all attached parts follow any thickness variations of the front pan-
el. As an example, you can correct the positioning of the binding post:

12. In the tree view, mark the Std-Part-Container 'Binding Post Complete'. Then,
switch to the 'Part' workbench. From the main menu, select 'Part | Attachment'.
In the task window, click into the edit field for Reference 1 (which displays the
label 'Selecting...').

13. In the Combo View, switch to the 'Model' tab and click the SubShapeBinder
'Front Panel Top'. Then return to the 'Tasks' tab. From the attachment mode list,
select 'XY on plane'. This updates the position of the binding post, which moves
to the front face of the front panel (Figure 7-28). Close the task window with
the 'OK' button.

Figure 7-28

14. In the tree view, mark the Std-Part-Container 'Binding Post Complete'. In the
property list, click the edit field 'Attachment' (we have to use the attachment
now, which overrides the placement). Then, open the task window by clicking

● 111

FreeCAD for Electronics Applications.indd 111 24-08-2023 14:29


FreeCAD for Electronics Applications

the button to the right. (The task window has the title 'Placement' – slightly
confusing, but you can safely ignore this). Enter the following values for the
translations: X = 57 mm, Y = 36 mm (Figure 7-29).

Figure 7-29

Now you can test the associativity so achieved: The front panel thickness is controlled by
the datum plane 'Front Panel Top Face', in the 'Front Panel' body object. Mark the datum
plane. Open the task window for the 'Attachment' parameters in the property list by click-
ing into the edit field, and then on the button. If you insert a value like 5 mm for the Z
translation, and click the 'Apply' button, the binding post remains correctly placed on the
front side of the front panel (Figure 7-30).

● 112

FreeCAD for Electronics Applications.indd 112 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-30

As a small drawback, the rear insulating washer now collides with the rear of the front
panel. To fix this issue, another attachment relation would need to be declared for the
components that refer to the rear face of the front panel. This would increase the length
of this step-by-step instruction sequence further, so you may try to perfect the model on
your own in the described way (e.g., make the control knobs and fasteners follow the front
panel thickness, etc.).

The second binding post can be generated with a link. This saves time. As an additional
advantage, changes on the parent object are also transmitted to the linked copies of it (like
the placement adaptions on fasteners, appearance, and color selections). In contrast to
this, a clone would have resulted in an independent copy of the parent object.

15. In the tree view, rename the binding post container to 'Binding Post Complete 1'.

16. In the tree view, mark 'Binding Post Complete 1' and click the 'Make link' tool
button (Figure 7-31). Rename the new Std-Part-Container to 'Binding Post 2'.
Drag-and-drop it into the Std-Part-Container 'ESR Meter Complete' (Figure
7-32).

● 113

FreeCAD for Electronics Applications.indd 113 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-31

Figure 7-32

● 114

FreeCAD for Electronics Applications.indd 114 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

17. In the tree view, mark 'Binding Post Complete 2'. In the property list, set the
property 'Link Transform' to 'true' (Figure 7-33). With this choice, the 'Link
Placement' parameters are defined relative to 'Binding Post Complete 1'.

Figure 7-33

18. Edit the 'Link Placement' parameters and enter a value of -38 mm for the Y
translation (Figure 7-34).

● 115

FreeCAD for Electronics Applications.indd 115 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-34

19. In the tree view, expand 'Binding Post Complete 1' and hide 'Insulating Washer
2', 'Washer' and 'Nut' (because the second binding post is a linked object, it
follows).

20. If the body 'Front Panel' is still activated (its title is shown in bold), deactivate it
(otherwise, with the next steps, a cyclic error would be thrown).

21. On the binding posts, mark all edges which define the footprint. Hold down the
STRG key for this multiple selection (Figure 7-35).

● 116

FreeCAD for Electronics Applications.indd 116 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-35

22. Click the green 'Create a sub object(s) shape binder' tool button. The shape
binder will appear in the root branch of the tree. Rename it to 'Footprint Binding
Posts'. Drag-and-drop it into the body 'Front Panel' (Figure 7-36).

Figure 7-36

● 117

FreeCAD for Electronics Applications.indd 117 24-08-2023 14:29


FreeCAD for Electronics Applications

23. Double-click the body 'Front Panel' to activate it (title shown in bold letters). In
the tree view, mark the SubShapeBinder 'Footprint Binding Posts' and click the
'Pocket' tool button (Figure 7-37). In the task window, select the type 'Through
all' and check the 'Reversed' checkbox (Figure 7-38). Close the task window with
the 'OK' button.

Figure 7-37

Figure 7-38

● 118

FreeCAD for Electronics Applications.indd 118 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

24. The punched-out footprint can be shown by hiding 'Binding Post Complete 1' and
'Binding Post Complete 1' (Figure 7-39).

Figure 7-39

25. In the tree view, display 'Insulating Washer 2', 'Washer' and 'Nut' again with the
SPACE key. Also, display the Std-Part-Containers 'Binding Post Complete 1' and
'Binding Post Complete 1' again.

7.9 Placement of the Panel Meter


The placement of the panel meter is left here as an exercise for you. The file is contained in
'Sample Projects | ESR Meter | Components'. You can attach it to the 'Front Panel Top' Sub-
ShapeBinder, like the binding posts, and select 'XY on plane' as the attachment mode. For
the attachment offsets, use: X = –17 mm, Y = 7 mm. The result is shown in Figure 7-40.

● 119

FreeCAD for Electronics Applications.indd 119 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-40

For the footprint of the panel meter, the mounting bolts as well as the cylindrical part of the
casing must be selected for the definition of the SubShapeBinder. If you select the top faces
of these objects, they may reside at different heights. This can lead to an error message
later (like 'Curves are not coplanar'), when the 'Pocket' tool is used to model the footprint
later. For this reason, it is better to define the SubShapeBinder with the contours at the
base of the features, where they are attached to a plane facet to the casing. To proceed,
in the tree view, hide the Std-Part-Container 'Front Panel Complete' as well as all the nuts
and washers of the panel meter. That exposes all edges necessary for the footprint. Mark
them in the 3D view (Figure 7-41). Verify that the 'Front Panel' body is still activated (as
the destination for the SubShapeBinder) before you click the 'Create a sub object(s) shape
binder' tool button. Locate the new SubShapeBinder at the destination (with larger project
trees, this invokes scrolling back and forth). Rename it to 'Footprint Panel Meter'.

● 120

FreeCAD for Electronics Applications.indd 120 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-41

Mark the new SubShapeBinder and click the 'Pocket' tool button. In the task window, select
the type 'Through all'. Because the pocket extends from the front side towards the back,
the checkbox 'Reversed' can be left unchecked in this case (Figure 7-42). The punched-out
footprint is shown by hiding the panel meter in Figure 7-43.

● 121

FreeCAD for Electronics Applications.indd 121 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-42

Figure 7-43

● 122

FreeCAD for Electronics Applications.indd 122 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

7.10 Placing Components to the Rear Surface: The Anchor Plates


When the design grows on the computer screen, it is also good to conceive how the wiring
should proceed later. Some anchor plates can hold the wiring harness nicely in place with
some cable ties strapped to it.

In most cases, the anchor plates reside on the rear face of the front panel, like with our
project. The following table summarizes the positions and rotation angles:

Anchor X [mm] Y [mm] Rotation


around Z [°]
1 –13 –23 –90
2 46 –23 –90
3 –29.5 –2 90
4 –29.5 –14 180

1. In the directory 'Sample Projects | ESR Meter | Components', locate and open
the file 'Anchor Plate'. Copy the Std-Part-Container 'Anchor Plate Complete' and
press CTRL-C. In the pop-up selection dialog, do not change the default selection
and click 'OK' to proceed.

2. In the tree view, double-click the root node 'ESR Meter'. Insert the Std-Part-Con-
tainer with the anchor plate by pressing CTRL-V. Drag and drop the new
Std-Part-Container into the Std-Part-Container 'ESR Meter Complete'.

3. In the tree view, mark the 'Anchor Plate Complete' Std-Part-Container, and
switch to the 'Part' workbench. From the main menu, select 'Part | Attachment'.

4. In the task window, click into the edit field next to 'Reference 1' (the button is
shown in dark gray, with the label 'Selecting...'). Click on the 'Model' tab. In the
tree view, expand the coordinate system node of the Std-Part-Container 'ESR
Meter Complete'. Click on the XY plane and return to the 'Tasks' tab. For the
attachment mode, select 'XY on plane'. For the attachment offsets, enter the
values from the table above. Finally, check the 'flip sides' checkbox, as the an-
chor plate is attached from the back (Figure 7-44). Close the task window with
the 'OK' button.

● 123

FreeCAD for Electronics Applications.indd 123 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-44

5. In the tree view, rename the anchor plate to 'Anchor Plate Complete 1'.

6. In the tree view, mark 'Anchor Plate Complete 1' and click the 'Make link' tool
button (Figure 7-45).

● 124

FreeCAD for Electronics Applications.indd 124 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-45

7. Drag-and-drop the new anchor plate into 'ESR Meter Complete'. Rename it to
'Anchor Plate Complete 2'. Repeat the positioning, as it was done for the first
anchor plate in steps 3 and 4, using the attachment offset values from the table
above.

8. In a similar way, create the anchor plates 3 and 4. The result is shown in Figure
7-46.

● 125

FreeCAD for Electronics Applications.indd 125 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-46

9. For the mounting holes in the front panel, a SubShapeBinder has to be defined.
If necessary, double-click the 'Front Panel' body (In 'Front Panel Complete'), to
activate it. This is setting it as the destination for the SubShapeBinder, created
in the next steps.

10. In 'Anchor Plate Complete 1', hide the screw and the nut. The linked objects
follow automatically. Very convenient!

11. Mark the edges of the holes in the anchor plates. Then, click the 'Create a sub
object(s) shape binder' tool button (Figure 7-47).

● 126

FreeCAD for Electronics Applications.indd 126 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-47

12. In the body 'Front Panel', rename the new SubShapeBinder to 'Footprint Anchor
Plates'. Mark the new SubShapeBinder. In the property list, set the parameter
'Make face' to 'false'.

Figure 7-48

● 127

FreeCAD for Electronics Applications.indd 127 24-08-2023 14:29


FreeCAD for Electronics Applications

13. In the tree view, mark the new SubShapeBinder, and click the 'Hole' tool button
(Figure 7-49).

Figure 7-49

14. In the task window, enter a diameter of 3.2 mm and select 'Through all' for the
depth. Check the 'Reversed' checkbox (Figure 7-50). Close the task window with
the 'OK' button.

Figure 7-50

● 128

FreeCAD for Electronics Applications.indd 128 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

15. In the tree view, expand 'Anchor Plate Complete 1'. Display the screw and the
nut again with the SPACE key.

7.11 Inserting the Battery Holder


Like the anchor plates, the battery holder is attached to the rear of the front panel. As an
example, we've selected a sheet metal design in order to highlight some of the nice 'Sheet
Metal' workbench capabilities.

This decision could be debated: Batteries usually leak an aggressive liquid when they fail.
This leakage could attack and corrode the aluminum pieces. To increase the longevity of
the instrument, a plastic sheet could be wrapped around the battery for protection. As an
alternative, the battery holder could be redesigned and made from plastic using a 3D print-
er. To proceed with the example case, let's stick to the aluminum version.

16. Run the standard procedure: In the directory 'Sample Projects | ESR Meter |
Components', locate and open the file '9V Battery Holder'. Copy and paste the
'9V Battery Holder Complete' Std-Part-Container into the 'ESR Meter' document
tree. Then, drag and drop it into the ESR Meter complete' Std-Part-Container
(Figure 7-51). Close the '9V Battery Holder' document tree.

Figure 7-51

17. Switch to the 'Part' workbench. In the tree view, mark the '9V Battery Holder
Complete' Std-Part-Container. From the main menu, select 'Part | Attachment'.
Click into the edit field for Reference 1, of which the label reads 'Selecting...'
(Figure 7-52). Switch to the 'Model' tab.

● 129

FreeCAD for Electronics Applications.indd 129 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-52

18. In the tree view, select the XY plane of 'ESR Meter Complete' (Figure 7-53).

Figure 7-53

● 130

FreeCAD for Electronics Applications.indd 130 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

19. Return to the 'Tasks' tab. For the attachment mode, select 'XY on plane'. For
the attachment offsets, enter X = –24 mm, Y = –52 mm and a rotation angle of
–90° around the Z axis. Check the 'Flip sides' checkbox. (Figure 7-54). Close the
task window with the 'OK' button.

Figure 7-54

20. In order to place the mounting holes for the battery holder, in the tree view,
double-click the 'Font Panel' body. This again sets the destination for the Sub-
ShapeBinder which you are about to create.

21. In the tree view, expand the '9V Battery Holder Complete' Std-Part-Container.
Hide all screws and nuts with the SPACE key to expose the view of the hole edg-
es. Scroll up to the 'Front Panel Complete' Std-Part-Container and double-click
the 'Front Panel' body to activate it, and to set it thereby as the destination for
the SubShapeBinder.

22. Hold down the CTRL key and, in the 3D view, mark both mounting hole edges
on the battery holder (Figure 7-55). Then, click the green 'Create a sub object(s)
shape binder' tool button.

● 131

FreeCAD for Electronics Applications.indd 131 24-08-2023 14:29


FreeCAD for Electronics Applications

Figure 7-55

23. Rename the new shape binder (scroll back to the 'Front Panel' body object, the
tree view keeps jumping) to 'Footprint Battery Holder'. In the property list, set
the 'Make face' property to 'false' (Figure 7-56).

Figure 7-56

● 132

FreeCAD for Electronics Applications.indd 132 24-08-2023 14:29


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

24. In the tree view, mark the new SubShapeBinder, and click the 'Hole' tool button.
In the task window, enter for the diameter 3.2 mm, and select for the depth
'Through all'. Also, check the 'Reversed' checkbox (Figure 7-57). Close the task
window with the 'OK' button.

Figure 7-57

25. In the tree view, mark the fasteners for the 9V battery holder, and display them
with the SPACE key (Figure 7-58).

Figure 7-58

● 133

FreeCAD for Electronics Applications.indd 133 24-08-2023 14:29


FreeCAD for Electronics Applications

7.12 Inserting the Circuit Board


A fascinating opportunity with FreeCAD comes into play when circuit boards designed with
KiCad [DAL 2022] are combined with mechanical elements. KiCad has an option to export
a 3D model of the circuit board as a STEP file. Importing to FreeCAD is achieved with only
a few mouse clicks:

1. In the directory 'Sample Projects | ESR Meter | Components', locate and open
the file 'ESR_Meter_001.step'. FreeCAD creates a new document and inserts the
STEP file contents in an Std-Part-Container. Rename the container to 'ESR Meter
PCB Complete' (Figure 7-59).

Figure 7-59

2. Copy the renamed Std-Part-Container with CRTL-C.

3. Double-click the document node 'ESR Meter' to set the destination for the paste
command.

If you forget this step, the components get copied into the source again. That can in-
volve many objects due for manual removal afterwards. Eventually, the helpful CTRL-Z will
undo the result as well. It is a good practice to close the source document node after the
Std-Part-Container got copied.

4. Drag and drop the new Std-Part-Container into 'ESR Meter Complete'. That's all
there is to it – simple and efficient (Figure 7-60).

● 134

FreeCAD for Electronics Applications.indd 134 24-08-2023 14:30


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-60

5. Now, you attach the circuit board to the assembly: Mark the Std-Part-Container
'ESR Meter PCB Complete' and switch to the 'Part' workbench. From the main
menu, select 'Part | Attachment'. In the task window, the collector for 'Reference
1' is already activated. From the tree view in the 'Model' tab, select the XY plane
to the 'ESR Meter Complete' Std-Part-Container. Return to the 'Tasks' tab. Check
the 'Flip sides' checkbox and enter the following attachment offsets: X = -122
mm, Y = –78 mm, Z = 18 mm, Rotation about Z = 90° (Figure 7-61). Close the
task window with the 'OK' button.

● 135

FreeCAD for Electronics Applications.indd 135 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 7-61

6. In order to set the destination for the upcoming SubShapeBinder, double-click


the 'Front Panel' body. This will activate it. Mark the 4 edges of the PCB mounting
holes. Then, click the 'Create a sub object(s) shape binder' tool button.

Figure 7-62

● 136

FreeCAD for Electronics Applications.indd 136 24-08-2023 14:30


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

7. The tree view will jump away from the destination object and expose the node
of the last item which was marked in the 3D view. Scroll up to locate the new
SubShapeBinder in the 'Front Panel' body. Rename it to 'Footprint PCB' and set
its 'Make face' property to 'false' (Figure 7-63). Then, click the 'Hole' tool button.

Figure 7-63

8. In the task window, set the diameter to 3.2 mm, select for the depth 'Through
all', and check the 'Reversed' checkbox (Figure 7-64). Close the task window
with the 'OK' button.

● 137

FreeCAD for Electronics Applications.indd 137 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 7-64

The circuit board is still missing its fasteners. You have several options where to place them
within the project tree. One option is to attach the fasteners to the holes in the front panel.
Alternatively, the fasteners could be added to the Std-Part-Container of the circuit board.
Because the second possibility results in a less complex project tree, let's pursue that:

9. In the directory 'Sample Projects | ESR Meter | Components', locate and open
the file 'Spacer'. It is an 18 mm version of the file that you have created in
Chapter 4. Copy the Std-Part-Container 'Spacer Complete' with CTRL-C, and do
not change the default selection in the pop-up selection dialog. Click on the OK
button to proceed.

10. Close the document node 'Spacer'. This activates the document node 'ESR Me-
ter' again. (if more than one document remains in the tree, you have to check
which one is activated, with the title shown in bold letters. Insert the spacer with
CTRL-V.

11. Rename the Std-Part-Container 'Spacer Complete' to 'Spacer Complete 1'. Drag-
and-drop it into the Std-Part-Container 'ESR Meter PCB board Complete' (Figure
7-65).

● 138

FreeCAD for Electronics Applications.indd 138 24-08-2023 14:30


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-65

12. In the tree view, mark 'Spacer Complete 1' and switch to the 'Part' workbench.
From the main menu, select 'Part | Attachment'. From the rear of the circuit
board, select the edge of a mounting hole (hiding the front panel with the SPACE
key will make that easier). For the attachment mode, select 'Concentric' (Figure
7-66). Set the attachment offset Z to –18 mm (Figure 7-68) and close the task
window with the 'OK' button.

Figure 7-66

● 139

FreeCAD for Electronics Applications.indd 139 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 7-67

13. The other spacers are created as link objects. In the tree view, mark 'Spacer
Complete 1' and click the 'Make link' tool button. While you are there, repeat
that two more times, in order to create all the spacers at once. In the tree view,
rename them to 'Spacer Complete 2' to 'Spacer Complete 4'. Make sure to al-
ways mark again 'Spacer Complete 1' as the parent of the link again, before you
click the 'Make link' button.

14. Repeat the attachment procedure as described for 'Spacer Complete 1' for all
the spacers, distributing them to the different mounting holes of the PCB. The
result is shown in Figure 7-68.

● 140

FreeCAD for Electronics Applications.indd 140 24-08-2023 14:30


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-68

For the attachment of the front panel to the wooden box (or the enclosure of your choice),
four studs are still missing. Again, the first stud will be copied from a file, and the residual
ones are then generated as link objects:

15. In the directory 'Sample Projects | ESR Meter | Components', locate and open
the file 'Spacer Casing'. Copy the Std-Part-Container 'Spacer Casing Complete'
with CTRL-C. In the popup selection dialog, do not change the default selection
and click the 'OK' button to proceed.

16. In the tree view, close the document node 'Spacer Casing'. Insert the copied ob-
ject by CTRL-V. Rename the new Std-Part-Container to 'Spacer Casing Complete
1'. Drag and drop it into the 'ESR Meter Complete' Std-Part-Container.

17. In the tree view, mark 'Spacer Casing Complete 1'. In the property list, edit the
placement parameters and enter the translations: X = –75 mm, Y = –75 mm
(Figure 7-69).

● 141

FreeCAD for Electronics Applications.indd 141 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 7-69

18. In the tree view, mark 'Spacer Casing Complete 1' and click the 'Make link' tool
button. Repeat this step 2 more times, in order to generate all the spacers at
once.

19. Rename the new spacer containers to numbered versions of the parent spacer.
Drag-and-drop the new spacers into the 'ESR Meter Complete' std-Part-Contain-
er. Edit the placement parameters of the added objects such that the spacers
are distributed into all the front panel corners (X, Y = +/– 75 mm). The result
is shown in Figure 7-70.

● 142

FreeCAD for Electronics Applications.indd 142 24-08-2023 14:30


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-70

20. In order to expose the edge of the mounting holes, in 'Spacer Casing Complete
1', hide the front-side screw with the SPACE key (all the linked ones follow au-
tomatically).

21. To set the destination for the SubShapeBinder generated next, activate the body
'Front Panel' with a double click. Then, hide it also with the SPACE key.

22. Switch back to the 'Part Design' workbench.

23. In the 3D view, mark the edges of the mounting holes in the casing spacers.
Then, click the green 'Create a sub object(s) shape binder' tool button (Figure
7-71).

● 143

FreeCAD for Electronics Applications.indd 143 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 7-71

24. Rename the new SubShapeBinder in 'Front Panel' to 'Footprint Spacers Casing'.
In the property list, set the property 'Make face' to False (Figure 7-72). Then,
click the 'Hole' tool button.

Figure 7-72

● 144

FreeCAD for Electronics Applications.indd 144 24-08-2023 14:30


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

25. In the task window, select enter a value of 3.2 mm for the diameter, select
'Through all' for the depth, and check the 'Reversed' checkbox (Figure 7-73).
Close the task window with the 'OK' button (top).

Figure 7-73

26. In the tree view, display the body 'Front Panel' again, with the SPACE key, as
well as the hidden screw of the 'Spacer Casing 1' (Figure 7-74).

● 145

FreeCAD for Electronics Applications.indd 145 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 7-74

This concludes the mechanical design of the ESR meter. There are a few things best left to
you — the holes have no countersunk edges yet. It can be tricky to add those because the
holes are generated from the rear, in 'Reverse' mode. You could try to apply a chamfer with
the front edge of these holes. But eventually, it is even better to omit those details because
that could make the data transfer to the milling machine slightly easier.

However, one small error is still concealed in the design, a bit intentional, to demonstrate
the advantages of an associative design. If you inspect the assembly from the rear, you can
spot a collision between an anchor plate and a spacer (Figure 7-75).

● 146

FreeCAD for Electronics Applications.indd 146 24-08-2023 14:30


Chapter 7 ● An Assembly Example: The Elektor ESR Meter as a Front Panel Project

Figure 7-75

The issue can be resolved by shifting the circuit board in the X direction: Click on the
'ESR Meter PCB Complete' Std-Part-Container and expand the attachment parameters. By
setting the attachment offset X to –121 mm, the collision is avoided (Figure 7-76). It is
evident, that by the associative relations between the circuit board, the spacers, the fas-
teners and the holes in the front panel, the operation could be achieved by changing only
one parameter.

Figure 7-76

Although this may look like a trivial example, there are a multitude of possibilities arising
for optimization and serialization of designs once the associativity is properly defined.

● 147

FreeCAD for Electronics Applications.indd 147 24-08-2023 14:30


FreeCAD for Electronics Applications

Chapter 8 ● F
 inalizing the Front Panel with Graphic
Elements

For the professional look of an instrument as well as the provision of intuitive user guid-
ance, well-designated control elements can make a big difference. While customized stick-
ers from a label printer may be sufficient for a quick demo or prototype, engraved lettering
will add to the longevity of a released instrument. If you are lucky and own some thin
milling cutters (with 0.5 mm diameter, for instance), it is not difficult to produce such en-
graving. Filled with paint, it will give good contrast with even the ability for color highlight
important sections. For rotary switches and potentiometers, guide lines provide additional
order and structure with the panel design.

8.1 Drawing Guide Lines


8.1.1 Sketch versus Path
When defining elements for engraving, it is essential to make the results compatible with
the interface the milling machine provides. With its 'Path' workbench, FreeCAD has built-in
support to generate trajectories for CNC machines. This can be helpful when milling com-
plex pockets or 3D surfaces.

Many smaller CNC machines are found in electronics workshops these days. Meanwhile, not
just the software for the smaller varieties, but the large ones too in the machine shop, are
able to read DXF files and translate them into production data.

Consequently, let's follow a simplified way here and draw sketches for the guide lines,
which can be displayed on TechDraw sheets and exported to DXF format from there.

8.1.2 Guide Lines for the Rotary Switch


With rotary switches, it is useful if the designation of a switch position is clearly associated
with the switch position. With only one switch in the design, you might get away by nicely
placing the text around the knob. But with only a few switches, and consequently many
possible switch positions, more structure is needed on the front panel.

When planning the sketches, it is worthwhile to attach them to objects that are resilient
against re-enumeration. Intuitively attaching them to the front facet of the panel might not
be the strategy of choice. Luckily, you already have created a datum plane ('Front Panel
Top Face'), which is rock solid compared to generated facets. Onto this, you will draw the
following sketches and outlines.

1. Turn the 3D view to the 'Top' orientation and zoom into the corner with the ro-
tary switch.

2. In the tree view, if necessary, expand the 'Front Panel Complete' Std-Part-Con-
tainer. Inside, activate the body 'Front Panel' with a double click.

3. In the tree view, mark the datum plane 'Front Panel Top Face' and start the
sketcher.

● 148

FreeCAD for Electronics Applications.indd 148 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

4. From the main menu, select 'View | Orthographic view' and 'Sketch | View sec-
tion' (Figure 8-1).

Figure 8-1

Now, let's draw some construction elements. This may look complicated but helps to keep
the sketch fully constrained. Also, when one parameter of the drawing is changed, less dis-
tortion (if any) of the other elements will result. Changes would be very difficult if you had
drawn the sketch right away, specifying a lot of dimensions for each point in it.

5. Click on the 'External geometry' tool button and mark the large hole of the
rotary switch footprint (Figure 8-2), which is then displayed in violet as a con-
struction element.

● 149

FreeCAD for Electronics Applications.indd 149 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 8-2

6. Draw two circles centered on the construction element. End the drawing com-
mand with a right-click. In the 'Elements' list, right-click one of the circles and
select 'Diameter constraint' from the context menu (Figure 8-3). Enter a value
of 38 mm.

Figure 8-3

● 150

FreeCAD for Electronics Applications.indd 150 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

7. In a similar way, constrain the diameter of the second circle to 22 mm. The two
circles are marking the start and end points of the radial guide lines.

8. In the 'Elements' list, mark the two circles. Right-click the selection. From the
context menu, select 'Toggle construction line' (Figure 8-4). The two circles ap-
pear in blue color now but will be invisible with the sketch.

Figure 8-4

9. From the center of the two circles, draw three lines. One must be vertical (to
indicate that implicitly selected constraint, a small, red, and vertical bar appears
next to the line, Figure 8-5, step 1), when you try to draw it vertically. Take care
to attach the lines to the center point. It takes some aiming with the crosshairs,
until the center point switches color to yellow (Figure 8-5). If the lines, or even
one of them, is not properly attached, there will be some time needed for de-
bugging the sketch later.

● 151

FreeCAD for Electronics Applications.indd 151 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 8-5

10. On the sketch, mark the vertical and one of the other lines. In the 'Elements' list,
right-click the selection, and select 'Angle constraint' from the context menu. Set
the angle to 30° (our switch has 12 positions). Repeat the procedure for the oth-
er line (Figure 8-6). Sometimes, the sketcher complains when you try to apply
a constraint. In that case, it is likely that some other element was still selected
from prior operations. To resolve this, click somewhere into the empty space,
which deselects all elements, and start over.

Figure 8-6

● 152

FreeCAD for Electronics Applications.indd 152 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

11. In the 'Elements' list, mark the three new lines. Right-click the selection and
select 'Toggle construction line' from the context menu (Figure 8-7). The three
lines also switch to blue color.

Figure 8-7

12. Click the 'Trim edge' tool button and trim all parts of the lines which are located
outside of the bigger circle (Figure 8-8).

Figure 8-8

● 153

FreeCAD for Electronics Applications.indd 153 24-08-2023 14:30


FreeCAD for Electronics Applications

13. Draw three lines, which start at the outer endpoints of the construction lines.
Place the endpoint on the inner circle, with arbitrary orientation of the lines. This
is easier than trying to define all the constraints at once. The result is shown in
Figure 8-9. End the drawing command with a right click.

Figure 8-9

14. For each of the three cases, mark one of the new lines and the corresponding
construction line. Then, click the 'Constrain parallel' tool button (Figure 8-10).
The result is shown in Figure 8-11.

● 154

FreeCAD for Electronics Applications.indd 154 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

Figure 8-10

Figure 8-11

● 155

FreeCAD for Electronics Applications.indd 155 24-08-2023 14:30


FreeCAD for Electronics Applications

The three lines are displayed in bright green, meaning the sketch is fully constrained. When
you find yourself defining (too) many dimensions, it is always a good idea to think about
some helpful construction geometry.

15. Draw two horizontal lines which start at the outer endpoints of the outer guide
lines: For the first click, aim at the endpoint, then pull the line out and watch for
the little horizontal red bar, indicating the horizontal constraint. The exact length
of the lines does not matter. End the drawing command with a right-click.

16. Mark one of the horizontal lines and click the 'Constrain horizontal distance' tool
button (Figure 7-12). Enter a value of 7 mm.

Figure 8-12

17. Mark both horizontal lines and click the 'Constrain equal' tool button (Figure
7-13). This sets the length of the two lines to the same value. 'Constrain equal'
works with different objects – e.g., circles will be set to equal diameter.

● 156

FreeCAD for Electronics Applications.indd 156 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

Figure 8-13

18. Now, the sketch appears bright green, and the solver says: 'Fully Constrained' –
done! (Figure 8-14). Close the sketch.

Figure 8-14

● 157

FreeCAD for Electronics Applications.indd 157 24-08-2023 14:30


FreeCAD for Electronics Applications

Now, you can display the rotary switch again (mark in the tree view and press the SPACE
key). It is a question of style whether you like the guide lines ending underneath the con-
trol knob. If you don't, thanks to the construction geometry, this is easy to change:

19. In the body 'Front Panel', reopen the new sketch with a double click. Either dou-
ble-click the dimension of 22 mm in the sketch directly, or, in the 'Constraints'
list, click the line 'Constraint4 (22 mm)'. In the popup dialog, enter a value of
26 mm (Figure 8-15). Because the sketch is now shown together with the con-
trol knob, the diameter can be nicely optimized.

Figure 8-15

20. In the tree view, rename the sketch to 'Guide Lines Rotary Switch' (Figure 8-16).

● 158

FreeCAD for Electronics Applications.indd 158 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

Figure 8-16

As long as the sketch is not hidden, it will also appear in TechDraw views. From there, it is
then available for DXF export. Furthermore, the sketch is also associated with the rotary
switch because you have attached it to the mounting hole via an external geometry refer-
ence. It will thus follow position changes of the rotary switch.

8.2 A Guide Line for the Potentiometer


A potentiometer should be turned and set to any position between the end points. An arc
with two end marks can provide a hint to the user regarding the input expected by the
control.

1. In the tree view, hide the Std-Part-Container 'Potentiometer Complete' with the
SPACE key.

2. The body 'Front Panel' is still marked by the previous steps. Again, mark the
datum plane 'Front Panel Top Face' and start the sketcher. From the main menu,
select 'View | Orthographic view'.

3. Click on the 'External geometry' tool button and mark the edge of the mounting
hole for the potentiometer (Figure 8-17).

● 159

FreeCAD for Electronics Applications.indd 159 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 8-17

4. As was done for the rotary switch, draw two circles, which are centered on the
violet construction circle, and constrain their diameters to 27 mm and 33 mm
(Figure 8-18).

Figure 8-18

● 160

FreeCAD for Electronics Applications.indd 160 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

5. Draw three lines, each one with a starting point in the center of the circles. One
of them must be oriented vertically (Figure 8-19). Mark the vertical line, and
one of the outer lines, and click the 'Constrain angle' tool button (Figure 8-19).

Figure 8-19

6. Trim the parts of the lines which are located outside the larger circle (Figure
8-20).

Figure 8-20

● 161

FreeCAD for Electronics Applications.indd 161 24-08-2023 14:30


FreeCAD for Electronics Applications

7. In the 'Elements' list, mark the two circles and all lines. Right-click the selection
and select 'Toggle construction line' from the context menu (Figure 8-21).

Figure 8-21

8. Click on the 'Create arc' tool button and draw an arc that is centered about the
circles. Place an endpoint onto each of the inclined lines. The diameter of the arc
can be arbitrary (Figure 8-22).

● 162

FreeCAD for Electronics Applications.indd 162 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

Figure 8-22

9. On the sketch, mark the arc and the inner construction circle. Then, click the
'Constrain equal' tool button (Figure 8-23).

Figure 8-23

● 163

FreeCAD for Electronics Applications.indd 163 24-08-2023 14:30


FreeCAD for Electronics Applications

10. For the end marks, draw two lines between the endpoints of the arc and the
corresponding endpoints of the construction lines (Figure 8-24).

Figure 8-24

11. Close the sketch, and, in the tree view, rename it to Guide Line Potentiometer'.
Display again the 'Potentiometer Complete' Std-Part-Container with the SPACE
key (Figure 8-25).

Figure 8-25

● 164

FreeCAD for Electronics Applications.indd 164 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

With these guide lines, the front panel already has a good structure. Descriptive text is,
however, still missing.

8.3 The Engravings


In the 'Draft' workbench, FreeCAD offers functions, which allow the creation of engraved
text. When you switch to the 'Draft' workbench, a grid representing the draft surface is au-
tomatically displayed. First, the orientation of the drafting surface needs to be set properly.
Click on the 'Current working plane' tool button, which opens a task window. You can either
set the working plane with the buttons provided (e.g., top), you can click an object in the
3D view, or you can switch to the 'Model' tab and click a tree view node. Use the last meth-
od: When the task window opens, switch to the 'Model' task and click the 'Front Panel Top
Face' datum plane in the 'Front Panel' body. This brings the drafting plane up front (Figure
8-26, step 3). The grid representing the drafting plane stays visible, even when the 'Draft'
workbench is left. To hide it, use the button shown in Figure 26, step 4.

Figure 8-26

The outline of lettering can be generated with the 'Shape from text' tool. Let's now add
labels to all the elements on the ESR meter front panel:

1. Click on the 'Shape from text' tool button (Figure 8-27).

● 165

FreeCAD for Electronics Applications.indd 165 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 8-27

2. In the task window, enter 'Batt.' (designates 'battery testing') for the string and
set the height to 6.5 mm. Click approximately at the location of the front panel,
where you want to bring the text outline. Then, for the Z offset, enter 2 mm (the
front panel thickness), as Z is reset to 0 when you clicked (Figure 8-28).

3. Also, the font file has to be specified. On Linux systems, you can find the freely
distributed file 'RobotoCondensedLight.ttf', of which a copy is provided in the
'Sample Projects | ESR Meter | Components' directory.

4. Close the task window with the 'OK' button. Locate the 'Shape String' object in
the tree view, grouped in the 'Front Panel Complete' Std-Part-Container, and
mark it (Figure 8-28).

● 166

FreeCAD for Electronics Applications.indd 166 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

Figure 8-28

5. Edit the placement parameters (there, the placement can be modified with live
update) and move X and Y coordinates with the mouse wheel, until the label
appears at a good position (Figure 8-29). Close the task window with the OK
button.

● 167

FreeCAD for Electronics Applications.indd 167 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 8-29

6. In similar fashion, create the labels 'OFF' and 'ON', and then move them to the
locations shown in Figure 8.30.

Figure 8-30

● 168

FreeCAD for Electronics Applications.indd 168 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

7. Above the potentiometer, create the label 'Set Zero' (Figure 8-31).

Figure 8-31

8. Between the binding posts, position the letters 'C' and 'x' as shown in Figure
8-32. The x should be a subscript, i.e. a bit smaller in type.

Figure 8-32

● 169

FreeCAD for Electronics Applications.indd 169 24-08-2023 14:30


FreeCAD for Electronics Applications

The Elektor ESR Meter front panel design is now completed.

8.4 The 'TechDraw' Workbench and the DXF Export


Already with the battery holder, you have used the 'TechDraw' workbench. The procedure
is quite similar here, except that no unfolding is necessary for the straight front panel. For
the engraving, let's exploit the fact that sketches are also displayed in the views created in
'TechDraw' documents.

1. In the 3D view, select the orientation 'Top', either by clicking on the con-
trol cube or by clicking the 'Top' tool button (Figure 8-3). The precise orien-
tation is important. Otherwise, a slightly distorted projection will be dis-
played in the views, in which the dimensions deviate from the plain object.
Figure 8-33

2. Switch to the 'TechDraw' workbench. Click on the 'Insert Page using Template'
tool button (Figure 8-34).

Figure 8-34

3. In the popup selection dialog, as a template, select 'A3 Landscape blank'.

4. In the tree view, mark 'Front Panel Complete' by a click (this selects what gets
into the view in the next step).

5. Click on the 'Insert View' tool button. The actual view of the front panel is insert-
ed in the TechDraw page (Figure 8-35). Right-click the frame and select 'Toggle
frames' from the context menu, in order to hide the frame.

● 170

FreeCAD for Electronics Applications.indd 170 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

Figure 8-35

6. The export of the view is now the easiest part: Right-click the view and select
'Export DXF' from the context menu. (Figure 8-36).

● 171

FreeCAD for Electronics Applications.indd 171 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 8-36

With this astonishingly small number of clicks, our first FreeCAD project is prepared for
fabricating on a real machine. The next four photos show that this was not just theory. The
effort invested during the design phase pays off with an easy assembly and with no colli-
sions or other surprises (Figures 8-37, 8-38, 8-39).

Figure 8-37 Figure 8-38

● 172

FreeCAD for Electronics Applications.indd 172 24-08-2023 14:30


Chapter 8 ● Finalizing the Front Panel with Graphic Elements

Figure 8-39 Figure 8-40

● 173

FreeCAD for Electronics Applications.indd 173 24-08-2023 14:30


FreeCAD for Electronics Applications

Chapter 9 ● A
 More Complex Design: The Lab
Transformer

With the tools established in the preceding chapters, you now have all options on the ta-
ble to design a complete apparatus. Often, a piece of equipment consists of a front pan-
el, a rear panel, and a chassis in between. The chassis carries components like a circuit
board or — with similar project tree structure – more sub-assemblies packed into nested
Std-Part-Containers. Finally, a sheet-metal cover will protect the inner workings from pry-
ing fingers and dust.

As an example, a laboratory transformer is selected. Admittedly, this is a bit of an old-


school device, but still, such a device can give useful service in research and development
even in today's era of switch-mode power supplies.

For the lab transformer, several components will be assembled. A few of these are de-
scribed in Appendix A through F. If you prefer to start with the existing component files, just
fetch them from here: Sample Projects | Lab Transformer | Components.

In order to keep things nicely encapsulated in smaller units, let's start to create the front
and rear panels in separate FreeCAD files. The sub-assemblies can then be inserted into the
final design by cut and paste. The chassis will be added during the course of the assembly
as it ties together the panels and will be affected through associativity when the panels are
repositioned.

9.1 The Front Panel


On the front panel, the user expects the secondary coil terminals of the transformer to
which the test setup is then attached. Regarding simplified wiring, all connections to the
mains (powerline; AC power) can reside close to the rear panel, including the mains switch,
pilot light, and power inlet.

This constellation, however, is not necessarily the most practical one. When arranging
experiments, it is easy to lose sight of the pilot light or the mains switch. Also, in some sit-
uations, you may want to remove the power quickly and not have to reach across a whole
pile of things to locate it by 'blind' finger poking.

With FreeCAD, the different constellations of an assembly are easily compared, and the
spatial requirements are evaluated. Therefore, you can opt for improved usability and po-
sition the pilot light and the mains switch onto the front panel. Whether or not this leaves
space for the wiring can then be explored with the 3D model.

9.1.1 Setting up File and Std-Part-Container


1. Create a new folder for the lab transformer. Then, with FreeCAD, create a new
file and save it as 'Transformer Front Panel'. In the document, start a new
Std-Part-Container, and rename it to 'Trafo Front Panel Complete'. ('Trafo' is a
common abbreviation for 'transformer' in German). The container is used later
to collect all the assembled front panel elements. Also, the container is later
inserted into the final design, with a cut and paste.

● 174

FreeCAD for Electronics Applications.indd 174 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

2. Inside the container, start a new Std-Part-Container and rename it to 'Front


Panel Sheet Complete'. Within this container, you will later collect all engraving.
Switch to the 'Part Design' workbench. In 'Front Panel Sheet Complete', start a
new body, and rename it to 'Front Panel Sheet'.

3. Save the result, which is illustrated in Figure 9-1.

Figure 9-1

9.1.2 Creating the Panel Sheet


1. Double-click the body 'Front Panel Sheet' to activate it.

2. Click on the 'Sketcher' tool button and select the XY plane in the initial selection
task window. Click 'OK' to proceed (Figure 9-2).

● 175

FreeCAD for Electronics Applications.indd 175 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-2

3. Draw a rectangle whose bottom side coincides with the X-axis (Figure 9-3). End
the drawing command with a right-click.

Figure 9-3

● 176

FreeCAD for Electronics Applications.indd 176 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

4. Mark the lower two corners of the rectangle, and the Y-axis. Then, click the 'Con-
strain symmetrical' tool button (Figure 9-4).

Figure 9-4

5. Mark a horizontal line of the rectangle and click the 'Constrain horizontal dis-
tance' tool button. Enter a value of 75 mm for the width (Figure 9-5). In a similar
way, constrain the vertical dimension of the rectangle to 90 mm. The sketch is
then shown in bright green, as fully constrained. Close the sketch (top).

● 177

FreeCAD for Electronics Applications.indd 177 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-5

6. For the definition of the front panel top face, create a datum plane: In the tree
view, expand the coordinate system of the body 'Front Panel Sheet' and mark
the XY plane. Then, click the 'Create a datum plane' tool button (Figure 9-6).

Figure 9-6

● 178

FreeCAD for Electronics Applications.indd 178 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

7. For the attachment Z offset, enter a value of 2 mm (Figure 9-7) and then close
the task window with the OK' button. This offset represents the panel thickness.

Figure 9-7

8. In the tree view, mark the sketch of the panel outline, and click the 'Pad' tool
button (Figure 9-8).

● 179

FreeCAD for Electronics Applications.indd 179 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-8

9. In the task window, select for the type 'Up to face'. Then, click the datum plane
representation in the 3D view (Figure 9-9). Close the task window with the 'OK'
button.

Figure 9-9

● 180

FreeCAD for Electronics Applications.indd 180 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

For the attachment of components to the front panel top face, a resilient reference is need-
ed. As in the preceding chapter, you can provide it with a sketch on the datum plane, to
which you then reference a SubShapeBinder.

10. In the tree view, rename the datum plane to 'Front Panel Sheet Top'. In the tree
view, mark the datum plane and start the sketcher. To display the existing 3D
geometry, close and reopen the sketch right away.

11. Click on the 'External geometry' tool button and mark two adjacent lines of the
rectangle (Figure 9-10), which are then shown in violet as construction lines.

Figure 9-10

12. Click on the 'Create a rectangle' tool button and draw a rectangle locked onto
the two endpoints of the construction geometry (Figure 9-11). Close the sketch.

● 181

FreeCAD for Electronics Applications.indd 181 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-11

13. Rename the new sketch to 'Front Panel Top Contour'. Deactivate the body 'Front
Panel Sheet' by a right-click and select 'Toggle active body' from the context
menu.

14. In the tree view, mark the new sketch and click the green 'Create a sub object(s)
shape binder' tool button. Rename the new SubShapeBinder to 'Front Panel Top
Face'. Drag and drop it into the Std-Part-Container 'Trafo Front Panel Complete'
(Figure 9-12).

● 182

FreeCAD for Electronics Applications.indd 182 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-12

15. In the tree view, hide the datum plane 'Front Panel Sheet Top, the sketch 'Front
Panel Top Contour' and the new SubShapeBinder 'Front Panel Top Face'.

16. Up to this point, the rear panel equals the front panel (except some designations
in the tree). Therefore, save a copy of the file as 'Transformer Rear Panel', in
order to save time later on.

The procedure looks a bit unwieldly, but the references defined here help to copy and paste
the front panel (sub) assembly later on.

9.1.3 Placement of the Components


1. In the directory 'Sample Projects | Lab Transformer | Components', locate and
open the file 'Toggle Switch.FCStd'. Copy the Std-Part-Container 'Toggle Switch
Complete' with CTRL-C. In the popup dialog, do not change the standard selec-
tion and click the 'OK' button to continue.

2. In the tree view, close the document node 'Toggle Switch'. If the title is not
shown in bold letters (which may be the case with more documents open), dou-
ble-click the node 'Transformer Front Panel'. Then, paste the switch with CTRL-V.
Drag and drop the Std-Part-Container with the switch into 'Trafo Front Panel
Complete' (Figure 9-13).

● 183

FreeCAD for Electronics Applications.indd 183 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-13

3. In the tree view, mark 'Toggle Switch Complete'. Switch to the 'Part' workspace
and select 'Part | Attachment' from the main menu.

4. In the task window, click into the entry field next to the button for Reference 1,
which is displayed in dark gray, and of which the label reads 'Selecting…' (Figure
9-14).

● 184

FreeCAD for Electronics Applications.indd 184 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-14

5. Switch to the 'Model' tab (Figure 9-14, step 4) and, in the tree view, click the
SubShapeBinder. Switch back to the 'Tasks' tab. For the attachment mode, se-
lect 'XY on plane', and set the attachment offset Y to 32 mm (Figure 9-15). Close
the task window.

● 185

FreeCAD for Electronics Applications.indd 185 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-15

When you enter values for dimensions, occasionally, error messages appear in the output
window. This happens when you just type the figure without units (which is usually the
case). These error messages can be safely ignored and deleted, because FreeCAD will au-
tomatically add the dimension again.

Following the same procedure as described in the steps 1 to 5 above, place the follow-
ing components onto the front panel and position them with respect to the front face:

Object X [mm] Y [mm]


Pilot Lamp Complete 0 65
Banana Jacket Metal Complete 0 6
Banana Jack Complete 24 22
Banana Jack Complete –24 22

6. Rename one of the Std-Part-Containers called 'Banana Jack Complete XXX' to


'Banana Jack Complete 005', and the other one to 'Banana Jack Complete 001'
(Figure 9-16). In the tree view, mark 'Banana Jack Complete 001' and click the
'Make link' tool button.

● 186

FreeCAD for Electronics Applications.indd 186 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-16

7. Create three more links of 'Banana Jack Complete 001' (Figure 9-17). Drag-
and-drop the three new objects into the Std-Part-Container 'Trafo Front Panel
Complete'.

● 187

FreeCAD for Electronics Applications.indd 187 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-17

8. In the tree view, mark all the new banana jack link objects. In the property list,
set their 'Link transform' property to True (Figure 9-18). Now all the positions
can be specified as 'Link placement' parameters relative to the linked object
'Banana Jack Complete 001'.

Figure 9-18

● 188

FreeCAD for Electronics Applications.indd 188 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

9. Adjust the link placement Y parameters according to the following table (Figure
9-19):

Object Y [mm]
Banana Jack Complete 002, 006 17
Banana Jack Complete 003, 007 34
Banana Jack Complete 004, 008 51

Figure 9-19

11. In the tree view, expand 'Banana Jack Complete 001'. Mark 'Banana Jack Cap'
and 'Banana Jack Washer'. Right-click the selection and select 'Appearance…'
from the context menu (Figure 9-20).

● 189

FreeCAD for Electronics Applications.indd 189 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-20

12. In the task window, select 'Shiny Plastic' for the material, and set the color to
yellow (Figure 9-21). Close the task window.

Figure 9-21

● 190

FreeCAD for Electronics Applications.indd 190 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

13. Repeat the creation of 3 link objects but click 'Banana Jack Complete 005' as
the parent object (Figure 9-22). Drag-and-drop the linked jacks into 'Trafo Front
Panel Complete'.

Figure 9-22

14. Again, mark the three new banana jack link objects, and set their 'Link trans-
form' property to 'true'.

● 191

FreeCAD for Electronics Applications.indd 191 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-23

15. For the three new banana jack link objects, in the property list, set the link
placement Y values according to the table above (in step 4).

16. Expand 'Banana Jack Complete 005' and mark 'Banana Jack Cap' and 'Banana
Cap Washer'. As in step 5, set the appearance of these objects to the material
'Shiny Plastic', but select a bright blue for the color (Figure 9-24).

● 192

FreeCAD for Electronics Applications.indd 192 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-24

Now, all front panel elements are attached and positioned. Inside the jacks, and also in
the casing of the switch, the sheet metal is still present. This will be cut away in the next
section.

9.1.4 Punching the Holes


The footprints for the openings of the front panel elements will be referenced with SubSha-
peBinders again. In order to make the SubShapeBinders appear in the body called 'Front
Panel Sheet', make sure that this body is always activated (the title shown in bold letters),
before you click the 'Create a sub object(s) shape binder' tool button. Otherwise, the Sub-
ShapeBinder will be added to the currently activated object and you have to search it. The
tree view will expand when you select reference objects, and it is the selection of the refer-
enced objects rather than the created SubShapeBinder which is then centered in the tree
view. As a consequence, the following procedure includes quite a bit of scrolling to and fro.

1. To set the target for the SubShapeBinder, activate the body 'Front Panel Sheet'
located within the Std-Part-Container 'Front Panel Sheet Complete'.

2. To expose the edges of the front panel elements, hide the body 'Front Panel
Sheet' with the SPACE key.

● 193

FreeCAD for Electronics Applications.indd 193 24-08-2023 14:30


FreeCAD for Electronics Applications

3. In the 3D view, mark the toggle switch contour, which determines the shape of
the hole in the front panel (Figure 9-25), and click the green 'Create a sub ob-
ject(s) shape binder' tool button.

Figure 9-25

4. Locate the new SubShapeBinder in the body 'Front Panel Sheet' and rename it
to 'Footprint Toggle Switch' (Figure 9-26).

Figure 9-26

● 194

FreeCAD for Electronics Applications.indd 194 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

5. With the SubShapeBinder marked in the tree view, click the 'Pocket' tool button.
In the task window, for the type, select 'Through all' (Figure 9-27). Close the
task window with the 'OK' button.

Figure 9-27

6. In order to check for success, temporarily hide the toggle switch and show the
front panel (with the SPACE key, Figure 9-28).

Figure 9-28

● 195

FreeCAD for Electronics Applications.indd 195 24-08-2023 14:30


FreeCAD for Electronics Applications

7. In the 3D view, rotate the assembly such that the rear of the front panel ele-
ments is visible. In the Std-Part-Container 'Pilot Lamp Complete', hide the 'Pilot
Lamp Nut' body to expose the lamp casing. Make sure the 'Front Panel Sheet' is
still activated (title shown in bold print).

8. Holding down the CNTRL key, mark the contour defining the front panel cutout
for the pilot lamp. The chain of elements must be a closed loop (Figure 9-29).
When you mark something that does not belong to the loop, just click it again
to deselect it. Then, click the green 'Create a sub object(s) shape binder' tool
button.

Figure 9-29

9. Scroll back to 'Front Panel Sheet' and rename the new SubShapeBinder to 'Foot-
print Pilot Lamp' (Figure 9-30). Then, with the new SubShapeBinder marked in
the tree view, click the 'Pocket' tool button.

● 196

FreeCAD for Electronics Applications.indd 196 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-30

10. In the task window, for the Type, select 'Through all' and close the task with the
'OK' button.

11. In a similar way, mark all contours of the banana sockets defining the mounting
holes and then create a SubShapeBinder. Rename that to 'Footprint Banana
Jacks' (Figure 9-31) and create the holes with the 'Pocket' command (Figure
9-32).

● 197

FreeCAD for Electronics Applications.indd 197 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-31

Figure 9-32

● 198

FreeCAD for Electronics Applications.indd 198 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

12. Hide all front panel elements and reveal the 'Front Panel Sheet' body to check all
the created front panel cutouts (Figure 9-33).

Figure 9-33

The mounting holes for the attachment of the front panel itself are not modeled yet be-
cause they will be defined later, in association with the spacers of the chassis.

9.1.5 Adding the Engraving


On the front panel, no guide lines are necessary, just engraved text. We will use the tool
'Shape of text' in the 'Draft' workspace, and the font 'RobotoCondensed light.ttf', which is
freely available with Linux systems. A copy of it is contained in the 'Sample Projects | Lab
Transformer | Components' directory, so you can find and select it easier.

1. In the 3D view, set the viewing direction to 'Top' (control cube or 'Top' tool but-
ton).

2. Switch to the 'Draft' workbench. Click on the 'Current Working plane' tool but-
ton. In the task window, set the 'Offset' parameter to 2.00 (your current panel
thickness) and click the 'Top (XY)' button (Figure 9-34). The order of these steps
matters!

● 199

FreeCAD for Electronics Applications.indd 199 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-34

3. Click on the 'Shape from text' tool button. (Figure 9-35).

Figure 9-35

● 200

FreeCAD for Electronics Applications.indd 200 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

4. In the task window, enter 'Power' as the string, 6.5 mm for the height, and se-
lect 'RobotoCondensed-Light.ttf' for the font (from the 'Components' directory
of the project, Figure 9-36). Click roughly on the panel where the text should be
located. Then, close the task window with the 'OK' button. Only then, the text
will be shown in the 3D view. In the tree view, rename the new 'ShapeString'
object to 'ShapeString Power'.

Figure 9-36

The position of the ShapeString objects can be tweaked later by editing their placement
parameters. Doing so allows live updating of the view, which makes the process easier.

5. In the same fashion, label the top position of the toggle switch with 'ON', and
place the designation 'GND' next to the lowest banana jack.

6. As shown in Figure 9-37, in each row, place a '10V' label between the lower two
insulated banana jacks, between the center ones a label reading '2V'. Between
the upper ones, place a label with '3V'.

7. The result of this labeling work is shown in Figure 3-37. Switch off the drafting
grid with the 'Toggle draft grid' tool button (Figure 9-38). Save your work.

● 201

FreeCAD for Electronics Applications.indd 201 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-37

Figure 9-38

● 202

FreeCAD for Electronics Applications.indd 202 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

9.2 The Rear Panel


The AC power inlet and two fuse holders are to be placed onto the rear panel. Later, you are
ready to place a screw terminal on the chassis, for the protective earth conductor.

9.2.1 Prepare File and Std-Part-Containers


1. Open the file 'Transformer Rear Panel.FCStd', which you saved as a blank rear
panel in 9.1.2, step 16.

2. Change the following designations:


• 'Trafo Front Panel Complete' to 'Trafo Rear Panel Complete',
• 'Front Panel Sheet Complete' to 'Rear Panel Sheet Complete',
• 'Front Panel Sheet' to 'Rear Panel Sheet',
• 'Front Panel Sheet Top' to 'Rear Panel Sheet Top',
• 'Front Panel Top Contour' to 'Rear Panel Top Contour',
• 'Front Panel Top Face' to 'Rear Panel Top Face'

The result is shown in Figure 9-39.

Figure 9-39

● 203

FreeCAD for Electronics Applications.indd 203 24-08-2023 14:30


FreeCAD for Electronics Applications

9.2.2 Placing the Components


1. Locate and open the file 'IEC Power Inlet' in the directory 'Sample Projects | Lab
Transformer | Components'. Copy the Std-Part-Container 'IEC Inlet Complete'
with CTRL-C. In the selection dialog, do not change the standard selection and
click the 'OK' button to proceed. In the tree view, close the document node 'IEC
Power Inlet'. Press CTRL-V to insert the Std-Part-Container into the document
node 'Transformer Rear Panel'. Drag-and-drop the Container into 'Trafo Rear
Panel Complete' (Figure 9-40).

Figure 9-40

2. In the tree view, mark the Std-Part-Container 'IEC Inlet Complete' and switch to
the 'Part' workbench. From the main menu, select 'Part | Attachment...'. When
the task window opens, the collector for Reference 1 is already activated. Switch
to the 'Model' tab, and, in the tree view, click the (hidden, grayed out) shape
binder 'Rear Panel Top Face'. Return to the task window and select 'XY on plane'
as the attachment mode. For the attachment offset Y, enter a value of 25 mm
(Figure 9-41). Close the task window with the 'OK' button.

● 204

FreeCAD for Electronics Applications.indd 204 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-41

3. Following the same procedure as for the AC power inlet, open the file 'Fuse
Holder.FCStd', and insert the Std-Part-Container 'Fuse Holder Complete' into the
'Trafo Rear Panel Complete' Std-Part-Container.

4. Rename the new container to 'Fuse Holder Complete 001'. Repeat the attach-
ment procedure and attach the fuse holder to the SubShapeBinder 'Rear Panel
Top Face'. Enter for the attachment offsets X = 15 mm and Y = 58 mm (Figure
9-42). Close the task window with the 'OK' button.

● 205

FreeCAD for Electronics Applications.indd 205 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-42

5. In the tree view, mark 'Fuse Holder Complete 001'. Then, click the 'Make link'
tool button (Figure 9-43). Drag-and-drop the new 'Fuse Holder Complete 002'
into the Std-Part-Container 'Trafo Rear Panel Complete'.

Figure 9-43

● 206

FreeCAD for Electronics Applications.indd 206 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

6. In the tree view, mark 'Fuse Holder Complete 002'. In the property list, set the
property 'Link transform' to 'true', in order to allow placement relative to the
parent object.

7. Edit the 'Link placement' parameters and set the translation to -30 mm (Figure
9-44).

Figure 9-44

9.2.3 Punching the Holes


1. In the Std-Part-Container 'Rear Panel Complete', activate the body 'Rear Panel
Sheet' with a double click. Besides activating the body, FreeCAD also switches
automatically into the 'Part Design' workbench, if it was not previously selected.

2. In the tree view, hide the body 'Rear Panel Complete' to expose the edges of the
other assembly elements. Rotate the view, until the rear details of the elements
are visible.

3. Hold down the CTRL key and select from the 3D view all edges of the IEC power
inlet, which determine the cutout and screw holes in the panel (Figure 9-45).
Then, click the green 'Create a sub object(s) shape binder' tool button.

● 207

FreeCAD for Electronics Applications.indd 207 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-45

4. Rename the new SubShapeBinder in 'Rear Panel Sheet' to 'Footprint IEC Inlet'.

5. With the new SubShapeBinder marked in the 3D view, click the 'Pocket' tool
button. In the task window, select 'Through all' for the type and click the 'OK'
button.

6. In the tree view, expand 'Fuse Holder Complete 001' and hide the 'Fuse Holder
Nut'. Because the second fuse holder is a linked object, it will follow on its own.

7. In the 3D view, hold down the CTRL key and select all edges on the two fuse
holders which define the cutout in the panel (Figure 9-46). Then, click the green
'Create a sub object(s) shape binder' tool button.

● 208

FreeCAD for Electronics Applications.indd 208 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-46

8. In the body 'Rear Panel Sheet', rename the new SubShapeBinder to 'Footprint
Fuse Holders'.

9. With 'Footprint Fuse Holders' marked in the tree view, click the 'Pocket' tool
button. In the task window, select for the type 'Through all' and click the 'OK'
button.

10. To check whether all the holes are properly inserted, display the 'Rear Panel
Sheet' body again with the SPACE key (Figure 9-47). The rotation locks of the
fuse holders and the bolt holes for the IEC inlet are visible. For the next steps,
display all previously hidden items again.

● 209

FreeCAD for Electronics Applications.indd 209 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-47

9.2.4 Adding the Engraving


The method is the same that you have used for the front panel. You can run through all
the preparation steps as described in section 9.1.5, steps 1 and 2. On the rear panel, infor-
mation about the mains voltage, the frequency range and the power intake are useful. You
may also want to think about a unique designation of the apparatus, the manufacturer, and
the IP class. For the example, however, let's keep things easy:

1. In the Draft workbench, create a shape string object with the text: '230V/50Hz/
30VA' (this is the specification for the example transformer). The text can be
placed below the IEC power inlet.

2. The second text could describe the strength and the timing characteristics of the
fuses. This depends on the transformer, of course. For the example transformer
used here, enter '2 × 0.5 AT' (= 0.5 amp, slow blow). This text could be placed
centered below the fuse holders.

The result is shown in Figure 9-48. If you want, you could add fasteners to the IEC inlet.
Then, the file can be saved and closed for later use.

● 210

FreeCAD for Electronics Applications.indd 210 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-48

9.3 The Chassis


The chassis could play an important role when the volume of the apparatus is optimized lat-
er on, for example, by a length variation. Eventually, it would be useful to be able to move
the front panel and rear panel of the assembly independently of each other. Therefore,
meaningful references are needed right from the beginning when the chassis is designed.

9.3.1 Preparation of File and Std-Part-Container


1. Start a new file and save it as 'Transformer Chassis'.

2. Create a new Std-Part-Container and rename it to 'Trafo Chassis Complete'.

3. Start a new body object and rename it to 'Chassis Sheet'. In order to do this,
switch to the 'Part Design' workbench (where the blue 'Create body' tool button
is available).

4. To control the position of the front panel, create a datum plane: Show the coor-
dinate system of 'Chassis Sheet' with the SPACE bar. In the 3D view, mark the
XZ plane. Then, click the 'Create a datum plane' tool button. In the task window,
the attachment mode 'plane face' is already preset. Enter an attachment offset
Z value of 65 mm (Figure 9-46). Note: A Z offset designates here a shift parallel
to the normal vector of the plane, not the Z coordinate direction. Close the task
window with the 'OK' button.

● 211

FreeCAD for Electronics Applications.indd 211 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-49

5. Rename the new datum plane to 'Position Front Panel'.

6. In the same way, create a datum plane and set the attachment Z offset to
-65 mm. Rename that datum plane to 'Position Rear Panel'.

7. Now you will sketch the cross-section of the chassis sheet onto the plane 'Posi-
tion Front Panel': In the tree view, mark this datum plane and start the sketcher.

8. From the main menu, select 'View | Orthographic view' and 'Sketch | View sec-
tion'.

9. Sketch a rectangle that is attached to the X-axis (Figure 9-50).

● 212

FreeCAD for Electronics Applications.indd 212 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-50

10. Mark the lower two corners of the rectangle, and then the Z (= vertical) axis.
Click on the 'Constrain symmetrical' tool button (Figure 9-51).

Figure 9-51

● 213

FreeCAD for Electronics Applications.indd 213 24-08-2023 14:30


FreeCAD for Electronics Applications

11. Set the height of the rectangle: Mark one of the vertical sides of the rectangle
and click the 'Constrain vertical distance' tool button. Enter a value of 3 mm for
the thickness of the sheet (Figure 9-52).

Figure 9-52

12. In a similar way, constrain the width of the rectangle to 75 mm (Figure 9-53).
Close the sketch.

Figure 9-53

● 214

FreeCAD for Electronics Applications.indd 214 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

13. In the tree view, mark the new sketch and click the 'Pad' tool button.

14. In the task window, select for the type 'Up to face'. Select the datum plane
'Position Rear Panel' as the face, either by clicking on it in the 3D view, or by
switching to the 'Model' tab and clicking on its tree branch. (Figure 9-54). Close
the task with the 'OK' button.

Figure 9-54

The chassis is just a sheet metal piece now. To form the connection with the rest of the
assembly, square aluminum spacers can be added. We need to draw only the first one of
them, the others can be added as link objects. In order to associate the length of the chas-
sis sheet with the length of the spacers, you need two SubShapeBinders which reference
the two datum planes.

15. In the tree view, hide the body 'Chassis Sheet'.

16. Create a new body and rename it to 'Chassis Spacer 001'.

17. Drag-and-drop the new body into 'Trafo Chassis Complete'.

18. The body 'Chassis Spacer 001' should still be activated (title shown in bold let-
ters). If not, double-click it in the tree view.

19. Click on the blue 'Create a shape binder' tool button. In the task window, click
the button 'Object' until this turns dark gray. Then, click into the edit field next
to the 'Object' button, which receives the focus (gets a blue rim). Switch to
the 'Model' tab and select the datum plane 'Position Front Panel'. Return to the
'Tasks' tab and close the task window with the 'OK' button (Figure 9-55).

● 215

FreeCAD for Electronics Applications.indd 215 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-55

20. Rename the new shape binder to 'Front Side'. In the same way, create a shape
binder for the rear datum plane and rename it to 'Rear Side' (Figure 9-56).

Figure 9-56

● 216

FreeCAD for Electronics Applications.indd 216 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

21. Mark both shape binders. In the property list, set the property 'Trace Support'
to 'true' (Figure 9-57).

Figure 9-57

It is possible to sketch onto these shape binders. However, it turns out, that the place-
ment of the spacer cannot be adjusted any more, as the shape binders track the origin of
the referenced datum plane. As a remedy, two local datum planes can be defined, which
reference the corresponding shape binders. The placement of the local datum planes can
then be used to define an offset to the shape binders. This will get more obvious when you
proceed:

22. Click on the 'Create a datum plane' tool button. In the task window, the collector
for Reference 1 is already activated when the task window opens. Switch to the
'Model' tab and select the datum plane 'Front Side'.

23. Return to the task window. The attachment mode 'Plane face' is already preset.
Close the task window with the 'OK' button.

24. Rename the new datum plane to 'Spacer Front Face'.

25. In the same way, create another datum plane for the shape binder 'Rear Side'
and rename it to 'Spacer Rear Face' (Figure 9-58). In the tree view, hide the two
shape binders 'Front Side' and 'Rear Side'.

● 217

FreeCAD for Electronics Applications.indd 217 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-58

26. In the 3D view, mark the datum plane 'Spacer Front Face' and start the sketcher.
From the main menu, select 'Sketch | View section' and 'View | Orthographic
view'.

27. Draw a rectangle that is centered around the origin. Mark one horizontal and one
vertical side of the rectangle and click the 'Constrain equal' tool button (Figure
9-59).

Figure 9-59

● 218

FreeCAD for Electronics Applications.indd 218 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

28. Click on one horizontal side of the rectangle. Click on the 'Constrain horizontal
distance' tool button. Set the length to 10 mm (Figure 9-60). Close the sketcher.

Figure 9-60

29. In the tree view, mark the new sketch and click the 'Pad' tool button.

30. In the task window, select for the type 'Up to face'. In the 3D view, click the rear
datum plane representation (Figure 9-61).

● 219

FreeCAD for Electronics Applications.indd 219 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-61

31. Close the task window with the OK button. Hide the datum planes with the
SPACE key.

The spacer is now associated with the reference planes 'Position Front Panel' and 'Position
Rear Panel' in the body 'Chassis Sheet'. This you can test later on, by changing the position
of these reference planes. Please note that the changes will only take visible effect when
a recalculation is executed (by pressing the F5 key, with the objects marked for recalcu-
lation). The holes for the fasteners are still missing. For these, you can create sketches
on the datum planes – with the advantage that the holes will thus not be affected by a
re-enumeration of the facets.

32. In the 3D view, mark the datum plane 'Spacer Front Face' and start the sketcher.
Draw a circle that is centered around the origin and constrain its diameter to
3 mm (the diameter is not important, see next step). Close the sketch.

33. In the tree view, mark the new sketch and click the 'Hole' tool button (Figure
9-62).

● 220

FreeCAD for Electronics Applications.indd 220 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-62

34. In the task window, select the profile 'ISO metric regular' and set the size to M4.
Check the 'Threaded' checkbox and set the depth of the hole to 15 mm (Figure
9-63). Close the task window with the 'OK' button.

Figure 9-63

● 221

FreeCAD for Electronics Applications.indd 221 24-08-2023 14:30


FreeCAD for Electronics Applications

35. In the same way, create a hole in the rear face of the spacer. Because it is drilled
from the back side, the checkbox 'Reversed' needs to be checked in the task
window of the 'Hole' command.

Now, the placement of the spacer can be adjusted. To view the spacer together with the
chassis sheet, display the body 'Chassis Sheet' again with the SPACE key (Figure 9-64).
The placement of the spacer cannot be done with its 'Placement' parameters – because of
the shape binder reference, adjusted offsets are reset when a recalculation is taking place.
The placement is achieved via the attachment parameters of the datum plane 'Spacer Front
Face' instead, where the sketch of the spacer profile is located.

Figure 9-64

36. In the tree view, mark the datum plane 'Spacer Front Face'. In the property list,
edit the 'Attachment' parameters. Open the task window with the button in
the edit field. Set the translation to X = 32.5 mm and Y = -5 mm (Figure 9-65).
The view will be updated only if the 'Apply' or the 'OK' buttons have been clicked.
Close the task window with the 'OK' button.

● 222

FreeCAD for Electronics Applications.indd 222 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-65

37. The offset has to be inserted also for the attachment of the 'Spacer Rear Face'
datum plane, in order to not lose the hole in the rear face.

38. Using the 'Create link' tool button, create three links of 'Spacer 001'. Drag-and-
drop them into 'Trafo Chassis Complete' (Figure 9-66).

Figure 9-66

● 223

FreeCAD for Electronics Applications.indd 223 24-08-2023 14:30


FreeCAD for Electronics Applications

39. Mark the three new spacer bodies. In the property list, set the property 'Link
transform' to 'true'.

40. Set the 'Link Placement' parameters of the three new spacers according to the
table below (the result is shown in Figure 9-67):

Object X [mm] Y [mm]


Chassis Spacer 002 –65 0
Chassis Spacer 003 0 80
Chassis Spacer 004 –65 80

Figure 9-67

9.3.2 Bolts for the Chassis Sheet


The chassis sheet still floats because the bolts, which attach it to the spacers, are still miss-
ing. We can sketch the holes for the bolts on the XY plane of the chassis sheet and commu-
nicate their position to 'Chassis Spacer 001' by shape binders. The other linked spacers will
follow this operation on their own:

1. To have an unobstructed view, in the tree view, hide 'Chassis Spacer 003' and
'Chassis Spacer 004' with the SPACE key.

2. In the tree view, activate the body 'Chassis Sheet' by a double click.

● 224

FreeCAD for Electronics Applications.indd 224 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

3. Expand the coordinate system of 'Chassis Sheet' and mark the XY plane. Then,
start the sketcher. From the main menu, select 'Sketch | View section' and 'View
| Orthographic view'.

4. Click on the 'External geometry' tool button. Click on the top and bottom hori-
zontal edges of the chassis (Figure 9-68).

Figure 9-68

5. Draw a rectangle. Mark two corners that are on equal height. Mark the Y-axis
and then, click the 'Constrain symmetrical' tool button (Figure 9-69).

● 225

FreeCAD for Electronics Applications.indd 225 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-69

6. Mark two upper, corresponding corners of the rectangle and of the construction
geometry and constrain the horizontal distance to -5 mm (this will bring the hole
to the center of the spacers).

7. Again, mark the corresponding upper corners and constrain the vertical distance
to 25 mm. Repeat the vertical constraint for two corresponding lower corners
(Figure 9-70)

● 226

FreeCAD for Electronics Applications.indd 226 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-70

8. In the 'Elements' list, mark the 4 lines of the rectangle. Right-click the selection
and select 'Toggle construction line' from the context menu (Figure 9-71). This
turns the rectangle into a useful construction geometry which helps to keep the
holes in place, even when front panel and rear panel are moved by unequal
amounts.

Figure 9-71

● 227

FreeCAD for Electronics Applications.indd 227 24-08-2023 14:30


FreeCAD for Electronics Applications

9. Draw 4 circles onto the corners of the rectangle. Mark the 4 circles and click the
'Constrain equal' tool button (Figure 9-72).

Figure 9-72

10. In the 'Elements' list, right-click one of the circles and constrain the diameter to
3 mm. Close the sketch (top).

11. In the tree view, mark the new sketch and click the 'Hole' tool button. In the task
window, enter 3.2 mm for the diameter and select 'Through all' for the depth.
Check the 'Reversed' checkbox (Figure 9-73). Close the task with the 'OK' button
(top).

● 228

FreeCAD for Electronics Applications.indd 228 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-73

The holes are in the sheet. Now they need to be continued in the spacers, with the help of
shape binders.

12. As the destination for the new shape binders, activate the body 'Chassis Spacer
001' by a double click (title then shown in bold letters).

13. In the body 'Chassis Sheet', hide the tip (Hole002), and display the sketch of the
holes (Sketch004). From the sketch, mark the two holes that need to be trans-
ferred to 'Chassis Spacer 001' (Figure 9-74). Then, click the green 'Create a sub
object(s) shape binder' tool button.

● 229

FreeCAD for Electronics Applications.indd 229 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-74

14. Rename the new SubShapeBinder to 'Mount Holes Chassis'. In the property list,
set the property 'Make face' to 'false'.

15. In the tree view, mark the new SubShapeBinder and click the 'Hole' tool button.
For the profile, select 'ISO metric regular profile', check the 'Threaded' check-
box. For the depth, select 'Through all' and for the key M3. Close the task win-
dow with the 'OK' button.

Because the other spacers were linked, the new threaded holes are transferred to those as well
(Figure 9-75). They could be used to hold the secondary wiring harness with anchor plates.
We will proceed with the assembly of other components to the chassis, when the front- and
back panels are assembled. Then, it is easier to spot spatial constraints inside the appa-
ratus.

● 230

FreeCAD for Electronics Applications.indd 230 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-75

9.4 Assembling the Chassis, Front and Rear Panel


For the final assembly, you create a new file. Merging the already prepared sub assemblies
resembles the insertion of elements into, e.g., the front panel, with cut-and-paste. Some
referencing may aid in optimizing the lengths.

1. Create a new file and save it as 'Lab Transformer'.

2. In that file, start a new Std-Part-Container and rename that to 'Lab Transformer
Complete'.

3. From the file 'Transformer Chassis', copy the Std-Part-Container 'Trafo Chassis
Complete' and paste it into the new document. Drag-and-drop the container into
'Lab Transformer Complete'.

4. Similarly, copy 'Trafo Front Panel Complete' from the file 'Transformer Front Pan-
el', paste it into the new document, and drag-and-drop the container into 'Lab
Transformer Complete' (Figure 9-76).

● 231

FreeCAD for Electronics Applications.indd 231 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-76

The orientation of the front panel is not aligned with the 'Front' direction of the final assem-
bly. When creating the front panel, you selected the XY plane for the top face. This can be
fixed by the definition of a shape binder and a proper attachment:

5. In the tree view, activate the body 'Chassis Sheet' by a double click. Click on the
blue 'Create a shape binder' tool button. In the task window, click in the 'Ob-
ject' button, which turns dark gray. Then, click the edit field next to the button
(Figure 9-77).

● 232

FreeCAD for Electronics Applications.indd 232 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-77

6. Switch to the 'Model' tab. Click on the datum plane 'Position Front Panel' (Fig-
ure 9-78) and return to the task window. Close the task window with the 'OK'
button.

Figure 9-78

● 233

FreeCAD for Electronics Applications.indd 233 24-08-2023 14:30


FreeCAD for Electronics Applications

7. Rename the new shape binder to 'Front Panel Position'. Drag-and-drop it into
the Std-Part-Container 'Lab Transformer Complete' (Figure 9-79). Set its 'Trace
Support' property to 'true'.

Figure 9-79

8. Now you fix the attachment: In the tree view, mark the Std-Part-Container
'Trafo Front Panel Complete' and switch to the 'Part' workbench.

9. From the main menu, select 'Part | Attachment…'. In the task window, the col-
lector for reference 1 is already waiting for input. Switch to the 'Model' tab. In
the tree view, click the shape binder 'Position Front Panel'.

10. Return to the 'Tasks' tab and select 'XY on plane' as the attachment mode. (Fig-
ure 9-80). For the attachment offset Y, enter 10 mm and close the task window
with the OK button (Figure 9-81). Hide the shape binder 'Position Front Panel'.

● 234

FreeCAD for Electronics Applications.indd 234 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-80

Figure 9-81

● 235

FreeCAD for Electronics Applications.indd 235 24-08-2023 14:30


FreeCAD for Electronics Applications

The designations for the directions are not always obvious. In this case, you have selected
'XY on plane' as the attachment mode. Even though the global coordinate system has the
Z axis in the vertical direction, it is designated as the 'Y' direction for the attachment offset
('Z' is the direction normal to the referenced plane). Some trial-and-error helps.

The back panel is inserted into the assembly in just the same way:

11. Create a shape binder 'Rear Panel Position' referencing the datum plane 'Position
Rear Panel' in 'Chassis Sheet'. Set its 'Trace Support' property to 'true'.

12. From the file 'Transformer Rear Panel', copy and paste the Std-Part-Container
'Trafo Rear Panel Complete' into the document 'Lab Transformer'. Drag-and-
drop the Std-Part-Container into the Std-Part-Container.

13. Mark 'Trafo Rear Panel Complete' and switch to the 'Part' workbench. From the
main menu, select 'Part | Attachment…'. Attach the rear panel to the shape
binder 'Position Rear Panel', select 'XY on plane' as the attachment mode and
enter a value of -10 mm for the attachment offset Y. Then, check the 'Flip sides'
checkbox (Figure 9-82).

Figure 9-82

14. In the tree view, hide the shape binder 'Rear Panel Position' (Figure 9-83).

● 236

FreeCAD for Electronics Applications.indd 236 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-83

In the front and rear panels, the mounting holes for the spacers are still missing. Because
it is not yet warranted that the spacers stay in the corners of the panels during, e.g., an
optimization, the holes should be modeled via an associative relation.

15. In the tree view, locate the body 'Front Panel Sheet'. Activate this body by a
double click.

16. Hide the body 'Front Panel Sheet', which you just activated, to expose the holes
in the spacers below (Figure 9-84, SPACE key). Mark the edges of the 4 holes.

● 237

FreeCAD for Electronics Applications.indd 237 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-84

17. Click on the green 'Create a sub object(s) shape binder' tool button.

18. Scroll up to locate the body 'Front Panel Sheet' again, in which the new SubSha-
peBinder has been placed. Rename the SubShapeBinder to 'Footprint Spacers'.

19. With the SubShapeBinder marked in the tree view, click the 'Hole' tool button.
In the task window, set the diameter to 4.2 mm, select 'Trough all' as the depth,
and check the 'Reversed' checkbox. Then, display the 'Front Panel Sheet' again
with the SPACE key.

20. In the similar way, insert the mounting holes in the back panel.

The chassis with all the elements on front and back panel is now completed (Figure 9-85).
As an example for the innards, a transformer will be added next. For the placement of
inside components, it is important to have a good representation of the casing around, in
order to avoid collisions by optimization of the positions.

● 238

FreeCAD for Electronics Applications.indd 238 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-85

9.5 Placing the Transformer


In the components directory, there is a model file with an example Transformer. The file de-
scribes the vintage type 'Engel ET3'. Even though the piece was quite old, it had a tap on the
primary coil allowing for a 230 VAC primary voltage, as well as the necessary screens for the
protection of the secondary winding. If you want to actually create the example project, you
need to purchase an up-to-date transformer from your supplier. Very likely, you would have
to match the number of banana jacks, and the engraving on the front panel with your device.
A few sentences with respect to safety need to be added here: If you plan to use this lab
transformer on your bench, it has to deliver protected low voltage at the secondary side
(SELV). To meet this specification, special insulation and screens are necessary, which are
usually proclaimed in the data sheet as well as on the type label. Another important item is
the protection of the transformer against overload.

The fuses for the primary coil, provided on the back panel, are a safeguard against gross failures
(e.g., a short in the secondary circuit, or melting insulation, shorting out parts of the primary
coil …). The transformer is not yet protected against slow and painful overheating. This has to
be done by a thermal fuse which could be strapped to the outside of the coil although it is better
located inside the coil — some types have these fuses already integrated. Insulated versions
of thermal fuses exist, and otherwise a suitably rated material must be added for insulation.
If you are not already an experienced developer in the field, you can easily see that these
matters are not an easy task to address, involving critical material and component choices.
As yet one more issue to ponder, the transformer has no secondary fuses, because it is un-
clear how the user combines the various coils with short lab jumper cables. Thus, the trans-

● 239

FreeCAD for Electronics Applications.indd 239 24-08-2023 14:30


FreeCAD for Electronics Applications

former is no toy, but needs to be used with care and oversight. If it is operated neglectfully
and carelessly, it can represent a fire hazard. Construction and use of the equipment must
thus be performed by certified electricians only.

21. In the 'Sample Projects | Lab Transformer | Components' directory, locate


and open the file 'Engel Transformer ET3.FCStd'. From this file, copy the
Std-Part-Container 'ET3 Complete' and paste it into the document 'Lab Trans-
former' (double-click the destination document, so its title is shown in bold,
before you paste, Figure 9-86).

Figure 9-86

The transformer looks displaced (Figure 9-86). In order to lift it onto the top of the chassis,
the placement parameters could simply be adjusted to match. The placement would refer
to the whole assembly, and not be associated with the chassis sheet, though. A short con-
sideration provides a shortcut for this special case: In principle, the transformer is a part
of the 'Trafo Chassis Complete', because it will bolt to that part. If you drag-and-drop the
transformer into that Std-Part-Container, the placement already refers to the chassis, and
the intended association is thus provided, except for chassis sheet thickness variations. We
take this shortcut here, in the final assembly:

22. Drag-and-drop the Std-Part-Container 'ET3 Complete' into the 'Trafo Chassis
Complete' Std-Part-Container. Edit the placement of the transformer container
and set the Z translation to 40.5 mm (Figure 9-87).

● 240

FreeCAD for Electronics Applications.indd 240 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-87

23. The visual inspection shows that the pilot lamp is located very close to the
transformer terminal strip (Figure 9-88). Even though it should be possible to
assemble the unit, the transformer could be moved a bit, in order to gain a little
more space. Switch the view to 'Top' and, from the main menu, select 'View |
Orthographic view'.

24. Edit again the placement of the transformer. Set the Y translation to 1.5 mm
(Figure 8-89).

● 241

FreeCAD for Electronics Applications.indd 241 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-88

Figure 9-89

● 242

FreeCAD for Electronics Applications.indd 242 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

9.6 Placing the Anchor Plates


With transformers, it is good practice to separate the wiring for primary and secondary
circuits. With our example project, it is possible to route the wires for the primary in the
center of the casing, underneath the transformer. Two anchor plates help to fix the little
wire harness later on. With respect to the project structure, the anchor plates belong to
'Trafo Chassis Complete', because their fasteners fix it to that part.

1. In the tree view, hide 'ETD3 Complete' with the SPACE key, in order to expose
the chassis sheet again. From the 'Sample Projects | Lab Transformer | Compo-
nents' directory, open the file 'Anchor Plate.FCStd'. Copy the Std-Part-Container
'Anchor Plate Complete' and paste it into the document 'Lab Transformer'. Drag
and drop it into the 'Trafo Chassis Complete' Std-Part-Container. Rename it to
'Anchor Plate Complete 001'.

2. In the tree view, click the new anchor plate. In the property list, open the 'Place-
ment' task window by clicking on the button in the edit field of the placement
property. Set the translations X = –9 mm, Y = –33 mm and Z = 3 mm (Figure
9-90). Close the task window with the OK button.

Figure 9-90

3. In the tree view, click the new anchor plate and click the 'Make link' tool button
(Figure 9-91).

● 243

FreeCAD for Electronics Applications.indd 243 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-91

4. The new anchor plate appears as 'Anchor Plate 002'. Drag-and-drop it into the
Std-Part-Container 'Trafo Chassis Complete'.

5. In the tree view, mark 'Anchor Plate 002'. In the property list, set 'Link trans-
form' to 'true'. With this, the further 'Link placement' parameters can be speci-
fied relative to the parent part. Open the 'Link placement' task window by click-
ing on the button in the 'Link placement' edit field. Set the Y translation to
72 mm (Figure 9-92).

Figure 9-92

● 244

FreeCAD for Electronics Applications.indd 244 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

6. In the tree view, display the transformer 'ETD3 Complete' again with the SPACE
key. Visually inspect the anchor plates in their locations (Figure 9-93).

Figure 9-93

In the chassis sheet, the bolt holes for transformer and anchor plates are still missing.

7. In the tree view, activate the body 'Chassis Sheet' by a double click, which also
sets it as the destination for the SubShapeBinders created in the following steps.

8. Hide the just activated body to expose the component edges necessary to define
the holes.

9. In the 3D view, from the bottom of the transformer, mark the inner contours
of the transformer spacers. Then, click the green 'Create a sub object(s) shape
binder' tool button (Figure 9-94).

● 245

FreeCAD for Electronics Applications.indd 245 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-94

10. In the tree view, scroll back to 'Chassis Sheet'. Rename the new SubShapeBind-
er to 'Footprint Transformer'.

11. With the new SubShapeBinder marked in the tree view, click the 'Hole' tool
button. In the task window, set the diameter to 4.2 mm and select 'Through
all' as the depth. Temporarily show the 'Chassis Sheet' body again, to check the
results of the 'Hole' command (Figure 9-95). Close the task window with the
'OK' button.

● 246

FreeCAD for Electronics Applications.indd 246 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-95

12. In the same way, create the bolt holes for the anchor plates. Set the diameter
for those to 3.2 mm.

13. With the anchor plates, the heads of the countersunk screws are located inside
the material. Expand 'Anchor Plate Complete 001' and edit the placement for the
screw. Set the Z translation to –3.01 mm. With the addition of 0.01 mm to the
chassis thickness of 3 mm, the head is displayed clearly, in front of the sheet
(Figure 9-96). The screw for the second anchor plate follows, as that is linked
to the first one.

● 247

FreeCAD for Electronics Applications.indd 247 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-96

For the transformer, some vent holes in the chassis would allow the cooling air flow to enter
from the bottom. In this way, the air could also access the coil from the bottom. Entering
from holes in the lower part of the cover side walls, the air would probably not get there as
much. To create the holes, the 'Chassis Sheet' needs to be touched. For this change, the
late point in time is plausible: Only now, with the maturing 3D model, these questions can
be addressed with visual feedback from the design.

14. In the tree view, activate the body 'Chassis Sheet' by a double click, if necessary.

15. Start the sketcher and select the XY plane as the sketching plane.

16. From the main menu, select 'Sketch | View section' and 'View | Orthographic
view'.

17. Draw two circles, approximately where the vent holes are expected. Mark the
two centers of the circles and the Y-axis. Then, click the 'Constrain symmetrical'
tool button (Figure 9-97).

● 248

FreeCAD for Electronics Applications.indd 248 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-97

18. Mark the two circles and click the 'Constrain equal' tool button (Figure 9-98,
steps 1, 2).

19. In the 'Elements' list, right-click one of the circles. From the context menu, se-
lect 'Constrain diameter' and enter a value of 7 mm (Figure 9-98, steps 3, 4).

Figure 9-98

● 249

FreeCAD for Electronics Applications.indd 249 24-08-2023 14:30


FreeCAD for Electronics Applications

20. Mark the two circle centers and constrain the horizontal distance to 34 mm.
Then, mark one of the circle centers and the origin, and constrain the vertical
distance to 40 mm (Figure 9-99). Close the sketch.

Figure 9-99

21. In the tree view, mark the new sketch and click the 'Pocket' tool button. In the
task window, select the type 'Through all' and check the 'Reversed' checkbox
(Figure 9-100). Close the task window with the 'OK' button.

● 250

FreeCAD for Electronics Applications.indd 250 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-100

22. In 'Chassis Sheet', mark the last design state (tip), and select 'Part Design |
Apply a pattern | LinearPattern' from the main menu. In the task window, select
'Vertical Sketch axis' as the direction, and set the number of occurrences to 7
(Figure 9-101). Close the task with the 'OK' button.

Figure 9-101

● 251

FreeCAD for Electronics Applications.indd 251 24-08-2023 14:30


FreeCAD for Electronics Applications

9.7 Associative Generation of the Sheet Metal Cover


For the generation of the sheet metal cover, robust relations to the other parts of the as-
sembly are necessary. It is also worthwhile to think about which parts could be the source
of these references. The length of the apparatus is defined by the two datum planes 'Posi-
tion Front Panel' and 'Position Rear Panel' in the body 'Chassis Sheet'. The width and height
of the apparatus are controlled by the width and height of the front (and rear) panel. With
the cover extended a little longer than the apparatus itself, the references could be derived
from the front and back panel.

Defining the references turns out to be not trivial. Of course, shape binders could be gen-
erated, referencing the edges of the panels directly. But then, they get dependent on
facet numbers, and the design could break by re-enumeration, after the panels have been
touched again.

Therefore, it is meaningful to create a reference to a sketch located on a datum plane,


which would be a resilient anchor in 3D space.

9.7.1 Where to Pick the References


For the top of the new cover, it would be good to define references to the outer top edges
of front panel and back panel. Fortunately, inside the bodies 'Front Panel Sheet' and 'Back
Panel Sheet', there already exist sketches of the outer panel outlines: The sketches 'Front
Panel Top Contour' and 'Rear Panel Top Contour'. We will make use of the fact that a shape
binder can also be defined using only parts of sketches, which saves us work.

1. In the tree view, display the sketches 'Front Panel Top Contour' and 'Rear Panel
Top Contour' with the SPACE key (Figure 9-102).

Figure 102

● 252

FreeCAD for Electronics Applications.indd 252 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

From these sketches, you will pick the necessary edges for the shape binders, with which
the cover top will be defined. As a result, the cover will follow length changes of the chassis
as well as width and height changes of the front cover. All of this may look a bit indirect,
but a lot of associativity is returned.

9.7.2 Creating the Cover


1. For the cover, start a new Std-Part-Container and rename it to 'Trafo Cover
Complete'. In that container, start a new body and rename it to 'Trafo Cover
Sheet' (Figure 9-103).

Figure 9-103

2. In the 3D view, hide the tip (last design state) of 'Front Panel Sheet'. From the
sketch of the front panel top outline, mark the upper line. Then, click the blue
'Create a shape binder' tool button (Figure 104).

● 253

FreeCAD for Electronics Applications.indd 253 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-104

3. In the task window, the selection of the object (the sketch 'Front Panel Top Con-
tour') and the upper line (edge 1) is preset (Figure 9-105) because of our prior
markup. Close the task window with the OK button.

Figure 9-105

● 254

FreeCAD for Electronics Applications.indd 254 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

4. In 'Trafo Cover Sheet' (scroll down), rename the new shape binder to 'Front
panel Outline Top'. The shape binder will jump to its correct location after setting
its 'Trace Support' property to 'true', followed by a recalculation (F5 key, Figure
9-106).

Figure 9-106

5. In the same way, create a shape binder for the back panel top outline.

6. In the bodies 'Front Panel Sheet' and 'Back Panel Sheet', hide the sketches of
the top contours again. In the two bodies, display again the tips. Then, in the
tree view, hide all Std-Part-Containers except 'Trafo Cover Complete' with the
SPACE key (Figure 9-107). All this hideaway is making the selection of the shape
binders easier.

● 255

FreeCAD for Electronics Applications.indd 255 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-107

7. In the tree view, mark the two new shape binders and click the 'Create a datum
plane' tool button (Figure 9-108). Do not change the preset values and close the
task window with the 'OK' button. Rename the new datum plane to 'Trafo Cover
Top Plane'.

Figure 9-108

● 256

FreeCAD for Electronics Applications.indd 256 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

8. Mark the new datum plane and start the sketcher.

9. Close and reopen the sketch in order to show external geometry (Figure 9-109).
The shape binders appear as yellow lines. Temporarily display the 'Trafo Front
Panel Complete' to see which of the shape binders corresponds to the front
(Figure 9-109).

Figure 9-109

10. Click on the 'External geometry' tool button and mark the two shape binders
(Figure 9-110).

Figure 9-110

● 257

FreeCAD for Electronics Applications.indd 257 24-08-2023 14:30


FreeCAD for Electronics Applications

11. Draw a rectangle. The cover should overlap to the front and back side some-
what. Mark a corner of the top reference line and the corresponding corner of the
rectangle. Constrain the vertical distance to 3 mm (Figure 9-111).

Figure 9-111

The upper shape binder corresponded to the rear panel. It is important that only the verti-
cal position of the rectangle top is controlled by this shape binder. We will assign the control
to the width of the cover to the front panel, a few steps ahead.

12. Mark two lower, corresponding end points of rectangle and construction geome-
try. Also constrain the vertical distance of these points to 3 mm.

13. Mark the two lower points again and constrain their horizontal distance to zero.
(Figure 9-112).

Figure 9-112

● 258

FreeCAD for Electronics Applications.indd 258 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

14. On the opposite side, mark the lower point of the rectangle and the correspond-
ing end point of the lower construction line. Constrain the horizontal distance to
0 mm (Figure 9-113). Close the sketch.

Figure 9-113

Now, you are ready to create the cover. Thanks to a wonderful 'Sheet Metal' workbench,
this can proceed with only little effort:

15. Switch to the 'Sheet Metal' workbench.

16. In the tree view, mark the new sketch and click the 'Make Base Wall' tool button
(Figure 9-114).

● 259

FreeCAD for Electronics Applications.indd 259 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-114

17. In the tree view, hide the shape binders 'Front Panel Outline Top' and 'Rear Panel
Outline Top'. Also hide the datum plane 'Trafo Cover Top Plane'. Then, display
again all the Std-Part-Containers (Figure 9-115).

Figure 9-115

18. Mark a long top edge of the cover and click the 'Make Wall' tool button (Figure
9-16).

● 260

FreeCAD for Electronics Applications.indd 260 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-116

19. In the tree view, mark the new bend object. In the property list, select 'Thick-
ness outside' as the bend type. Set the length to 89 mm. The bend will only
update, if a recalculation has been triggered (e.g., by the F5 key, Figure 9-117).

Figure 9-117

● 261

FreeCAD for Electronics Applications.indd 261 24-08-2023 14:30


FreeCAD for Electronics Applications

20. In the same way, create the opposite wall of the cover (Figure 9-118).

Figure 9-118

21. Switch back into the 'Part Design' workbench.

Before the fillets for the lower corners of the cover are added, all other features of the cover
should have been created — in order to lower the danger of facet re-enumerations. Near
the top of the cover, rows of vent holes could allow air circulation from below.

22. Consider sketching the holes onto the YZ plane of the cover and creating sym-
metric pockets from there through the whole part, which saves the effort to de-
fine additional planes: Start the sketcher and select the YZ plane as the sketch-
ing plane. If the present 3D geometry is not visible, close and reopen the sketch.

23. From the main menu, select 'Sketch | View section' and 'View | Orthographic
view' (Figure 9-119).

● 262

FreeCAD for Electronics Applications.indd 262 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-119

24. Draw a circle of 7 mm diameter. Constrain the horizontal distance to the center
line to 40 mm. Constrain the vertical distance from the origin to 60 mm (Figure
9-120). Close the sketch.

Figure 9-120

● 263

FreeCAD for Electronics Applications.indd 263 24-08-2023 14:30


FreeCAD for Electronics Applications

25. With the new sketch marked in the tree view, click the 'Pocket' tool button. In
the task window, select for the type 'Through all' and check the 'Symmetric to
plane' checkbox (Figure 9-121). This creates a hole in both sidewalls at the same
time. Close the task window with the 'OK' button.

Figure 9-121

26. In the tree view, mark the last design state of the cover. Then, select from the
main menu 'Part Design | Apply a pattern | LinearPattern' (Figure 9-122).

● 264

FreeCAD for Electronics Applications.indd 264 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-122

27. In the task window, set the length to 80 mm, and the number of occurrences
to 7 (Figure 9-123). If you apply a linear pattern and it is not being shown as
expected, try to select another axis from the 'Direction' control.

Figure 9-123

● 265

FreeCAD for Electronics Applications.indd 265 24-08-2023 14:30


FreeCAD for Electronics Applications

The bolt holes for the attachment of the cover are still missing. Which element should con-
trol the position of these holes requires a worthwhile thought. The bolts are ending in the
lower chassis spacers, in which threaded holes for them will be cut. When thinking about
the manufacturing of the spacers, it seems important that the threaded holes are posi-
tioned in the center of the square profiles, and not wander out of the profile cross-section
by some other dimension changes. Therefore, you start to define the threaded holes in the
chassis spacers first, and then create a reference to them in the cover design.

28. In the tree view, hide the Std-Part-Containers 'Trafo Cover Complete', 'Trafo
Front Panel Complete' and 'Trafo Rear Panel Complete' with the SPACE key.

29. In the Std-Part-Container 'Trafo Chassis Complete', activate the body 'Chassis
Spacer 001' with a double click.

30. In the Std-Part-Container 'Trafo Chassis Complete'. Hide the other spacers.

31. Start the sketcher and select the YZ plane as the sketching plane. From the main
menu, select 'View | Orthographic view'.

32. Click on the 'External geometry' tool button and mark both end faces of the
spacer (Figure 9-124).

Figure 9-124

33. From the main menu, select 'Sketch | View section'. Draw two circles. In the
'Elements' list, mark the two circles and click the 'Constrain equal' tool button.
Mark the two centers and constrain their vertical distance to 0 (Figure 125).

● 266

FreeCAD for Electronics Applications.indd 266 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-125

34. Mark one of the circle centers and one endpoint of the closest construction line.
Constrain the horizontal distance to 20 mm. Repeat that for the opposite circle
(Figure 9-126).

Figure 9-126

35. Draw a point (Figure 9-127). Mark the point and the closest construction line.
Then, click the 'Constrain symmetrical' tool button (Figure 9-128).

● 267

FreeCAD for Electronics Applications.indd 267 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-127

Figure 9-128

36. Mark the new point and one of the circle centers. Constrain the vertical distance
to zero (Figure 9-129).

● 268

FreeCAD for Electronics Applications.indd 268 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-129

37. In the 'Elements' list, right-click one of the circles. Select 'Diameter Constrain'
from the context menu and enter a value of 2.5 mm (Figure 9-130). Close the
sketch.

Figure 9-130

38. In the tree view, mark the new sketch and click the 'Hole' tool button. In the
task window, select 'ISO metric regular' for the profile and check the 'Threaded'
checkbox. For the size, select M3. Set the depth to 'Through all' and check the
'Reversed' checkbox (Figure 9-131). Close the task window with the 'OK' button.

● 269

FreeCAD for Electronics Applications.indd 269 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-131

39. In the tree view, display all the linked chassis spacers again with the SPACE key.
The holes have been propagated to all of them.

40. When you hover over 'Chassis Spacer 001' in the tree view, the 3D view updates
with a highlighted, transparent representation of the spacer. With this view,
you can quickly check whether any of the holes collide with each other (Figure
9-132).

● 270

FreeCAD for Electronics Applications.indd 270 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-132

After these preparations, you can create the mounting holes in the cover. For the
associative reference, shape binders can be used:

41. In the tree view, display the Std-Part-Container 'Trafo Cover Complete' with the
SPACE key. Expand it and activate the body 'Trafo Cover Sheet' by a double click,
in order to set the destination for the new shape binders.

42. In the 3D view, navigate to the last design state of 'Chassis Spacer 001' (Hole…),
and expand that to expose the sketch. Mark the sketch with a click (Figure
9-133).

● 271

FreeCAD for Electronics Applications.indd 271 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-133

43. Click on the blue 'Create a shape binder' tool button. Thanks to our prior selec-
tion, the sketch is already preset. Close the task with the OK button.

44. Scroll down and locate the new shape binder in 'Trafo Cover Sheet'. Rename it
to 'Footprint Chassis Spacers'.

45. With the new shape binder marked, click the 'Hole' tool button.

46. In the task window, set the diameter to 3.2 mm and select 'Through all' for the
depth. Check the 'Reversed' checkbox (Figure 9-134). Close the task window
with the OK button.

● 272

FreeCAD for Electronics Applications.indd 272 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-134

47. In the tree view, expand the last design state of 'Trafo Cover Sheet' to expose
the shape binder. Mark the shape binder with a click, and then click again on the
'Hole' tool button.

48. In the task window, repeat the entries described in step 6 above, but do not
check the 'Reversed' checkbox (Figure 9-135). Close the task window with the
OK button.

● 273

FreeCAD for Electronics Applications.indd 273 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-135

49. In 'Chassis Spacer 001', hide the sketch in the tip again with the SPACE key.
Display the two panels again.

The cover is nearly completed. Now, cosmetic features can be applied. A fillet on the low-
er corners of the cover saves ugly scratches on the workbench later on. These fillets are
attached to facets! We create them in the hope, that this is the last addition, and re-enu-
meration is not likely to occur with the cover…

50. In the 3D view, mark the four lower edges of the cover sheet (Figure 9-136).
Then, click the 'Fillet' tool button. In the task window, set the radius to 3 mm
(Figure 9-137).

● 274

FreeCAD for Electronics Applications.indd 274 24-08-2023 14:30


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-136

Figure 9-137

The parts of the apparatus are now readily designed, at least to the point where you could
start to actually manufacture the parts. If you want to test whether the associativity works,
you can, e.g., move the front panel 20 mm towards the front, changing the attachment
parameters of the datum plane 'Position Front Panel' in the body 'Chassis Sheet' (Figure
9-138, 9-139).

● 275

FreeCAD for Electronics Applications.indd 275 24-08-2023 14:30


FreeCAD for Electronics Applications

Figure 9-138

Figure. 9-139

● 276

FreeCAD for Electronics Applications.indd 276 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

You could also try to make the front panel a bit wider. In order to do this, you need to edit
the sketch of the first state of the front panel ('Pad…'). In the following example, the width
was set to 85 mm (Figure 9-140). The back panel does not follow, because it brought its
own dimensions (Figure 9-141). Maybe you can change that with a suitable reference later,
on your own.

Figure 9-140

Figure 9-141

● 277

FreeCAD for Electronics Applications.indd 277 24-08-2023 14:31


FreeCAD for Electronics Applications

After a parameter has been changed, the assembly needs to be updated with a recalcula-
tion (F5 key). This already takes some time. Now, you can add the hardware to bolt the
transformer together.

9.8 Where do the Fasteners Belong?


In the past chapters, as well as in the examples described in the Appendices, the fasten-
ers are packed into the Std-Part-Containers of the objects, which are mounted with that
hardware. Especially with parts that are used multiple times, this is a time-saving practice.

In the current project, you've also generated parts dynamically, like the cover or the chas-
sis spacers. With those parts, the positions of the bolt holes were created using shape bind-
ers referencing other parts, in which special requirements for the positioning of the holes
exist. The fasteners could simply be attached to the edges of the resulting bolt holes, e.g.,
in the cover. However, this would reference their position to facet edges, and thus expose
these attachments to the risk of displacement by re-enumeration. If the screws are regard-
ed as the very last, cosmetic addition of an assembly, that would probably be still tolerable.

However, it is preferable to attach the fasteners to more robust references. These exist in
the form of the sketches, with which the hole positions were defined in the first place. For
the cover, the hole positions were defined in the chassis spacers, in order to constrain those
to the spacer profile centers. From the defining sketch, two more derived shape binders will
help to position the screws.

9.8.1 Fasteners for the Cover


1. In 'Trafo Chassis Complete', expand the body 'Chassis Spacer 001' and display
the sketch in the tip (Hole010) with the SPACE key (Figure 9-142).

Figure 9-142

● 278

FreeCAD for Electronics Applications.indd 278 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

2. In the Std-Part-Container 'Trafo Cover Complete', activate the body 'Trafo Cover
Sheet' to set it as the destination for the new shape binder.

3. Click on the blue 'Create a shape binder' tool button. In the task window, click
the 'Add Geometry' button, which then turns dark gray, to indicate the collector
is activated. In the 3D view, mark the circle of the sketch, which is located close
to the front panel (Figure 9-143). Close the task window with the 'OK' button.

Figure 9-143

4. In the same way, create a shape binder for the rear circle of the sketch.

5. Scroll down to the 'Trafo Cover Sheet' body and rename the new shape binders
to 'Mount Hole Positions Front' and 'Mount Hole Positions Rear' (Figure 9-144).
Set the property 'Trace support' for both shape binders to 'true'.

● 279

FreeCAD for Electronics Applications.indd 279 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 9-144

6. Drag-and-drop the two shape binders into the Std-Part-Container 'Trafo Cover
Complete'. Hide the sketch in 'Chassis Spacer 001' (Figure 9-145).

Figure 9-145

● 280

FreeCAD for Electronics Applications.indd 280 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

7. Now, you add the screws: From the main menu, select 'Macro | Recent Macros
| start_bolts'. From the BOLTS Parts selector, select 'Standard | DIN | DIN7991'.
Leave the key at M3 and set the length to 10 mm. Click the 'Add part' button 4
times to add all the screws at once.

8. In the tree view, mark all the new screw objects. Drag-and-drop them into the
Std-Part-Container 'Trafo Cover Complete'.

9. Now, you create the attachments. Switch to the 'Part' workbench. Mark the first
screw object. From the main menu, select 'Part | Attachment…'.

10. In the task window, click into the edit field next to the button for reference 1,
which is dark gray and reads 'Selecting…'. Then, switch to the 'Model' tab, and
click the shape binder 'Mount Hole Positions Front'. Return to the 'Tasks' tab.

11. In the task window, select 'Concentric' as the attachment mode. Set the attach-
ment offset Z to -38.51 mm and check the 'Flip sides' checkbox. (The additional
offset of 0.01 mm to the border of the casing helps to display the screw more
clearly, Figure 9-146). Close the task window with the 'OK' button.

Figure 9-146

12. Attach the other screws in a similar way, also using the shape binder 'Mount Hole
Positions Rear'. For the screws on the opposite side of the casing, do not check
the 'Flip sides' checkbox.

13. In the body 'Trafo Cover Sheet', hide the shape binders 'Mount Hole Positions
Front' and 'Mount Hole Positions Rear'.

● 281

FreeCAD for Electronics Applications.indd 281 24-08-2023 14:31


FreeCAD for Electronics Applications

9.8.2 Fasteners for the Chassis


1. In the tree view, hide all Std-Part-Containers except 'Trafo Chassis Complete'.
In 'Trafo Chassis Complete', hide all objects except 'Trafo Chassis Sheet', and in
that body, also hide the tip. Locate and display only the sketch used to create
the four mount holes (Figure 9-147).

Figure 9-147

2. In the tree view, activate the body 'Trafo Chassis Sheet' with a double click.

3. One by one, mark each circle of the sketch and then click the blue 'Create a
shape binder' tool button. Do not change the preset values and close the task
window with the 'OK' button.

4. Rename the four new shape binders to 'Bolt Hole 1' to 'Bolt Hole 4'. Set the trace
support for all of them to 'true'.

5. Drag-and-drop the four new shape binders into the Std-Part-Container 'Trafo
Chassis Complete' (Figure 9-148). Display the objects 'Chassis Spacer 001',
'Chassis Spacer 002' and the tip in 'Chassis Sheet' body again, with the SPACE
key.

● 282

FreeCAD for Electronics Applications.indd 282 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-148

6. With the 'BOLTS Parts Selector', add four screws, type DIN 7991, length 10 mm,
to the design. Drag-and-drop them into 'Trafo Chassis Complete'.

7. Switch to the 'Part' workbench. Again, mark each screw and select 'Part | At-
tachment…' from the main menu. As described in the previous section, attach
the first screw to one of the new shape binders, selecting the attachment mode
'Concentric', an attachment offset of -3.01 mm (Figure 9-149) and checking the
'Flip side' checkbox.

● 283

FreeCAD for Electronics Applications.indd 283 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 9-149

8. In the same way, attach the remaining screws to the other shape binders (Figure
9-150).

Figure 9-150

9. Display all previously hidden objects again with the SPACE key.

● 284

FreeCAD for Electronics Applications.indd 284 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

9.8.3 Fasteners for Front and Rear Panel


The defining objects for the mount holes in the front and rear panel are the chassis spac-
ers. For this reason, it would now be practical to add the screws to the first spacer (all
others are link copies of the first one and would therefore follow automatically). How-
ever, expanding the tree of 'Trafo Chassis Complete' now reveals a weakness of our se-
lected project structure: The spacers are only defined as body objects, and it is there-
fore not possible to add the fasteners to just one of them. One solution is to add the
eight screws manually to the enclosing Std-Part-Container 'Trafo Chassis Complete'.
Because this is an instruction book, you may find it fitting to correct the structural weak-
ness of the project in a few more steps. The following would need to be undertaken: The
link copies of the chassis spacer are deleted. A new Std-Part-Container is created in order
to house the spacer and the fasteners. From this, you will create new link copies. Then the
references for the holes in the front and back panel need to be restored:

1. In the tree view, hide 'Trafo Front Panel Complete' and 'Trafo Rear Panel Com-
plete' with the SPACE key.

2. Create a new Std-Part-Container and rename it to 'Chassis Spacer Complete


001'.

3. Drag-and-drop it into 'Trafo Chassis Complete'.

4. Drag-and-drop the body 'Chassis Spacer 001' into the new Std-Part-Container.

5. Delete the link copies 'Chassis Spacer 002' through 'Chassis Spacer 004'.

6. Double-click the body 'Chassis Spacer 001' to activate it (Figure 9-151) and set
it as the destination for new shape binders.

● 285

FreeCAD for Electronics Applications.indd 285 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 9-151

7. In the tree view, display the two sketches for the holes in the spacer end faces
(Figure 9-152). Hide the tip of the body 'Chassis Spacer 001' (designated as
'Hole010').

Figure 9-152

● 286

FreeCAD for Electronics Applications.indd 286 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

8. Click on the blue 'Create a shape binder' tool button. In the task window, click
the 'Add Geometry' button, which turns dark gray.

9. Click on the circle of the front-side sketch. It is important that the exact edge is
listed in the task window, not only the sketch object (Figure 9-153). Close the
task with the 'OK' button.

Figure 9-153

10. Rename the new shape binder to 'Bolt Hole Front Face'.

11. In the analog way, create a shape binder for the rear sketch, and rename it to
'Bolt Hole Rear Face'. Take care when clicking the blue 'Create a shape binder'
tool button. If the other shape binder is still marked in the tree view (because
you just renamed it), the task window of that shape binder is reopened, instead
of the creation of a new one.

12. Set the property 'Trace Support' for both new shape binders to 'true'. Drag-and-
drop both shape binders into the Std-Part-Container 'Chassis Spacer Complete
001' (Figure 9-154).

● 287

FreeCAD for Electronics Applications.indd 287 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 9-154

The shape binders will be needed to attach the screws. We leave the related sketches still
set as visible, they will be needed to define the holes in the panels later.

13. Select the macro 'start_bolts', and add two screws DIN 7991, size M4, length
10 mm to the assembly.

14. Drag-and-drop the new screws into the Std-Part-Container 'Chassis Spacer
Complete 001' (Figure 9-155).

● 288

FreeCAD for Electronics Applications.indd 288 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-155

15. In the tree view, display the tip of the body 'Chassis Spacer 001' with the SPACE
key. Mark the first screw and switch to the 'Part' workbench. From the main
menu, select 'Part | Attachment…'.

16. For the selection of reference 1, switch to the 'Model' tab and select the shape
binder 'Bolt Hole Front Face'. Switch back to the 'Tasks' tab. For the attachment
mode, select 'Concentric', enter a value of -2.01 mm for the attachment offset Z
and check the 'Flip sides' checkbox (Figure 9-156). Close the task window with
the 'OK' button.

● 289

FreeCAD for Electronics Applications.indd 289 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 9-156

17. In the similar way, attach the other screw to the rear face shape binder. There,
you do not need to check the 'Flip sides' checkbox.

18. Using the 'Make link' tool button, create 3 links of the Std-Part-Container 'Chas-
sis Spacer 001'.

19. Drag-and-drop the link objects into the Std-Part-Container 'Trafo Chassis Com-
plete' (Figure 9-157).

● 290

FreeCAD for Electronics Applications.indd 290 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

Figure 9-157

20. Edit the 'Link placement' properties of the 3 link objects, according to the table
in section 9.3.1. The translations distribute the 4 spacers again in the corners
of the unit.

As an advantage, you only need to change the placement of the screws on 'Chassis Spacer
Complete 001'. Unfortunately, by invoking the changes to the project structures, you need
to repair the references of the holes in the front and back panel.

21. In 'Chassis Spacer Complete 001', hide the two screws.

22. In 'Front Panel Complete', activate the body 'Front Panel Sheet'. Delete the last
design state ('Hole005'), which represents the creation of the mounting holes.
This reveals the SubShapeBinder which was contained in the tip (Figure 9-158).

● 291

FreeCAD for Electronics Applications.indd 291 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 9-158

Figure 9-159

● 292

FreeCAD for Electronics Applications.indd 292 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

23. Delete the SubShapeBinder 'Footprint Spacers' also (after the deletion of the
referenced objects, it is not easy to edit it).

24. In the tree view, in all versions of the 'Chassis Spacer Complete', mark the shape
binder 'Bolt Hole Front Face' (Figure 9-159).

25. Click on the green 'Create a sub object(s) shape binder' tool button.

26. Rename the new SubShapeBinder in 'Front Panel Sheet' to 'Footprint Spacers'.
With the new SubShapeBinder marked in the tree view, click the 'Hole' tool
button.

27. In the task window, set the diameter to 4.2 mm, select 'Through all' for the
depth and check the 'Reversed' checkbox (Figure 9-160).

Figure 9-160

28. Close the task window with the 'OK' button.

29. In a similar way, create the bolt holes for the rear panel. Display the screws in
'Chassis Spacer Complete 001' again with the SPACE key, which updates all the
linked screws also.

● 293

FreeCAD for Electronics Applications.indd 293 24-08-2023 14:31


FreeCAD for Electronics Applications

The design is now finished (Figure 9-161). As you have seen, it is perfectly possible to cor-
rect features in a more complex project structure. But it will not always be as easy as in this
example, where you only had to undo the last design steps in the panels.

Figure 9-161

You might have noticed that the holes for the bolts were not countersunk. With respect
to the documentation, this may look incomplete. Also, an external service provider would
not have created the features. In the home workshop, however, such short cuts could be
permissible, as planning and manufacturing are done by one person.

9.9 Creating the Unfold of the Cover


The methods to create the unfolded version of the cover, and also drawings of it, are de-
scribed in section 5.4.1. With this part, outline and bends are easy to distinguish. There-
fore, the sample project file contains only one sheet with a drawing of the unfolded cover.

9.10 Example Photos – Meeting the Reality


Some photos of the lab transformer are shown below. The effort invested in the 3D design
paid off – all parts could be assembled without difficulties.

9.11 What to do Next


The lab transformer was a demonstration project, maybe a bit old school. Yet, all the steps
undertaken to create sub-assemblies and the final assembly can be seen as quite generic.
Following the method, it does not matter what the chassis contains. What about a nice 2 ×
100 W high-end amplifier, as described in [ELE 2022]?

● 294

FreeCAD for Electronics Applications.indd 294 24-08-2023 14:31


Chapter 9 ● A More Complex Design: The Lab Transformer

9.12 Component Libraries – Design Recycling


A collection of beautiful components makes the start into the 3D world easier. In the direc-
tory 'Extras' of the online material, some more parts are contained: Two versions of snap-in
mains rocker switches, and a safety banana jack, which you can use and share. Be aware
of the dimensions, though. Some components may look fairly similar, but have slightly dif-
ferent sizes, depending on the manufacturer and model.

9.13 Importing STEP Model Files


The insertion of STEP models into assemblies is fairly simple, as you have seen with the
circuit board of the ESR meter earlier. Many manufacturers offer access to model files, with
a sometimes-required prior registration. Parts like e.g., plastic enclosures often have in-
clined walls on in- and outside, which ease the release from the mold during the production
process. Against such details, you may not want to fight with a caliper, but rather snug your
artwork into the casing, guided by some shape binders to the model file.

When you open a STEP file with FreeCAD, the Std-Part-Container for it is automatically
generated – lavishness!

Quite often, the STEP files turn out to be large. Then, it could be beneficial to switch to the
'Part' workbench and to create a body object of it, selecting 'Part | Create a Copy | Create
simple copy' from the main menu. This efficient method, however, lets the color selections
of the different objects in the STEP file disappear. A circuit board may then be shown in the
plain standard gray.

● 295

FreeCAD for Electronics Applications.indd 295 24-08-2023 14:31


FreeCAD for Electronics Applications

Chapter 10 ● FreeCAD and KiCad

10.1 Importing Data from KiCad to FreeCAD


All relevant information for the STEP data import has been presented in Section 9.7.1. Ki-
Cad is delivering very neat, colorful representations of the circuit boards in STEP files. This
possibility is so fascinating in its own right, that it can also provide motivation for getting
started with FreeCAD. However, the connection between KiCad and FreeCAD is not all plain
sailing!

10.2 Creating 3D Models for KiCad


This section was inspired by [And 2022]. A detailed description of the KiCad library man-
agement is contained in [Dal 2022]. For circuit elements, which do not yet have a 3D model
in a KiCad library, you can use FreeCAD to actually build one! This is very useful when you
develop, say, a small breakout board for a sensor, maybe with a special holder attached. Or
you have found an antique treasure in a dusty drawer, which you wish to bring back to life.

The latter case motivated the author: A number of small 7-segment LED displays were
found in a box of surplus electronics (Figure 10-1). Evidently, they have the look and feel
of a Texas Instruments TI-30 Pocket Calculator ('old hands' might remember the device),
but they could still find useful applications (Figure 10-2).

Figure 10-1

Figure 10-2

● 296

FreeCAD for Electronics Applications.indd 296 24-08-2023 14:31


Chapter 10 ● FreeCAD and KiCad

A step-by-step instruction for the creation of the 3D model would be too exhaustive here
(many more instructions follow in the appendices). The FreeCAD file for the display is con-
tained in the directory 'LED Display' of the online material. In case of your interest, you
could open the file and inspect the methods of its making.

The association of a 3D model to a circuit element footprint does not require black magic.
The silkscreen patterns already represent such associations, with 2D drawings residing in
the plane of the board. On many boards, the component density is quite high. Therefore,
it is important to invest good effort in precise positioning of the pins and of the casing
when creating the 3D model. A good fit will make the assembly of the device easier. Also,
undesirable mechanical stresses, for example, by pressing the device into poorly defined
eyelets, can be avoided. Many data sheets have mechanical drawings of the casings, which
can be used as a reference during the design of the 3D model.

When the 3D model with suitable pins has been created (Figure 10-3), the way back into
KiCad is not difficult. You need to find the path to the local directory for user-owned librar-
ies. With openSUSE Linux, it is:

home/your-username/.local/share/kicad/6.0/3dmodels

Export (or copy) a step file of the model to this location.

Figure 10-3

In KiCad, [Dal 2022] describes in detail, how to start a new library with the footprint editor.
The footprint editor is then used to define the array of eyelets or pads, and the silkscreen
symbol (Figure 10-4). After clicking on “Footprint properties” (Figure 10-5), you can select
the tab '3D Models' and add the newly created model file (Figure 10-6, steps 1 and 2).

● 297

FreeCAD for Electronics Applications.indd 297 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 10-4

Figure 10-5

● 298

FreeCAD for Electronics Applications.indd 298 24-08-2023 14:31


Chapter 10 ● FreeCAD and KiCad

Figure 10-6

It is necessary to align the 3D model with the pads or eyelets with perfection. For a better
representation, switch the view to “bottom” (Figure 10-6, step 3). Also, switch the per-
spective to 'orthographic' (Figure 10-6, step 4). Align the 3D model with the parameters
rotation and offset (Figure 10-7, step 5). In the final state, the casing and the silkscreen
print are perfectly aligned (Figure 10-8).

● 299

FreeCAD for Electronics Applications.indd 299 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure 10-7

Figure 10-8

● 300

FreeCAD for Electronics Applications.indd 300 24-08-2023 14:31


Chapter 10 ● FreeCAD and KiCad

In the next step, create a symbol library with the symbol editor. With that, couple a suitable
circuit diagram symbol to the just created footprint (Figure 10-9). That's all you have to do
to use the new (actually, 'ancient') element in KiCad (Figure 10-10). thanks to KiCad, the
steps are quite intuitive to undertake.

Figure 10-9

Figure 10-10

● 301

FreeCAD for Electronics Applications.indd 301 24-08-2023 14:31


FreeCAD for Electronics Applications

Chapter 11 ● Community Resources

FreeCAD is freely available and has become quite popular over te past few years. Conse-
quently, there is a whole universe of blogs, video tutorials on YouTube, and other websites
which cover the topic. The following, rudimentary, list is intended to contribute just a few
starting points for your own research.

1. The main service point is definitely the FreeCAD project homepage:


https://www.freecadweb.org/

2. Terms and concepts are explained at:


https://wiki.freecadweb.org/

3. This website also has the manual for free downloading:


https://wiki.freecadweb.org/Manual:Introduction/en

4. Many topics and pitfalls are explained nicely and clearly by Ulrich Rapp here:
https://www.ulrich-rapp.de/stoff/freecad/index.htm

5. Useful hints for the use of the sketcher are available here (with examples for
3D printing):
https://ubit-rc.de/downloads/PartDesignTut1.pdf
https://ubit-rc.de/downloads/PartDesignTut2.pdf

6. A
 nother introductory website, though partly under construction, can be found
here:
https://www.freecad.info/

7. T
 he following website offers many articles related to FreeCAD, as well as the
free e-book FreeCAD for Makers:
https://www.workshopshed.com/

8. The free download of the e-book is available from:


https://www.workshopshed.com/2022/10/freecad-for-makers/

● 302

FreeCAD for Electronics Applications.indd 302 24-08-2023 14:31


Sources

Sources

[And 2022] https://www.workshopshed.com/2019/04/creating-a-3D-model-for-


KiCad/

[ARZ 2001] Paul Arzberger et al, Tabellenbuch Mechatronik, Gehlen Verlag 2001,
ISBN 9783441921202 (in German).

[Dal 2022] Peter Dalmaris: KiCad 6 Fundamentals and Projects, Elektor


International Media 2022, ISBN 9783895764967, p. 242-257; p. 381.

[EAS 2022] https://easgmbh.de/media/downloads/nc-easy-5/

[ELE 2022] Elektor Labs: Fortissimo-100 High End Amplifier, Elektor Magazine
November & December 2022.

[FRE 2023] https://www.freecadweb.org/Fasteners_Workbench

[Hoi 2000] Hans Hoischen: Technisches Zeichnen, Cornelsen Giradet Verlag 2000,
ISBN 9783464480083 (in German).

[Kis 2018] FreeCAD Basics Tutorial, www.tutorialbooks.info, 2018,


ISBN 9781792706318.

[Kis 2019] FreeCAD 0.19 Learn by Doing, [email protected], 2019,


ISBN 9798540073226.

● 303

FreeCAD for Electronics Applications.indd 303 24-08-2023 14:31


FreeCAD for Electronics Applications

Appendix A ● The Rotary Switch

The rotary switch will be designed as a simple part with only one body. Then, the washer
and nut will be added. Create a new file and save it as 'Rotary Switch'. Select the 'Part De-
sign' workbench and create an Std-Part-Container. Rename it to 'Rotary Switch Complete'.

Click the blue 'Create body' tool button. In the tree view, rename the new body object to
'Rotary Switch' (Figure A-1).

Figure A-1

Now create the casing of the switch. In the tree view, expand the body object, and show
the coordinate system by marking it and pressing the SPACE key. Click once 'into the blue'
to deselect the coordinate system, then mark the XY plane. Click on the 'Sketcher' tool
button (Figure A-2).

● 304

FreeCAD for Electronics Applications.indd 304 24-08-2023 14:31


Appendix A ● The Rotary Switch

Figure A-2

Click the 'Create circle' tool button and draw a circle that is centered around the origin.
Point with the little crosshairs, which is sometimes difficult to see, until the origin color
changes to yellow. Only then, the tool is locked onto the origin as the target. Draw the cir-
cle, by pulling its diameter with the mouse, to some arbitrary size. One left click ends the
operation. Then, terminate the drawing command with a right click. If you forget to do this,
the next click starts a new circle.

In the task window on the left, locate the entry '1-circle' in the panel 'Elements'. Right-
click the entry and select 'Diameter Constraint' from the context menu. Set the diameter
of the switch casing to 27.5 mm. The circle turns bright green, and the solver says, 'fully
constrained'. End the sketcher with the 'Close' button (top, Figure A-3).

● 305

FreeCAD for Electronics Applications.indd 305 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-3

In the tree view, mark the new sketch and click the yellow (= additive) 'Pad' tool button.
In the task window, set the length to 12.5 mm, and check the 'Reversed' checkbox: In
this way, you can set the XY plane to be the mounting plane (front panel back side) of the
switch. The casing protrudes therefore to the back (Figure A-4). Close the task window with
the OK button.

● 306

FreeCAD for Electronics Applications.indd 306 24-08-2023 14:31


Appendix A ● The Rotary Switch

Figure A-4

Now create the threaded stub, with which the switch is mounted later on. Just like in the
preceding steps, sketch a circle onto the XY plane, which is centered on the origin. We omit
the thread itself for simplicity.

In the tree view, mark the new sketch and click again the yellow 'Pad' tool button. In the
task window, set the length to 7 mm, and do not check the 'Reversed' checkbox, because
the stub is protruding to the front (Figure A-5).

● 307

FreeCAD for Electronics Applications.indd 307 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-5

The switch has a rotation lock, which is also adding to the footprint. It is a little pin, offset
from the center. For this, you need a circle of diameter 3.1 mm, which is centered on the Y
axis, above the origin: Start a new sketch on the XY plane. When it opens, the 3D geometry
may be obscuring the sketching plane. From the main menu, select 'Sketch | View section'.
If the perspective is distorting the view, from the main menu, select 'View | Orthographic
view'. Then click the 'Create circle' tool button. Target the Y axis with the mouse and place
the circle center. Complete the circle with the second click somewhere close. End the draw-
ing command with a right click. Then, right-click the circle in the 'Elements' panel and select
'Diameter constraint' from the context menu, to set the value of 3.1 mm (Figure A-6). In
order to set the offset value, mark the circle center and the origin. Both points are displayed
in green color when selected. Then, click the 'Constrain vertical distance' tool button. In
the pop-up dialog window, enter 9.1 mm and close it with the 'OK' button. Now the circle
changes color to bright green, the sketch is fully constrained (Figure A-7). Close the sketch
with the 'Close' button (top).

● 308

FreeCAD for Electronics Applications.indd 308 24-08-2023 14:31


Appendix A ● The Rotary Switch

Figure A-6

Figure A-7

● 309

FreeCAD for Electronics Applications.indd 309 24-08-2023 14:31


FreeCAD for Electronics Applications

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
enter 2.5 mm for the pad length (Figure A-8).

Figure A-8

Figure A-9

● 310

FreeCAD for Electronics Applications.indd 310 24-08-2023 14:31


Appendix A ● The Rotary Switch

Also place the sketch for the switch axis on the XY plane. In principle, the axis would thus
collide with the switch casing. However, since there will be one single body for the switch
model, that does not matter. By selecting the XY plane instead of the casings top facet as
the starting point for the axis, it is less prone to vanish in case the facets get re-enumer-
ated. To create the switch axis, sketch a circle onto the XY plane, which is centered on
the origin, with a diameter of 6 mm. Then, using the 'Pad' tool button, create the axis by
extruding the sketch to 22 mm (Figure A-9).

To make them re-enumeration immune, the contacts on the back side can also be created
by sketches on the XY plane. From the main menu, select again 'Sketch | View section' and
'View | Orthographic view', to enable a better view of the sketch plane. To draw the profile,
mark the XY plane again and click the 'Sketcher' tool button. From the sketcher menu,
select 'Centered rectangle' and, after targeting the Y axis as the center, draw the rectangle.
End the drawing command with a right click (Figure A-10).

Figure A-10

Mark a horizontal line of the rectangle and click the 'Constrain horizontal distance' tool
button. In the popup dialog, set the width to 1.5 mm. In a similar fashion, set the value for
the height of the rectangle to 0.7 mm, using the 'Constrain vertical distance' tool button
(Figure A-11).

● 311

FreeCAD for Electronics Applications.indd 311 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-11

Mark the center of the rectangle and the origin and set the distance to 12 mm (all the
measures were picked from the switch with a caliper before). The sketch appears bright
green as fully constrained (Figure A-12). Close the sketch with the 'Close' button (top).

Figure A-12

● 312

FreeCAD for Electronics Applications.indd 312 24-08-2023 14:31


Appendix A ● The Rotary Switch

The contacts protrude by 7 mm from the back of the casing, which itself has a thickness of
12.5 mm. Therefore, mark the sketch and, using the 'Pad' tool button, enter 19.5 mm for
the pad length in the task window. Also, check the 'Reversed' checkbox, as the contacts
protrude to the rear. Close the task window with the 'OK' button.

The contacts get chamfered edges, which ease the insertion into a circuit board. Mark the
two short edges of the contacts in the back (Figure A-13) and select the 'Chamfer' tool
button. In the task window, for the size, enter a value of 0.4 mm. The type 'equal distance'
is already preset. If you enter a value that is too large to be generated, an error message
is thrown. After the value has been reset to a permissible amount, the chamfers will be
displayed again. Close the task window with the 'OK' button.

Figure A-13

● 313

FreeCAD for Electronics Applications.indd 313 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-14

In order to generate all the 12 contacts, in the tree view, mark the last pad and the chamfer
(holding down the CTRL key). Even though the whole switch body is now highlighted in the
3D view, the following command will only have an effect on the marked items in the tree
view.

From the main menu, select 'Part Design | Apply a Pattern | PolarPattern' (Figure A-15). In
the task window, set the number of occurrences to 12. For the axis, 'Normal sketch axis' is
preset (otherwise, select this axis). Close the task window with the 'OK' button (top). Hide
the coordinate system of the switch by marking and pressing the SPACE key.

● 314

FreeCAD for Electronics Applications.indd 314 24-08-2023 14:31


Appendix A ● The Rotary Switch

Figure A-15

Figure A-16

● 315

FreeCAD for Electronics Applications.indd 315 24-08-2023 14:31


FreeCAD for Electronics Applications

Some cosmetics result in a nicer view of the switch. The end of the mounting stub could
get a chamfer. Mark the sharp edge of the stub and click the 'Chamfer' tool button (Figure
A-17). The type 'equal distances' is already the default, just enter a value of 0.25 mm for
the size. Close the task window with the 'OK' button. In the same way, add an equidistant
chamfer of 1 mm size to the front edge of the axis (Figure A-18).

Figure A-17

Figure A-18

● 316

FreeCAD for Electronics Applications.indd 316 24-08-2023 14:31


Appendix A ● The Rotary Switch

In the 3D view, mark the two edges of the switch casing. In reality, the casing as rounded
edges. Click on the 'Fillet' tool button (Figure A-19). In the task window, set the radius to
0.5 mm.

Figure A-19

Because the switch has been built as a single body part, the coloration can only be achieved
by assigning colors to individual facets. These colors are bound to the tip and would vanish
when some other change is applied to the body. But – this rotary switch is simple enough
to appear completed. Therefore, let's limit it to simply painting the facets.

In the tree view, right-click the tip (the last design state) of the switch body and select 'Set
colors' from the context menu. A task window opens (Figure A-20). In the 3D view, mark all
facets of the switch axis (holding the CTRL key). Then, click the button with the color field,
and pick 'black' from the color selection pop-up dialog. In the same way, you could also
assign the color white to the contacts. Instead of clicking the individual facets, you could
click the button 'Box selection' and mark a rectangular selection of objects, which are then
subject to further coloration. Close the task window with the 'OK' button (top).

● 317

FreeCAD for Electronics Applications.indd 317 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-20

The switch is now done. As an addition, fasteners could be useful later, when inserting the
rotary switch into an assembly. In the tree view, collapse the 'Rotary Switch' body branch.
For the fixture, a washer and a nut are needed. Let's start with the washer:

Click the blue 'Create body' tool button to start the washer. Rename the new body to 'Rota-
ry Switch Washer'. If it is not residing in the Std-Part-Container 'Rotary Switch Complete',
drag-and-drop it into there. Check whether it is activated (its title is shown in bold letters).
If not, double-click it, so all of our following operations are applied there.

In the tree view, expand the 'Rotary Switch Washer' body and show the coordinate system
by marking it and pressing the SPACE key. Click once 'into the blue' to deselect the coor-
dinate system, and then mark its XY plane. Click on the 'Sketcher' tool button to start the
sketch onto the selected plane right away.

Usually, when a sketch is started anew like that, the existing 3D geometry is not shown. If
it shows (because you opened the sketch, e.g., for the second time), the 3D geometry can
obscure the sketching plane. In these cases, it is useful to select 'Sketch | View section'
from the main menu.

For the washer, sketch two circles, which are both centered to the origin. Right-click each
of the circles in the 'Elements' panel and select 'Diameter constraint'. Set the diameter of
the inner circle to 10.1 mm, and the diameter of the outer circle to 15 mm (Figure A-21).
Close the sketch with the 'Close' button (top).

● 318

FreeCAD for Electronics Applications.indd 318 24-08-2023 14:31


Appendix A ● The Rotary Switch

Figure A-21

In the tree view, mark the new sketch, and click the 'Pad' tool button. In the task window,
set the length of the pad to 0.5 mm. Hide the coordinate system of the washer with the
SPACE key.

In the tree view, right-click the 'Rotary Switch Washer' body and select 'Appearance...' from
the context menu. In the task window, select 'Chrome' from the 'Material' list, and click the
'Close' button (Figure A-22).

● 319

FreeCAD for Electronics Applications.indd 319 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-22

In the tree view, click the 'Rotary Switch Washer' body. In the property list below, click the
field 'Placement', and then the button, which appears to the right (Figure A-23).

Figure A-23

● 320

FreeCAD for Electronics Applications.indd 320 24-08-2023 14:31


Appendix A ● The Rotary Switch

In the task window, enter an offset of 2 mm for the washer, a typical front panel thickness
(or the thickness value of your favorite aluminum sheet in the shed). Close the task window
with the 'OK' button (Figure A-24).

Figure A-24

For the associative positioning of the nut, you need a 'SubShapeBinder'. This reference
must be visible to the nut, so you need to relocate it by a drag-and-drop into the parent
Std-Part-Container once it has been created.

If the 'Rotary Switch Washer' object is still activated (title appears in bold letters), then
right-click it and select 'Toggle active body' from the context menu, in order to deactivate it.

In the 3D view, mark the top inner edge of the washer (to which the nut should be bound
to). Then click the green 'Create a sub object(s) shape binder' tool button. (Figure A-25).

● 321

FreeCAD for Electronics Applications.indd 321 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-25

Drag the green SubShapeBinder into the Std-Part-Container 'Rotary Switch Complete' (Fig-
ure A-26) and rename it to 'Position Nut'.

Figure A-26

● 322

FreeCAD for Electronics Applications.indd 322 24-08-2023 14:31


Appendix A ● The Rotary Switch

If the SubShapeBinder is still marked in the 3D view, click the Std-Part-Container 'Rotary
Switch Complete', to remove the marking. If you miss removing the marking, the binder
will be used as a base feature in the nut. The 'Undo' button brings you back if this happens.
For the nut, create a new body by clicking the blue 'Create body' tool button. Rename the
new body to 'Rotary Switch Nut'. In the tree view, expand the new body object, and display
its coordinate system by marking and pressing the SPACE key.

Select the XY plane (remember — deselect the coordinate system first, then select the XY
plane), then, start the sketcher.

Click on the 'Create regular polygon' tool button to create the hexagonal outline of the nut.
Stop the drawing command with a right click (Figure A-27). The first click of the command
defines the center point (lock it to the origin), and the second click determines the size and
orientation of the hexagon (if you lock it to an axis, there are less degrees of freedom to
constrain later). End the drawing command with a right click.

Figure A-27

On the sketch, mark two opposite points which define the key width of the nut. Then click
the 'Constrain horizontal distance' tool button and enter a value of 13 mm for the key width
(Figure A-28).

● 323

FreeCAD for Electronics Applications.indd 323 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure A-28

Draw a circle centered on the origin and constrain its diameter to 10 mm (Figure A-29).
Close the sketch (button top of the task window).

Figure A-29

● 324

FreeCAD for Electronics Applications.indd 324 24-08-2023 14:31


Appendix A ● The Rotary Switch

In the tree view, mark the new sketch, click the 'Pad' tool button and extrude the sketch to
a nut with a thickness of 2.4 mm. Right-click the body of the nut and select 'Appearance'
from the context menu. In the task window, set the 'Material' entry to 'Chrome'. Then,
close the task window.

The new nut is only placed into the Std-Part-Container. It is possible to bring it to the cor-
rect position by editing the 'Placement' parameter fields. But then, for each change of the
front panel thickness, washer and nut would have to be relocated one-by-one. It is better
to define a relation between nut and washer, in order to benefit from some degree of as-
sociativity.

Hide the coordinate system of the nut.

In the tree view, mark the body 'Rotary Switch Nut', as you want to modify its relations.

Switch to the 'Part' workbench. From the main menu, select 'Part | Attachment'. When the
task window opens, the collector for reference 1 is already activated. In the Combo View,
switch to the 'Model' tab and click the SubShapeBinder 'Position Nut'. Then, return to the
'Tasks tab'. In the collector, there is now the 'Binder' object.

As the attachment mode, select 'XY on plane' from the list (Figure A-30).

Figure A-30

● 325

FreeCAD for Electronics Applications.indd 325 24-08-2023 14:31


FreeCAD for Electronics Applications

Close the task window with the 'OK' button. The nut is now appearing at the correct posi-
tion.

You could test the associativity by changing the placement of the washer. While the washer
responds immediately to variations of its placement parameters, the nut will keep track
only after a recalculation has been triggered with the F5 key.

● 326

FreeCAD for Electronics Applications.indd 326 24-08-2023 14:31


Appendix B ● The Potentiometer

Appendix B ● The Potentiometer

Close all open documents. Start a new file and save it as 'Potentiometer'.

Switch to the 'Part Design' workbench and start a new Std-Part-Container by clicking the
yellow 'Create part' tool button. Rename it to 'Potentiometer Complete'.

Click the blue 'Create body' tool button to start a new body object. In the tree view, rename
that to 'Potentiometer Casing'.

Click on the 'Sketcher' tool button to start a new sketch. Because you have not marked any
plane before doing so, a task window for the selection will be shown. Mark the XY plane on
the list and close the task window with the OK button.

For the casing, click the 'Create circle' tool button and draw a circle that is centered on the
origin. Right-click the circle in the 'Elements' list (scroll down the Combo View to see it)
and select 'Diameter Constraint'. Set the diameter to 20.2 mm. Close the sketch with the
'Close' button (top).

In the tree view, mark the new sketch and click the 'Pad' tool button.

In the task window, set the length to 8.8 mm and check the 'Reversed' checkbox (the
potentiometer casing, like one of the rotary switches in Appendix A, protrudes to the back
(Figure B-1). Close the task window with the OK button.

Figure B-1

● 327

FreeCAD for Electronics Applications.indd 327 24-08-2023 14:31


FreeCAD for Electronics Applications

For the threaded stub of the potentiometer casing, sketch another circle onto the XY plane,
with a diameter of 10 mm. In the tree view, mark the new sketch and click the 'Pad' tool
button. Set the length to 7.5 mm. This time, leave the 'Reversed' checkbox unchecked (the
mounting stub points to the front, Figure B-2). The thread, you omit for simplicity.

Figure B-2

To create the axis of the potentiometer, sketch a circle centered around the origin, this time
with a diameter of 6 mm. The axis should protrude 10 mm from the potentiometer casing,
therefore set the pad length to 17.5 mm (Figure B-3).

Figure B-3

● 328

FreeCAD for Electronics Applications.indd 328 24-08-2023 14:31


Appendix B ● The Potentiometer

Mark the top edge of the axis and click the 'Chamfer' tool button (Figure B-4). In the task
window, leave the type at 'equal distance' and set the size to 0.5 mm. Close the task win-
dow with the OK button.

Figure B-4

The potentiometer usually has a plate that carries the contacts (and also the resistive
element inside). For the sketch of this plate, you create a datum plane. To specify the
orientation of the datum plane, in the tree view, show the coordinate system of the body
'Potentiometer Casing' (mark, and press the SPACE key). Then select the XY plane (if the
whole coordinate system is still shown green, click into the blue to deselect it, and then,
mark only the XY plane).

With the XY plane marked, click the 'Create a datum plane' tool button. The task window
opens. Because of the prior selection of the XY plane, the datum plane is already attached
to the XY plane, with attachment mode 'Plane face'. Set the attachment offset for Z to
–3.2 mm (Figure B-5) and close the task window with the OK button.

● 329

FreeCAD for Electronics Applications.indd 329 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure B-5

Rename the new datum plane to 'Contact Plane'. With the datum plane marked, click the
'Sketcher' tool button to start the drawing for the contact plate. When the sketcher is start-
ed for the first time, the already existing 3D geometry is not shown. Close the sketch and
open it again by double-clicking it in the tree view.

Click the 'Create a centered rectangle' tool button and draw a rectangle that is centered on
the Y axis (first click), and the top coinciding with the X axis (second click). End the draw-
ing command with a right click. Mark a horizontal side of the rectangle, click the 'Constrain
horizontal distance' tool button and set the width of the rectangle to 17.7 mm. In the same
fashion, set the height to 14.4 mm (Figure B-6). Close the sketch with the 'Close' button
(top).

Figure B-6

● 330

FreeCAD for Electronics Applications.indd 330 24-08-2023 14:31


Appendix B ● The Potentiometer

Pad the new sketch with a length of 2 mm (Figure B-7). In the tree view, hide the datum
plane and the coordinate system (mark, and press SPACE key).

Figure B-7

Now, the contacts will be created. In order to sketch the datum plane 'Contact Plane', mark
the hidden datum plane in the tree view (an alternate way to clicking on it in the 3D view, if
shown there). Then, click the 'Sketcher' tool button. To display the already-present 3D ge-
ometry, close the sketch right away, and reopen it by double-clicking on it in the tree view.

From the main menu, select 'Sketch | View section' and 'View | Orthographic view', for a
plain and unobstructed view of the sketching plane.

To reference the new sketch to already present details, click the 'External geometry' tool
button (Figure B-8) and mark the lower edge of the contact carrier plate. The edge is shown
as a violet construction line, to which drawing elements can now be locked.

● 331

FreeCAD for Electronics Applications.indd 331 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure B-8

Click the 'Create a centered rectangle' tool button and draw the rectangle with the midpoint
locked to the Y axis. Set the height of the rectangle to 10 mm, and the width to 1.2 mm.
Then, mark the center point of the rectangle, the violet construction line, and click the
'Constrain point on object' tool button (Figure B-9). Close the sketch with the 'Close' button
(top).

Figure B-9

● 332

FreeCAD for Electronics Applications.indd 332 24-08-2023 14:31


Appendix B ● The Potentiometer

In the tree view, mark the new sketch. Clicking the 'Pad' tool button, and extruding it to-
wards the back (with 'Reversed' checkbox checked), to a thickness of 0.5 mm.

From the main menu, select: Part Design | Apply a pattern | LinearPattern.

In the task window, the directions should read 'Horizontal sketch axis'. Set the length to
5 mm and leave the number of occurrences at 2 (Figure B-10). Close the task window with
the 'OK' button.

Figure B-10

In the tree view, again mark the design state with the center contact (the last one before
'LinearPattern'). Again, select 'Part Design | Apply a pattern | LinearPattern' from the main
menu. In the task window, all the settings are identical to those of the preceding step, ex-
cept that the 'Reverse direction' checkbox must now be checked (Figure B-11) to add the
opposite contact. Close the task window with the OK button.

● 333

FreeCAD for Electronics Applications.indd 333 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure B-11

Like with the rotary switch, as cosmetic features, add a fillet of 1 mm radius to the bottom
edge of the potentiometer casing, and a small chamfer of 0.25 mm size to the top edge of
the mounting stub.

The potentiometer looks finalized now. Except for the length of the axis, no changes are
expected for the part. Therefore, it seems permissible to color the facets of the single body
part. To get a nicer reflectivity for the whole part, you could right-click the body 'Potenti-
ometer Casing' and select 'Appearance' from the context menu. In the task window, set the
'Material' to 'Shiny Plastic', but set the color to a bright gray (the default color for plastic is
black, which renders shapes difficult to distinguish).

After that, right-click the tip of the body (the last design state, which is displayed non-
grayed). Select 'Set colors' from the context menu. Select all facets of the axis, either by
clicking them one-by-one (with the CTRL key down), or by a box selection. Set the axis
color to black. Then, select all facets of the contact carrier plate, and also set their color
to black. With a box selection, select all contacts and set their color to a very bright gray.
(Figure B-12).

● 334

FreeCAD for Electronics Applications.indd 334 24-08-2023 14:31


Appendix B ● The Potentiometer

Figure B-12

Now, you add the washer as a separate body object. Click on the blue 'Create body' tool
button. If the body is not listed inside the 'Potentiometer Complete' Std-Part-Container,
drag-and-drop it there. Rename the new body to 'Potentiometer Washer'. If it is not acti-
vated (the title is not shown in bold letters), activate it with a double click.

Click on the 'Sketcher' tool button and select the XY plane from the list as the sketching
plane. Like with the rotary switch, draw the contour of the washer with 2 circles, which
are both centered around the origin. The inner circle has a diameter of 10.1 mm, set the
diameter of the outer one to 16 mm (Figure B-13). Close the sketch.

Figure B-13

● 335

FreeCAD for Electronics Applications.indd 335 24-08-2023 14:31


FreeCAD for Electronics Applications

In the tree view, mark the new sketch and click the 'Pad' tool button. For the thickness of
the pad, enter 0.5 mm.

In the tree view, mark the washer body and edit the placement parameters (click into the
'Placement' property line, click the button to open the task window). Set the Z offset to
a typical front panel thickness like 2 mm (Figure B-14).

Figure B-14

Add the nut by clicking the blue 'Create body' tool button. Rename the new body to 'Po-
tentiometer Nut'.

By the preceding step, the body 'Potentiometer Nut' is still activated. If not, double-click it
to activate it (title is shown in bold letters). Click on the 'Sketcher' tool button and select
the XY plane as the sketching plane.

Like with the rotary switch, draw a hexagon centered on the origin, with one corner located
on the Y axis. Set the distance (the key width of the nut) between the sides to 14 mm, by
selecting two opposite points and clicking the 'Constrain horizontal distance' tool button.

For the inside of the nut, draw a circle, which is centered on the origin, and set its diameter
to 10.1 mm (Figure B-15). Close the sketch with the 'Close' button (top).

● 336

FreeCAD for Electronics Applications.indd 336 24-08-2023 14:31


Appendix B ● The Potentiometer

Figure B-15

In the tree view, mark the new sketch, and create a pad with 2 mm thickness.

The nut position should be depending on the washer's location. For the attachment relation
between the two bodies, a SubShapeBinder is needed.

In the tree view, hide the 'Potentiometer Nut' body. Also, deactivate it by right-clicking it,
and selecting 'Toggle active body' from the context menu. The title of the body object is
then shown in normal letters (not bold). In the 3D view, mark the inner edge of the washer,
then click the 'Create a sub object(s) shape binder' tool button (Figure B-16).

Figure B-16

● 337

FreeCAD for Electronics Applications.indd 337 24-08-2023 14:31


FreeCAD for Electronics Applications

Drag-and-drop the green SubShapeBinder object into the Std-Part-Container 'Potentiome-


ter Complete' and rename it to 'Position Nut' (Figure B-17).

Figure B-17

In the tree view, mark the body 'Potentiometer Nut', and switch to the 'Part' workbench.
From the main menu, select 'Part | Attachment…'. The collector for reference 1 should be
active by default. Otherwise, click the button 'Reference1' until it reads 'Selecting…', in the
edit field next to the button. In the Combo View, switch to the 'Model' tab and select the
new SubShapeBinder. Then, return to the 'Tasks' tab.

For the attachment mode, select 'XY on plane' from the list (Figure B-18).

● 338

FreeCAD for Electronics Applications.indd 338 24-08-2023 14:31


Appendix B ● The Potentiometer

Figure B-18

In the tree view, mark the body objects of nut and washer. Right-click the selection and se-
lect 'Appearance' from the context menu. In the task window, set the material to 'Chrome'.

In the tree view, show the nut, and hide the SubShapeBinder 'Position Nut' (Figure B-19).

Figure B-19

Save your work.

● 339

FreeCAD for Electronics Applications.indd 339 24-08-2023 14:31


FreeCAD for Electronics Applications

Appendix C ● The Banana Jack

It is not evident from the connector proper how the reference to a banana came about. The
name may be due to the contact spring in early versions of the plugs, where the body of
the contact pin had a milled groove, in which – indeed - a banana-shaped spring inserted,
with the back of the 'banana' pointing outward, protruding from the slot. The mating socket
is also called 'wander socket' by veterans in electronics.

Let's generate the Banana Jack as a compound part with several items embedded in its
Std-Part-Container.

First, follow the usual procedure: Create a new file and save it as 'Banana Jack'.

Switch to the Part Design' workbench and start a new Std-Part-Container. Rename that to
'Banana Jack Complete'.

Create a new body object and rename that to 'Banana Jack Cap'. Show the coordinate
system of the new body object by marking it in the 3D view and pressing the SPACE key
(Figure C-1).

Figure C-1

Click the 'Sketcher' tool button and select the XY plane from the list, as the sketching plane.
Alternatively, in the 3D view, mark the XY plane and then start the sketcher.

Click on the 'Create circle' tool button and draw two circles centered around the origin. End
the drawing command with a right-click.

● 340

FreeCAD for Electronics Applications.indd 340 24-08-2023 14:31


Appendix C ● The Banana Jack

Scroll down to the 'Elements' panel. When doing that, beware of a pitfall: if you scroll with
the mouse wheel, and the mouse happens to hover over the 'Mode' Combo Box, quite
possibly, instead of scrolling the view downwards, the mode selection is changed (e.g.,
to 'External'). Then, there are no entries in the list. Make sure that 'Mode' is set to 'All' in
order to list all the elements of the sketch. Right-click the inner circle and select 'Diameter
Constraint' from the context menu. Enter 4.6 mm for the diameter value (Figure C-2).

Figure C-2

In the same way, constrain the diameter of the outer circle to 9.9 mm (Figure C-3). Close
the sketch with the 'Close' button (top).

● 341

FreeCAD for Electronics Applications.indd 341 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-3

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
enter 5 mm for the length. Close the task with the OK button (Figure C-4).

Figure C-4

● 342

FreeCAD for Electronics Applications.indd 342 24-08-2023 14:31


Appendix C ● The Banana Jack

In the 3D view, select the XY plane again and click the 'Sketcher' tool button. If the cap
already created is not shown, close and reopen the sketch. Now you can create the part of
the cap which protrudes through the front panel to the rear. To have a less distorted view,
select 'Sketch | Show section' and 'View | Orthographic view' from the main menu.

To create a reference to the hole in the cap, click the 'External geometry' tool button, and
then mark the inner edge of the cap. The edge is displayed in violet now (Figure C-5) and is
added as a construction line to the 'Elements' list. Again, draw two circles that are centered
around the origin.

Figure C-5

On the sketch, mark one of the two new circles and the violet reference. To match the di-
ameter of the circles, click the 'Constrain equal' tool button (Figure C-6).

● 343

FreeCAD for Electronics Applications.indd 343 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-6

In the 'Elements' list, find the outer circle (by clicking entries, the corresponding sketch
element is highlighted in green). Right-click the outer circle and select 'Diameter constraint'
from the context menu. Enter a value of 7.85 mm for the stub (Figure C-7).

Figure C-7

● 344

FreeCAD for Electronics Applications.indd 344 24-08-2023 14:31


Appendix C ● The Banana Jack

In the tree view, mark the new sketch and click the 'Pad' tool button. Set the length of the
extrusion to 4 mm and check the 'Reversed' checkbox, as the shaft protrudes to the back
(Figure C-8). Close the task window with the 'OK' button.

Figure C-8

Because no further changes are expected for the banana jack cap, the front edges could be
rounded as cosmetic features.

In the 3D view, mark the two front edges of the cap (CTRL key down) and click the 'Fillet'
tool button (Figure C-9). In the task window, set the radius parameter to 0.25 mm. Now,
the cap starts to look realistic (Figure C-10).

● 345

FreeCAD for Electronics Applications.indd 345 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-9

Figure C-10

● 346

FreeCAD for Electronics Applications.indd 346 24-08-2023 14:31


Appendix C ● The Banana Jack

We made the selection before the tool 'Fillet' was called, which already added both features
to the list in the task window. If you would like to add more details, it would be necessary
to click the 'Add' button prior to each new selection from the 3D view.

The realistic impression can be further enhanced by appearance attributes: Right-click the
'Banana Jack Cap' body and select 'Appearance…' from the context menu. For the material,
select 'Shiny Plastic', and for the color, a dim red. Close the task window with the 'Close'
button in the bottom. Hide the body's coordinate system (Figure C-11).

Figure C-11

This appearance is not cast in stone. Later, the color of each banana jack can be individu-
ally changed in an assembly. This is especially important for these jacks, which come in a
multitude of colors, and usually carry a special meaning.

Now, the contact of the banana jack is created. Start a new body object by clicking the blue
'Create body' tool button. Rename it to 'Banana Jack Contact'. If it has been created outside
of the 'Banana Jack Complete' Std-Part-Container, just drag and drop it in there.

In the 3D view, display the coordinate system of the new body (mark it in the tree view
and press the SPACE key). The contact has a zone where the diameter reduces towards

● 347

FreeCAD for Electronics Applications.indd 347 24-08-2023 14:31


FreeCAD for Electronics Applications

a soldering stud. The reference to the soldering stud can be created with a datum plane.
In order to define the datum plane, in the 3D view, mark the XY plane of the coordinate
system. Then, click the 'Create a datum plane' tool button.

In the task window, set the distance between the planes with the 'Attachment Offset' Z
parameter. Set it to –14.5 mm (Figure C-12).

Figure C-12

Draw the outline of the contact: In the 3D view, mark the XY plane and start the sketcher.
Draw a circle which is centered about the origin and set its diameter to 5.9 mm. Close the
sketch.

In the tree view, mark the new sketch, and click the 'Pad' tool button. In the task window,
select the type 'Two dimensions'. For the length, enter a value of 4.5 (protruding to the
front), for the 2nd length, enter 14.5 mm (Figure C-13). Close the task window with the
'OK' button.

● 348

FreeCAD for Electronics Applications.indd 348 24-08-2023 14:31


Appendix C ● The Banana Jack

Figure C-13

Rename the datum plane to 'Position Soldering Pad'. With that plane marked in the tree
view, start the sketcher. For the soldering pad, draw a circle centered around the origin,
and set its diameter to 3.2 mm. Close the sketch with the 'Close' button (top).

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
set the length to 4 mm and check the 'Reversed' checkbox (Figure C-14).

● 349

FreeCAD for Electronics Applications.indd 349 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-14

In order to create the hole for the plug, in the 3D view, mark the XY plane again and start
the sketcher. Draw a circle centered around the origin again and constrain its diameter to
4 mm (the diameter which accepts the plug).

In the tree view, mark the new sketch and click the 'Pocket' tool button. In the task window,
select for the type 'Two dimensions'. Set the length to 5 mm (pointing to the front) and for
the 2nd length 13 mm (pointing backwards). Check the 'Reversed' checkbox. Close the task
window with the OK button (Figure C-15).

● 350

FreeCAD for Electronics Applications.indd 350 24-08-2023 14:31


Appendix C ● The Banana Jack

Figure C-15

The solder stud has a slot where a wire can be placed. To sketch that, in the 3D view, mark
the YZ plane and start the sketcher. In order to display the already-present 3D geometry,
close the sketch and reopen it by double-clicking it in the tree view. In order to have a less
distorted view, select 'Sketch | Show section' and 'View | Orthographic view' from the main
menu.

Sketch a rectangle that is centered on the vertical axis, and constrain dimensions and dis-
tance as shown in Figure C-16. Close the sketch.

● 351

FreeCAD for Electronics Applications.indd 351 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-16

In the 3D view, mark the new sketch and click the 'Pocket' tool button. For the type, select
'Through all', and check the 'Symmetric to plane' checkbox (Figure C-17).

Figure C-17

● 352

FreeCAD for Electronics Applications.indd 352 24-08-2023 14:31


Appendix C ● The Banana Jack

Create the tapered section between the soldering stud and contact: Mark the larger rear
edge of the contact and click the 'Chamfer' tool button. For the size, enter 1.2 mm (Figure
C-18).

Figure C-18

In the tree view, hide the datum plane and the coordinate system. Right-click the 'Banana
Jack Contact' body and select 'Appearance…' from the context menu. Set the material to
'Chrome' and close the task window (Figure C-19).

● 353

FreeCAD for Electronics Applications.indd 353 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-19

These banana jacks have an insulating washer for the rear side, which can accommodate
the thinner part of the cap. Start the creation of the washer by clicking on the 'Create body'
tool button. Rename the new body to 'Banana Jack Washer'.

Display the coordinate system of the new body (mark in tree view and press SPACE key).

In the 3D view, mark the XY plane (only that appears green then!) and start the sketcher.

For the outline of the washer, draw two circles that are centered on the origin. Constrain the
diameter of the two circles to 6.4 mm and 10.4 mm. Close the sketcher.

In the tree view, mark the new sketch and click the 'Pad' tool button. Set the length of the
pad to 4.4 mm and check the 'Reversed' checkbox, to extrude it towards the back (Figure
C-20).

● 354

FreeCAD for Electronics Applications.indd 354 24-08-2023 14:31


Appendix C ● The Banana Jack

Figure C-20

For the washer, the inner pocket which houses the thinner part of the cap is still missing. In
order to create that pocket, in the 3D view, mark the XY plane again and start the sketcher.

For the pocket, draw a circle centered around the origin, and constrain the diameter to
8 mm.

In the tree view, mark the new sketch, and click the 'Pocket' tool button. In the task win-
dow, set the length to 3.4 mm (Figure C-21).

● 355

FreeCAD for Electronics Applications.indd 355 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-21

Figure C-22

Right-click the body of the washer and select 'Appearance…' from the context menu. For the
material, select 'Shiny Plastic'. Set the color to the one of the cap.

● 356

FreeCAD for Electronics Applications.indd 356 24-08-2023 14:31


Appendix C ● The Banana Jack

In the tree view, mark the washer body. In the property list, click the 'Placement' edit field,
and then on the button. In the task window, move the washer by a typical front panel
thickness to the rear, e.g., by 2 mm (Figure C-22). This setting can easily be matched to
different panels later on. Close the task window with the OK button.

Next, the nut is added. Create a new body by clicking on the blue 'Create body' tool button.
Rename it to 'Banana Jack Nut'.

Hide all the body objects, except for the nut, and display the coordinate system of the nut
body.

In the 3D view, mark the XY plane and start the sketcher.

Draw the outline of the nut: Click the 'Create regular polygon' tool button (the hexagon is
selected by default). With the first click, select the origin. Lock the second click the Y axis
at some distance, this will make it easier to define the dimension (Figure C-23).

Figure C-23

Mark two points opposite to each other, which are not located on the Y axis. Constrain the
horizontal distance to 8 mm.

Draw a circle centered around the origin and constrain the diameter to 5.9 mm (Figure
C-24). Close the sketch.

● 357

FreeCAD for Electronics Applications.indd 357 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-24

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
set the length to 2 mm and check the 'Reversed' checkbox (Figure C-25).

Figure C-25

● 358

FreeCAD for Electronics Applications.indd 358 24-08-2023 14:31


Appendix C ● The Banana Jack

The nut should always be located directly behind the washer. This can be automated, when
an attachment relation to the washer is defined. To communicate this across the scope of
the individual bodies, a SubShapeBinder is needed.

In the tree view, deactivate all activated objects except the Std-Part-Container 'Banana
Jack Complete (the destination of the new SubShapeBinder). You can deactivate any ac-
tivated body object by right-clicking it and selecting 'Toggle active body' from the context
menu. Eventually, you need to select this item twice.

Hide the coordinate system of the nut body, then hide the nut body itself. Display the 'Ba-
nana Jack Washer' object (Click on it in the tree view and press the SPACE key).

In the 3D view, click the inner rear edge of the washer, and then on the green 'Create a sub
object(s) shape binder' tool button (Figure C-26).

Figure C-26

In the tree view, rename the SubShapeBinder to 'Position Nut'. Drag-and-drop it into the
Std-Part-Container 'Banana Jack Complete' (Figure C-27). In this way, things stay together
when inserting the Banana Jack Container later. In the tree view, display the body of the
nut (click and SPACE key).

● 359

FreeCAD for Electronics Applications.indd 359 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure C-27

Figure C-28

● 360

FreeCAD for Electronics Applications.indd 360 24-08-2023 14:31


Appendix C ● The Banana Jack

With the nut body marked, switch to the 'Part' workbench and select 'Part | Attachment'
from the main menu.

In the task window, the collector button for 'Reference1' should read 'Selecting…'. Oth-
erwise, click that button, until this is the case, and then into the corresponding edit field.

Switch to the 'Model' tab and, in the tree view, click the SubShapeBinder.

Return to the 'Tasks' tab. As the attachment mode, select 'XY on plane' from the list (Figure
C-28).

In the tree view, hide the SubShapeBinder and display all body objects.

Test the associativity: In the tree view, click the 'Banana Jack Washer' body, in the property
list, click the 'Placement' field, and there, click the button to display the task window.

In the task window, click into the Z translation field and change the washer position with
the mouse wheel. The washer moves instantaneously. To update the nut position, click
either the 'Apply' or the 'OK' button. The latter also closes the task window.

Revert the washer to a Z translation of 2 mm (Figure C-29). Save your work!

Figure C-29

● 361

FreeCAD for Electronics Applications.indd 361 24-08-2023 14:31


FreeCAD for Electronics Applications

Appendix D ● The Pilot Lamp

Again, run the standard procedure: Start a new file and save it as 'Pilot Lamp'. Switch to
the 'Part Design' workbench and create a new Std-Part-Container. Rename it to 'Pilot Light
Complete'. Then, start a new body object and rename that to 'Pilot Lamp Casing'.

We plan the casing to be oriented and positioned like the potentiometer and the rotary
switch — with the XY plane coinciding with the front panel surface. The pilot lamp casing
has several features, for which you can generate the reference planes right away. These
features are:

• The top of the opaque casing protruding from the front panel (Z = 5 mm).

• The length of the large fine threaded part, where the fastener is later on
attached (Z= –14.9 mm).

• The plane where the contact terminals reside on (Z = –25 mm).

• The end face of the insulating barrier between the two contacts (Z = –33 mm).

In the tree view, display the coordinate system of the new body object with the SPACE key.
In the 3D view, select the XY plane (and only that — click the blue to deselect the whole
coordinate system, then the XY plane).

Then, click the 'Create a datum plane' tool button. With the XY plane preset, the task win-
dow for the datum plane opens already with the datum plane attached to the XY plane.
Set the Z parameter to the value of 5 mm for the first feature listed above. Close the task
window with the OK button. In the tree view, rename the new datum plane to 'Casing Top
Face'.

In similar fashion, create and rename the other datum planes for the features listed above.
It may look a bit tedious to rename all the planes with self-explaining names. Later, this can
be a good time saver. The achieved state of the project is depicted in Figure D-1.

● 362

FreeCAD for Electronics Applications.indd 362 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-1

With these preparations done, the casing can be modeled. Start with the conical part that
protrudes from the front panel. For this, a 'Loft' object is needed, which is defined by two
sketches defining the cross-sections, at the start and at the end of the profile. With a ca-
liper, the diameter of the conical part can be found to be 20.7 mm at the front panel and
18.5 mm where the casing has the top face.

To begin the loft, sketch the first circle: Mark the XY plane and click the 'Sketcher' tool but-
ton. Draw a circle that is centered around the origin and constrain its diameter to 20.7 mm.
Close the sketcher.

In the same way, sketch a circle centered around the origin onto the 'Casing Top Face' da-
tum plane. Constrain the diameter of this circle to 18.5 mm.

In the tree view, mark the two sketches, and click the 'Loft' tool button (Figure D-2).

● 363

FreeCAD for Electronics Applications.indd 363 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-2

In the task window, check the 'Closed' checkbox. Close the task window with the OK button
(Figure D-3). In the tree view, rename the 'AdditiveLoft' feature to 'Casing Collar'.

Figure D-3

● 364

FreeCAD for Electronics Applications.indd 364 24-08-2023 14:31


Appendix D ● The Pilot Lamp

For the threaded part of the casing, draw another circle on the XY plane, which is centered
around the origin. The thread has an outer diameter of 15.8 mm (with a little extra toler-
ance added, to have a lose fit later). If the sketching plane is obscured by already present
3D geometry, select 'Sketch | View section' from the main menu. Close the sketch after
constraining the circle diameter.

In the tree view, mark the new sketch and click the 'Pad' tool button (Figure D-4).

Figure D-4

In the task window, select the type 'Up to face', which activates the face collector below
(the button 'Select face' appears dark gray). If the collector is not activated, click again on
the button 'Select Face', until it is dark gray. Then click the 'Casing Thread' datum plane
(Figure D-5). You can do that either in the 3D view, or by switching to the 'Model' tab and
clicking on the datum plane tree view item itself (and then returning to the 'Tasks' tab).

● 365

FreeCAD for Electronics Applications.indd 365 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-5

The thread of the casing is followed by a cylindrical part of the casing, which has a diameter
of 14 mm. As described in the preceding steps, draw a circle with diameter 14 mm on the
'Casing Thread' datum plane, and extrude it with the 'Pad' command to the 'Casing Contact
Plane' datum plane.

The isolating barrier between the contacts is formed as a section of a conical protrusion. As
for the front collar of the casing, for the definition of the conical 'Loft' object, two cross-sec-
tions are needed. To draw the first circle, in the tree view, mark the 'Casing Contact Plane'
and start the sketcher. Draw a circle that is centered around the origin and constrain its
diameter to 14 mm (which equals the diameter of the cylindrical part).

In a similar fashion, draw the circle for the rear face of the casing, and set the diameter to
12.2 mm.

In the tree view, mark the two new sketches and click the 'Loft' tool button. In the task
window, check the 'Closed' checkbox and close the task window with the OK button.

● 366

FreeCAD for Electronics Applications.indd 366 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-6

The space for the contacts is defined on the 'Casing Contact Plane' datum plane. Mark it in
the tree view and start the sketcher. When the sketch is started like that, the present 3D
geometry is not displayed. To display it, close and reopen the sketch. Select the 'Centered
rectangle' drawing tool and draw a rectangle that is centered on the X axis (Figure D-7).

Figure D-7

● 367

FreeCAD for Electronics Applications.indd 367 24-08-2023 14:31


FreeCAD for Electronics Applications

Now, the dimensions are needed for the rectangle. Mark the Y axis and one corner of the
rectangle, which is next to it, and constrain the horizontal distance to 1.25 mm (Figure D-8,
steps 1,2).

Figure D-8

Then, click a vertical line of the rectangle and constrain the height to a value large enough
to cut the whole casing (e.g., 15 mm, Figure D-8, steps 3,4).

Next, select a horizontal line of the rectangle and constrain the horizontal distance to
6 mm, which is wide enough to cut the whole casing (Figure D-8, steps 5, 6).

In the tree view, mark the new sketch and click the 'Pocket' tool button (Figure D-9). In the
task window, select the type 'Up to face' and click the 'Casing Barrier' datum plane, either
in the 3D view or in the tree view (Figure D-10). Close the task window with the OK button.

● 368

FreeCAD for Electronics Applications.indd 368 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-9

Figure D-10

● 369

FreeCAD for Electronics Applications.indd 369 24-08-2023 14:31


FreeCAD for Electronics Applications

In the tree view, mark the new design state 'Pocket'. From the main menu, select 'Part
Design | Apply a pattern | Mirrored'.

By this selection, in the task window, the object to be mirrored is already listed. For the
mirror plane, select the 'Base YZ' plane, and close the task window with the OK button
(Figure D-11).

Figure D-11

A small, but important detail is yet missing: The rotation lock at the rear side of the front
collar, which must be considered for the footprint of the pilot light. The rotation lock is mod-
eled by a sketch on the XY plane, as a rectangle that is centered on the Y axis. The sketch
is depicted in Figure D-12.

Mark a horizontal line of the rectangle and constrain the width to 3 mm (Figure D-12, step
2).

Mark the bottom corner of the rectangle and the origin. Constrain the vertical distance to
6 mm (Figure D-12, step 3).

Mark the top corner of the rectangle and constrain the vertical distance to 9 mm. The
sketch is then displayed as fully constrained (Figure D-12). Close the sketcher and hide all
datum planes.

● 370

FreeCAD for Electronics Applications.indd 370 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-12

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
set the length to 1 mm and check the 'Reversed' checkbox (Figure D-13). Close the task
window with the OK button.

Figure D-13

● 371

FreeCAD for Electronics Applications.indd 371 24-08-2023 14:31


FreeCAD for Electronics Applications

In the tree view, hide all datum planes and the coordinate system. Right-click the body of
the casing and select 'Appearance…' from the context menu. For the material, select 'Shiny
Plastic'. This auto-selects black as the color. Sometimes, a dark gray color can give more
guidance to the eye.

For the cap of the pilot light, create a new body object. If necessary, drag-and-drop it into
the Std-Part-Container 'Pilot Light Complete'. Rename the new body to 'Pilot Light Cap'
(Figure D-14).

Figure D-14

First, adjust the position of the placement for the new cap body: In the tree view, mark the
body of the cap. In the property list, expand the 'Placement' parameters, and enter a value
of Z = 5.01 mm for the cap. The additional offset of 0.01 mm with respect to the casing
top face helps to render the cap more clearly. If the bottom face of the cap and the top face
of the casing would coincide (at Z=5 mm), FreeCAD would try to display them both at the
same time. This results in a discontinuous display of the boundary between the two objects.

While working on the cap, hide the 'Pilot Light Casing' body and display the coordinate sys-
tem of the cap body (mark in 3D view and SPACE key).

First, define two datum planes that are parallel to the XY plane. One is located at the po-
sition of the top face of the cap, and the other is on the top face of the hollow inside of
the cap. To generate the first datum plane, in the 3D view, mark the XY plane and click
the 'Create a datum plane' tool button. In the task window, set the attachment Z offset to
11.4 mm. Close the task window with the OK button. In the tree view, rename the plane
to 'Cap Top Face'.

● 372

FreeCAD for Electronics Applications.indd 372 24-08-2023 14:31


Appendix D ● The Pilot Lamp

The cap is hollow. It will be displayed with a transparent body later. For a realistic rep-
resentation, the inside of the cap has to be modeled also. For the inner surface, again
create a datum plane parallel to the XY plane. Set the attachment Z offset to 9.8 mm and
rename the plane to 'Cap Inner Top Face'.

Now, the cone for the cap outline needs to be generated. This is again a 'Loft' object, for
which two cross-sections have to be defined. For the outline, sketch one circle onto the XY
plane, and constrain its diameter to 16 mm. On the 'Cap Top Face' datum plane, sketch a
circle with a diameter of 13.5 mm. Both circles are centered around the origin.

In the tree view, mark both new sketches and click the 'AdditiveLoft' tool button (Figure
D-15). Check the 'Closed' checkbox and close the task window with the 'OK' button.

Figure D-15

Now, the hollow space inside the cap is created. To define it, sketch another two circles:
One located on the XY plane, with a diameter of 13.5 mm. The other one is located on the
'Cap Inner Top Surface' datum plane, with a diameter of 10.5 mm.

In the tree view, mark the two new sketches and click the 'Subtractive loft' tool button
(subtractive tool buttons show up in red, additive ones, in yellow). Close the task window
with the OK button (Figure D-16).

● 373

FreeCAD for Electronics Applications.indd 373 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-16

In the tree view, hide the datum planes and the coordinate system of the cap. Show the
body 'Pilot Light Casing'.

In the tree view, right-click the body of the cap and select 'Appearance…' from the context
menu. For the material, select 'Shiny Plastic'. Set the color to red, and the transparency to
40% (Figure D-17).

Figure D-17

● 374

FreeCAD for Electronics Applications.indd 374 24-08-2023 14:31


Appendix D ● The Pilot Lamp

The pilot light looks quite realistic now. It could already be used in assemblies, and to de-
fine the footprint in a front panel. In a book like this, however, you add two more cosmetic
details which also give some guidance for the use of other tools. First, there is a groove pat-
tern inside the pilot light cap, which is oriented along the conical surface. To model such a
groove, you need a guide line. Luckily, the inner surface already has one on display – where
the defined profile has its boundary line. For the following, you keep track of this useful line.
In the tree view, hide the 'Pilot Light Casing' body again, and rotate the cap until you can
spot the line (Figure D-18).

Figure D-18

Now, the profile of the grove is sketched on the XY plane. To do this, start the sketcher and
select the XY plane from the selection dialog. Close the sketch right away, and reopen it,
in order to display the cap with the sketch. If the cap appears white or gray now, this is
due to the illumination of the scene. First, turn the cap into the 'Bottom' orientation (use
a tool button or the control cube). Then slightly move the cap, until you can see the guide
line again.

Click the 'External geometry' tool button and mark the guide line. In the sketching plane,
the guide line is represented by two projected points – the little green dot with the cross
marks as the starting point, the dot as the end point of the line (Figure D-19, step 1 and 2).

● 375

FreeCAD for Electronics Applications.indd 375 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-19

Click the 'Create an equilateral triangle by its center and by one corner' tool button. (Figure
D-19, step 3).

Figure D-20

● 376

FreeCAD for Electronics Applications.indd 376 24-08-2023 14:31


Appendix D ● The Pilot Lamp

With the first click, place the center point of the triangle on the X axis. With the second
click, to the left of the center point, place one corner of the triangle onto the X axis. It is
eventually hard to lock the corner onto the X axis – aim with the crosshairs, until the axis
turns yellow (Figure D-20). If you find it difficult to see, set the zoom to high magnification,
select 'View | Orthographic view' from the main menu.

Figure D-21

Mark the center point of the triangle, and then the projected starting point of the guide line.
If the center point is difficult to select, mark it with a small rectangular selection with the
CTRL key down. Then, click the 'Constrain coincident' tool button (Figure D-21).

Mark one line of the triangle. Click on the 'Constrain distance' tool button (hidden, click
down arrow in menu bar, in the constraints tool section). Enter 1.2 mm for the distance
(Figure D-22). Close the sketch.

● 377

FreeCAD for Electronics Applications.indd 377 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-22

In order to create the first groove, in the 3D view, mark the guide line and the sketch of the
triangle (CTRL key down, Figure D-23). Then, click the 'Subtractive pipe' tool button. Close
the task window with the OK button (Figure D-24).

Figure D-23

● 378

FreeCAD for Electronics Applications.indd 378 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-24

For the generation of all the grooves, a polar pattern is needed. From the main menu, select
'Part Design | Apply a pattern | PolarPattern'.

A selection dialog opens. Scroll down the list of possible elements for the pattern. The last
entry is 'Subtractive Pipe'. Mark that entry and click the OK button (Figure D-25).

● 379

FreeCAD for Electronics Applications.indd 379 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-25

A task window opens. Enter a number of 30 for 'Occurrences' and close the task window
with the OK button (Figure D-26).

● 380

FreeCAD for Electronics Applications.indd 380 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-26

In the top surface of the cap, there are concentric, circular grooves. The profile of these
groves needs to be sketched on the XZ plane. Click on the 'Sketcher' tool button and select
the XZ plane in the initial selection dialog. Close and reopen the sketch to display the cap
with the sketch. Select 'View | Orthographic view' and 'Sketch | View section' for a better
view.

Switch to the 'Model' tab and show the 'Cap Inner Top Surface' datum plane (mark in the
tree view and SPACE key). Switch back to the 'Tasks' tab.

Click on the 'External geometry' tool button and mark the 'Cap Inner Top Surface' datum
plane. You could also switch to the 'Model' tab and pick the plane in the tree view). The
datum plane is shown as a violet construction line (Figure D-27, steps 1 and 2).

● 381

FreeCAD for Electronics Applications.indd 381 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-27

Sketch 5 circles centered on the datum plane representation (Figure D-27, step 3).

On the sketch (alternatively in the 'Elements' panel), mark all the circles and click the 'Con-
strain equal' tool button (Figure D-28).

Figure D-28

● 382

FreeCAD for Electronics Applications.indd 382 24-08-2023 14:31


Appendix D ● The Pilot Lamp

In the 'Elements' panel, right-click the first circle and select 'Diameter constraint' from the
context menu. Set the diameter to 0.5 mm — notice that all other circles follow because of
the previous constraint.

Mark the origin and the center of the inner circle. Click the 'Constrain horizontal distance'
tool button and set the distance to 0,5 mm. In the same way, set the other distances to
1.5 mm, 2.5 mm, 3.5 mm and 4.5 mm (Figure D-29) Close the sketch.

Figure D29

Hide the 'Cap Inner Top Surface' datum plane. In the tree view, mark the new sketch and
click the 'Groove' tool button. In the task window, angle and axis are correctly preset. Close
the task window with the OK button (Figure D-30).

● 383

FreeCAD for Electronics Applications.indd 383 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-30

At this point, a realistic appearance of the pilot light has been achieved. It could, however,
be useful to add the contacts as well as the fastener. With these additional items, the ac-
cessibility of the fastener and the space for the wiring harness could be examined later, in
the assembly.

Click the blue 'Create body' tool button. Rename the new body object to 'Pilot Light Contact
1'. If the body is not located within the Std-Part-Container 'Pilot Light Complete', simply
drag and drop it there.

Start the sketcher. Because no plane was marked before this call, the plane needs to be
selected now. Check the checkbox 'Allow external features | From other bodies of the same
part' and pick 'Casing Contact Plane' from the list (Figure D-31). Close the sketch and reo-
pen it, in order to display already present geometry.

● 384

FreeCAD for Electronics Applications.indd 384 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-31

From the main menu, select 'View | Orthographic view' and 'Sketch | View section'.

Click on the 'Create a centered rectangle' tool button and draw a rectangle that is centered
on the X axis (Figure D-32).

Figure D-32

● 385

FreeCAD for Electronics Applications.indd 385 24-08-2023 14:31


FreeCAD for Electronics Applications

Mark a horizontal line of the rectangle and click the 'Constrain horizontal distance' tool but-
ton. Set the distance to 4 mm. Mark one horizontal and one vertical line of the rectangle
and click the 'Constrain equal' tool button. Then, mark the origin and the center point of the
rectangle and constrain the horizontal distance to 3.5 mm (Figure D-33). Close the sketch.

Figure D-33

In the tree view, mark the new sketch. Click on the 'Pad' tool button. In the task window,
enter 5 mm for the length, and check the 'Reversed' checkbox (Figure D-34). Close the task
window with the OK button.

Figure D-34

● 386

FreeCAD for Electronics Applications.indd 386 24-08-2023 14:31


Appendix D ● The Pilot Lamp

In the tree view, mark the local copy of the datum plane in the body of the contact. Start
the sketcher. Rotate the view by either clicking on the 'Top' tool button, or by clicking on
the control cube.

From the main menu, select 'View | Orthographic view' and 'Sketch | View section'.

Click on the 'External geometry' tool button and select two adjacent sides of the contact
rectangle. Then, sketch a circle of arbitrary size and position (Figure D-35).

Figure D-35

Mark two diagonal corners of the violet construction lines, and the center of the circle.
Then, click the 'Constrain symmetrical' tool button (Figure D-36). Close the sketch.

● 387

FreeCAD for Electronics Applications.indd 387 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-36

In the tree view, mark the new sketch. Then, click the 'Hole' tool button.

In the task window, select for the profile 'ISO metric regular profile', check the 'Threaded'
checkbox and set the size to M2.5 (i.e., metric 2.5 mm). For the depth of the hole, select
'Through all' (Figure D-37). Close the task window with the OK button.

Figure D-37

● 388

FreeCAD for Electronics Applications.indd 388 24-08-2023 14:31


Appendix D ● The Pilot Lamp

To accommodate the wiring, another hole is needed, crossing the threaded hole. The proce-
dure is similar to the one just executed for the threaded hole. Start the sketcher and select
the XZ plane. Close and reopen the sketch, to display the already present geometry. From
the main menu, select 'View | Orthographic view' and 'Sketch | View section'.

Click on the 'External geometry' tool button and mark two adjacent sides of the contact.
Then, draw a circle somewhere, and constrain its diameter to 2.5 mm (Figure D-38).

Figure D-38

Mark two corners of the construction lines, which are diagonal with respect to the contact
contour. Mark the center of the circle and click the 'Constrain symmetrical' tool button
(Figure D-39).

● 389

FreeCAD for Electronics Applications.indd 389 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-39

Close the sketch.

In the tree view, mark the new sketch and click the 'Pocket' tool button.

Figure D-40

● 390

FreeCAD for Electronics Applications.indd 390 24-08-2023 14:31


Appendix D ● The Pilot Lamp

In the task window, select the type 'Through all' and check the 'Symmetric to plane' check-
box (Figure D-40). Close the task window with the OK button.

In the tree view, right-click the body 'Pilot Light Contact 1' and select 'Appearance…' from
the context menu. In the task window, select 'Chrome' as the material and close it.

We can generate the second contact with a reference: In the tree view, mark the body 'Pilot
Light Contact 1'. Then, click the 'Make link' tool button (Figure D-41). In the tree view, a
new body object appears. Drag-and-drop it into the Std-Part-Container 'Pilot Light Com-
plete'. Rename it to 'Pilot Light Contact 2', for consistence.

Figure D-41

Mark the new contact body and edit the placement coordinates. These coordinates are rel-
ative to that of the linked parent object. Open the placement task window by clicking the
property line 'Placement' and then on the button to the right. Set the X offset to –7 mm
and close the task window with the OK button.

● 391

FreeCAD for Electronics Applications.indd 391 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-42

For the terminal screws, from the main menu, select 'Macro | Recent macros | start_bolts'.
From the 'BOLTS Parts selector', select 'Standard | DIN | DIN912'. Set the key to M2 and
the length to 4 mm. Click twice on the 'Add part' button.

Drag-and-drop the two screw bodies into the Std-Part-Container 'Pilot Light Complete'.
Rename the screws to 'Terminal Screw 1' and 'Terminal Screw 2'.

The pilot lamp casing has no variants and will therefore not change (except e.g., in color).
Therefore, you can leave the screws just placed and not worry about an attachment re-
lation. Click on the first screw and edit the placement: Set X = 3.5 mm, Y = 0 mm, Z =
–32 mm (Figure D-43). Then, set the placement of the second screw to X = –3.5 mm, Y =
0 mm, Z = –32 mm.

● 392

FreeCAD for Electronics Applications.indd 392 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-43

In the tree view, change the appearance of the screws and select 'Chrome' as the material.

As a last thing, the fastener nut is missing. Create a new body object (blue 'Create body'
tool button) and rename it to 'Pilot Light Nut'. If necessary, drag-and-drop it into the
Std-Part-Container 'Pilot Light Complete'.

In the tree view, hide all other body objects.

Start the sketcher and select the XY plane as the sketching plane.

Draw two circles that are centered around the origin. End the drawing command with a
right click. Constrain the diameters to 16 mm and 19.9 mm. Close the sketch.

For the end face of the nut, a datum plane is needed, because some details originate there.
In the 3D view, click 'into the blue' to deselect the sketch that was just created. Then, click
the 'Create a datum plane' tool button. In the task window, the collector for Reference 1 is
activated when the window opens. Switch to the 'Model' tab. In the tree view, expand the
coordinate system of the new body and mark the XY plane. Return to the 'Tasks' tab and
enter an attachment Z offset of –7.5 mm. Close the task window.

In the tree view, rename the new datum plane as 'Nut Top Face'.

In the tree view, mark the sketch and click the 'Pad' tool button. In the task window, set the
type to 'Up to face' and, in the 3D view, click the datum plane (Figure D-44).

● 393

FreeCAD for Electronics Applications.indd 393 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure D-44

The profile of the fastener nut has a coarse, grooved pattern. The pattern starts at the end
of the face. To sketch the first groove, in the 3D view, mark the 'Nut Top Face' datum plane
and start the sketcher. Close and reopen the sketch to display the already-present 3D ge-
ometry. From the main menu, select 'View | Orthographic view' and 'Sketch | View section'.

Sketch a circle that is centered on the X axis and constrain its diameter to 1.2 mm.

Click on the 'External geometry' tool button and click the outer contour of the nut, which is
then displayed in violet, as a construction geometry. End the 'External geometry' command
with a right click.

Mark the center of the new circle, and the violet construction geometry. Click on the 'Con-
strain point onto object' tool button (Figure D-45). Close the sketch (top).

● 394

FreeCAD for Electronics Applications.indd 394 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-45

Now create the grove: In the tree view, mark the new sketch and click the 'Pocket' tool
button. In the task window, select the type 'Dimension', the length 5 mm and check the
'Reversed' checkbox (Figure D-46). Eventually, you need to move the 3D view a bit to see
the groove. Close the task window with the OK button.

Figure D-46

● 395

FreeCAD for Electronics Applications.indd 395 24-08-2023 14:31


FreeCAD for Electronics Applications

From the main menu, select 'Part Design | Apply a pattern | PolarPattern'. A selection win-
dow opens. Scroll down and mark the last entry, the pocket object just created. Click the
OK button to proceed.

In the task window, the axis ('Normal sketch axis') and the total angle are preset. Enter a
number of 30 for the occurrences and close the task window with the OK button (Figure
D-47).

Figure D-47

The nut has further featured on the rim, for which a mating key tool exists. As a prepara-
tion, in the tree view, hide the 'Nut Top Face' datum plane. Start the sketcher and select
the YZ plane as the sketching plane.

Close and reopen the sketch to display the already-present 3D geometry. From the main
menu, select 'View | Orthographic view' and 'Sketch | View section'.

Click on the 'External geometry' tool button and click the projected top face of the nut.
Draw a rectangle that is centered on the Z axis, with one edge locked to the violet top
face reference (Figure D-48). Set the Width of the rectangle to 5.4 mm and the height to
1.2 mm. Close the sketcher.

● 396

FreeCAD for Electronics Applications.indd 396 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-48

In the tree view, mark the new sketch and click the 'Pocket' tool button. In the task window,
select 'Through all' for the type (Figure D-49). Close the task window with the OK button.

Figure D-49

● 397

FreeCAD for Electronics Applications.indd 397 24-08-2023 14:31


FreeCAD for Electronics Applications

From the main menu, select 'Part Design | Apply a pattern | PolarPattern'. A selection win-
dow opens. Scroll down and mark the last entry, the pocket object just created. Click the
OK button to proceed. In the task window, select the axis 'Base Z axis' and set the number
of occurrences to 4 (Figure D-50). Close the task window with the OK button.

Figure D-50

In the tree view, right-click the nut body and select 'Appearance…' from the context menu.
Select 'Shiny Plastic' as the material, and a bright gray for the color.

In the tree view, mark the body of the nut. In the property list, open the placement task
window by clicking the 'Placement' field and on the button. Set the Z translation param-
eter to a typical front panel thickness, e.g., –2 mm. Close the task window with the OK
button and save your work.

The finalized pilot light is depicted in Figure D-51. The creation of this object was quite
complex, especially with the step-by-step mode. But now, the little gadget is ready to be
inserted by just coy-and-paste into as many designs as you like!

● 398

FreeCAD for Electronics Applications.indd 398 24-08-2023 14:31


Appendix D ● The Pilot Lamp

Figure D-51

● 399

FreeCAD for Electronics Applications.indd 399 24-08-2023 14:31


FreeCAD for Electronics Applications

Appendix E ● The Toggle Switch

As always, follow the standard procedure: Start a new file, save it as 'Toggle Switch'. In
that file, create a new Std-Part-Container and rename it to 'Toggle Switch Complete'. Start
with the front-side fastener of the toggle switch. Switch to the 'Part Design' workbench and
create a new body object and rename that to 'Toggle Switch Knurled Nut'.

The knurled nut is attached later to the front panel. Therefore, you create it as the first
thing here, and refer to it with all other following parts. The knurled nut has a thickness of
2.3 mm, and a slightly conical top face.

A few words towards its practical use: The nut is knurled to improve the grip for your
fingertips, not the pliers' grip! After the knurled nut has been properly set, the switch is
tightened with a wrench from the back side of the panel. If you tighten the knurled nut
with pliers instead, it's sure to be mashed, and probably some scratches will be left on your
front panel, too.

The sketch of the end cross-section of the loft object is located on a datum plane:

In the tree view, show the coordinate system of the nut body (mark it and press the SPACE
key). In the 3D view, mark the XY plane and click the 'Create a datum plane' tool button.
In the task window, set the attachment Z offset to 2.85 mm (Figure E-1). Close the task
window and rename the new datum plane to 'Knurled Nut Top Face'.

Figure E-1

● 400

FreeCAD for Electronics Applications.indd 400 24-08-2023 14:31


Appendix E ● The Toggle Switch

In the 3D view, mark the XY plane and start the sketcher. Draw a circle that is centered
around the origin. End the drawing command with a right click.

In the 'Elements' list, right-click the circle and select 'Diameter Constraint' from the context
menu. Enter 16.2 mm for the diameter (Figure E-2). Close the task window.

Figure E-2

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
set the length to 2.3 mm (this models the cylindrical part of the nut, Figure E-3 step 1).

In the tree view, mark the 'Knurled Nut Top Face' datum plane and start the sketcher. Draw
a circle which is centered around the origin and constrain its diameter to 12.4 mm. Close
the sketch.

In the tree view, hide the 'Knurled Nut Top Face' datum plane.

Hold down the CTRL key. In the 3D view, mark the top face of the cylinder and the new
sketch (Figure E-3, steps 2 and 3). Click on the 'Additive loft' tool button. Close the task
window with the OK button (Figure E-4). You have certainly noticed — the loft refers to a
facet. This could cause havoc but the simple nut will be finished soon, so any re-enumera-
tion damage that might occur should be limited.

● 401

FreeCAD for Electronics Applications.indd 401 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-3

Figure E-4

● 402

FreeCAD for Electronics Applications.indd 402 24-08-2023 14:31


Appendix E ● The Toggle Switch

For the threaded hole of the nut, sketch a circle on the XY plane, which is centered around
the origin. Constrain its diameter to 12 mm (Figure E-5). If the view of the sketching plane
is obscured by the nut body, from the main menu, select 'Sketch | View section'.

Figure E-5

In the tree view, mark the new sketch and click the 'Pocket' tool button (Figure E-6). In the
task window, select the type 'Through all' and check the 'Reversed' checkbox (Figure E-7).
Close the task window with the OK button.

Figure E-6

● 403

FreeCAD for Electronics Applications.indd 403 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-7

Figure E-8

● 404

FreeCAD for Electronics Applications.indd 404 24-08-2023 14:31


Appendix E ● The Toggle Switch

For the knurled surface, start by drawing one profile on the XY plane. Mark the XY plane
and start the sketcher. From the main menu, select 'View | Orthographic view' and 'Sketch
| View section'.

Click on the 'External geometry' tool button and mark the outer contour of the nut. The
outline will be displayed in violet, indicating that a construction object has been created,
to which you can refer. Then, click the 'Create an equilateral triangle by its center and a
corner' tool button (Figure E-8).

With the first click, lock the center of the triangle to the Y axis. With the second click, place
one corner of the triangle also on the Y axis, somewhere below (Figure E-9). It takes some
aiming with the cross hair cursor, until the target object highlights (especially with the
corner point). Being precise with these items reduces the degrees of freedom right away.

Mark the horizontal line of the triangle and constrain its length to 0.2 mm (Figure E-9, steps
3, 4). Now, the triangle is really small. Zoom in to display the center point. You can drag
the center closer to the violet circle if that helps with the next step. The center point will
stay nicely locked to the Y axis.

Figure E-9

Mark the center point of the triangle and the violet nut outline. Then, click the 'Constrain
point onto object' tool button (Figure E-10). The sketch is displayed in bright green — fully
constrained. Close the sketch with the 'Close' button (top).

● 405

FreeCAD for Electronics Applications.indd 405 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-10

Figure E-11

● 406

FreeCAD for Electronics Applications.indd 406 24-08-2023 14:31


Appendix E ● The Toggle Switch

In the tree view, mark the new sketch and click the 'Pocket' tool button. In the task window,
select for the type 'Through all' and check the 'Reversed' checkbox (Figure E-11). Close the
task window with the OK button.

In the tree view, mark the last design state 'Pocket'. From the main menu, select 'Part De-
sign | Apply a pattern | Polar pattern' (Figure E-12).

Figure E-12

In the task window, set the number of occurrences to 140 (the generation takes a little
time, Figure E-13). Then close the task window with the OK button. In the tree view, hide
the coordinate system of the nut (mark it and press the SPACE key).

● 407

FreeCAD for Electronics Applications.indd 407 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-13

Now the nut is nearly done. To make it shine a bit more, in the tree view, right-click the
'Toggle Switch Knurled Nut' body and select 'Appearance…' from the context menu. For the
material, select 'Chrome' and close the task window.

The switch casing consists of a cylindrical shaft. As a rotation lock, the shaft has a groove.
The plastic casing for the contacts is attached to the rear of the shaft. When modeling the
cylindrical part, it is a good question how to consider the rotation lock. It is, of course, pos-
sible to simply sketch the outline with all features in a sketch at once. However, a sketch
with many degrees of freedom could be frustrating to constrain properly. Our simple exam-
ple implies that it may be easier to sketch the cylinder and the grove in two separate, less
troublesome sketches. Sometimes, that is not satisfactory, too, as it may make the struc-
ture of the part more complex or obscure a design idea. With sketches, this is a recurring
question. We will therefore use the groove as an example case and define a construction
element. This helps to reduce the degrees of freedom, and it keeps all related features
together in one sketch.

For the casing, create a new body object and rename it to 'Toggle Switch Casing'. If neces-
sary, drag-and-drop it into the 'Toggle Switch Complete' Std-Part-Container.

Start the sketcher and from the selection dialog, select the XY plane as the sketching plane.
(An alternative way to start the sketcher on a certain plane is to mark its item line in the
tree view before the 'Sketcher' tool button is clicked).

● 408

FreeCAD for Electronics Applications.indd 408 24-08-2023 14:31


Appendix E ● The Toggle Switch

Draw a circle that is centered around the origin, and constrain its diameter to 12 mm.

Draw a second circle, also centered on the origin, and constrain the diameter to 8.5 mm
(Figure E-14).

Expand the 'Create Rectangle' tool button and click the 'Create a centered rectangle' tool
button (Figure E-14). Draw a rectangle that is centered on the Y axis. Constrain the di-
mensions of the rectangle: Set the width to 1.5 mm, and the height to 3 mm (Figure E-15,
steps 2 and 3).

Figure E-14

Mark the lower corner of the rectangle, then the origin. Constrain the vertical distance to
5.2 mm (all the measures were taken with a caliper from an existing switch, Figure E-15,
step 4).

● 409

FreeCAD for Electronics Applications.indd 409 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-15

Figure E-16

At this point, it is tempting to use the 'Trim edge' tool, and to cut the circle with the rec-
tangle (Figure E-16). Note that the sketch is fully constrained now, before this operation.
If you proceed, constraining the resulting sketch will get hairy: When dimensions change

● 410

FreeCAD for Electronics Applications.indd 410 24-08-2023 14:31


Appendix E ● The Toggle Switch

later on, complicated sketches can end up distorted. It is therefore better to redefine the
rectangle as a construction element:

Fortunately, this is simple: Mark the four-line objects in the 'Elements' list, and right-click
the selection. From the context menu, select 'Toggle Construction Line'. The rectangle is
now displayed in light blue, and the sketch is still fully constrained.

Now, you can safely click the 'Trim edge' tool button and cut away the part of the circle
which is located inside the rectangle (Figure E-17). As depicted in Figure E-17, the sketch is
still fully constrained. Click on the 'Create line' tool button and draw the lines which define
the groove, as shown in Figure E-18. The sketch stays fully constrained, and you would
even have the chance to change, e.g., the width of the slot without distorting the rest of
the sketch. Close the sketch (top).

Figure E-17

● 411

FreeCAD for Electronics Applications.indd 411 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-18

Figure E-19

● 412

FreeCAD for Electronics Applications.indd 412 24-08-2023 14:31


Appendix E ● The Toggle Switch

Before padding the new sketch to form the shaft, a datum plane for the definition of the
plastic part of the casing is a useful addition. In the tree view, expand the coordinate sys-
tem of the 'Toggle Switch Casing' body (named Origin002) and mark the XY plane. Click
on the 'Create a datum plane' tool button. Enter a value of –13 mm for the Z attachment
offset and close the task window. Rename the new datum plane to 'Plastic Casing Position'.

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
select 'Up to face' as the type, and click the datum plane, either in the 3D view, or in the
tree view which you can access by switching to the 'Model' tab (Figure E-19). Close the task
window with the OK button.

In the tree view, click the 'Toggle Switch Casing' body. In the property list, edit the place-
ment parameters: Either click the 'Placement' property line and open a task window by
clicking the button to the right, or expand the property list entries 'Placement' and 'Po-
sition' to find the line for Z. Enter a value of 3 mm manually (by this amount, the switch
casing shall later protrude from the front panel).

Now you add the housing for the contacts. In the 3D view, mark the datum plane 'Plastic
Casing Position' and start the sketcher. From the main menu, select 'View | Orthographic
view' and 'Sketch | View section'. Draw a rectangle centered around the origin. Constrain
the width to 26 mm, the height to 23.2 mm (Figure E-20). Close the sketch.

Figure E-20

● 413

FreeCAD for Electronics Applications.indd 413 24-08-2023 14:31


FreeCAD for Electronics Applications

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
enter a value of 16.6 mm for the length and check the 'Reversed' checkbox. Close the
sketch. In the tree view, hide the datum plane 'Plastic Casing Position'.

In the 3D view, mark the four outer boundaries of the newly extruded casing body.

Click on the 'Fillet' tool button (Figure E-21). For the radius, enter a value of 2 mm and
close the task window with the OK button.

Figure E-21

In the 3D view, mark one segment of the lower casing boundary. Again, click the 'Fillet' tool
button. Leave the radius at the default value of 1 mm. The rounded edge is automatically
completed (Figure E-22). In this case, this is very useful. If the fillet cannot be completed
due to e.g., a too-large radius value, the responses to the command can be confusing. In
these cases, start with a very small value for the radius, and spot the cause for the problem
by slowly increasing the radius. Close the task window with the OK button.

● 414

FreeCAD for Electronics Applications.indd 414 24-08-2023 14:31


Appendix E ● The Toggle Switch

Figure E-22

The switch casing is now completed. In order to have a better representation, some coloring
is useful. First, right-click the body of the casing in the 3D view and select 'Appearance…'
from the context menu. For the material, select 'Chrome' and close the task window.

The plastic part of the switch is usually made of Bakelite. Because the switch casing is com-
pleted, let's limit to coloring facets of the body. In the tree view, right-click the last design
state in the 'Toggle Switch Casing' body (the tip) and select 'Set colors' from the context
menu.

In the 3D view, mark all facets which belong to the bottom of the casing, and which are
not directed to the front. Either click the facets one-by-one, holding the CTRL key, or rotate
the switch into a comfortable position, click the 'Box selection' button and pull a rectangle
over the rear end of the switch casing, which is faster (Figure E-23). Set the color to black.

● 415

FreeCAD for Electronics Applications.indd 415 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-23

Now the terminals need to be modeled. For the first contact, click the blue 'Create body'
tool button. Rename the first contact to 'Toggle Switch Terminal 001'. If necessary, drag-
and-drop the new body into the Std-Part-Container 'Toggle Switch Complete'.

Expand the new body and display its coordinate system (mark and SPACE key).

In the tree view, hide the nut and the casing. In the 3D view, mark the YZ plane and start
the sketcher.

Draw a centered rectangle: With the first click, lock the center to the Y axis, with the second
click, lock one corner to the Z axis (Figure E-24, steps 1, 2). End the drawing command
with a right click. Mark a horizontal line of the new rectangle and constrain its width to
3 mm. Mark a vertical line and constrain the height to 2.4 mm.

● 416

FreeCAD for Electronics Applications.indd 416 24-08-2023 14:31


Appendix E ● The Toggle Switch

Figure E-24

For the soldering pad, draw a circle of arbitrary position and size. End the drawing com-
mand with a right click. Mark the circle and one outer corner of the rectangle. Then, click
on the 'point on object' constraint button (Figure E-24, steps 3, 4, 5). Mark the other outer
corner of the rectangle, and then the circle, and apply again the 'point on object' constraint
(Figure E-24, steps 6,7,8).

In the 'Elements' list, right-click the circle and select 'Diameter constraint' from the context
menu. Set the diameter to 4 mm.

Trimming away the surplus line and an arc from the circle would lead to many degrees of
freedom that would need to be specified. It is better to keep the line of the rectangle, and
to redefine it as a construction line: In the 'Elements' list, right-click the outer, vertical line
of the rectangle. From the context menu, select 'Toggle construction line' (Figure E-25).

● 417

FreeCAD for Electronics Applications.indd 417 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-25

Now, the arc which is located inside the terminal area can be cut away without disturbing
the fully constrained state of the sketch. Click on the 'Trim edge' tool button, and then on
the circle, within the rectangle (Figure E-26). The sketch remains fully constrained!

Figure E-26

● 418

FreeCAD for Electronics Applications.indd 418 24-08-2023 14:31


Appendix E ● The Toggle Switch

The hole for the wire is still missing. Draw a circle with its origin locked to the center of
the outlining arc. Constrain the diameter of the circle to 1.8 mm (Figure E-27). Close the
sketch (top).

Figure E-27

In the tree view, mark the new sketch and click the 'Pad' tool button. In the task window,
enter a value of 1.2 mm for the length, and check the 'Symmetric to plane' checkbox. Close
the task window. In the tree view, right-click the terminal body and select 'Appearance…'
from the context menu. Select 'Chrome' as the material.

The contact needs to be positioned. In order to see where it moves to, display the
nut and the casing (in tree view, mark, and press SPACE key). Then mark the contact
body again. In the property list, click into the 'Placement' property field and open the
task window with the button. In the task window, set the placement translations to
X = –9.00 mm, Y = 11.60 mm, Z = –22.50 mm (Figure E-28).

● 419

FreeCAD for Electronics Applications.indd 419 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-28

Close the task window with the OK button. In the tree view, mark the terminal body and
click the 'Create a clone' tool button (Figure E-28, number 3). In the tree view appears a
new body object. Rename it to 'Toggle Switch Terminal 002' and drag and drop it into the
'Toggle Switch Complete' Std-Part-Container.

In the tree view, mark the cloned terminal. In the property list, expand the placement pa-
rameters and set the X translation to 6 mm. In the same way, generate two more clones,
rename them, and set the X translations to 12 and 18 mm (Figure E-29).

● 420

FreeCAD for Electronics Applications.indd 420 24-08-2023 14:31


Appendix E ● The Toggle Switch

Figure E-29

Set the appearance of all the new terminals also to 'Chrome'.

Now clone each of the terminals again, rename them in sequence (Toggle Switch Terminal
005 ... 008) and drag-and-drop them all into the Std-Part-Container.

In the tree view, mark all the newly generated terminals. In the property list, click into the
'Placement' edit field, and then on the button to display the task window. In the rotation
section, the Z axis is already preset. Enter an angle of 180° to move all the new terminals
to the opposite side at once (Figure E-30).

● 421

FreeCAD for Electronics Applications.indd 421 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-30

In the tree view, mark all new contacts and set the appearance to 'Chrome' (Figure E-31).
Close the task window.

Figure E-31

● 422

FreeCAD for Electronics Applications.indd 422 24-08-2023 14:31


Appendix E ● The Toggle Switch

As a last thing, the lever will be modeled. Create a new body object and rename it to 'Tog-
gle Switch Lever'. Hide all other bodies while the lever is designed. Display the coordinate
system of the lever body.

Mark the YZ plane and start the sketcher. Draw a circle that is centered around the origin,
and constrain its diameter to 7.6 mm. Then, draw a second circle above the first one, which
is centered on the Z axis. Constrain its diameter to 6.5 mm. In the 'Elements' list, mark
both circles, right-click the selection and select 'Toggle construction line' from the context
menu (Figure E-32).

Figure E-32

Mark the center points of the two circles and constrain the vertical distance to 16.3 mm
(Figure E-33).

● 423

FreeCAD for Electronics Applications.indd 423 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-33

For the lever, draw a line of approximate length and position. End the drawing command
with a right click. Mark the upper endpoint of the line and the upper circle and click the
'Constrain tangent' tool button (Figure E-34).

Figure E-34

● 424

FreeCAD for Electronics Applications.indd 424 24-08-2023 14:31


Appendix E ● The Toggle Switch

Mark the lower endpoint of the line and the lower circle. Then, click the 'constrain point onto
object' tool button (Figure E-35). Sometimes, the solver complains about too many select-
ed objects. Then, some drawing element from a prior step was still marked. To resolve this,
click the blue background to deselect all, and start over.

Figure E-35

Mark the line and the Z axis. Then, click the 'Constrain angle' tool button (Figure E-36). Set
the angle to 7°. The line is already fully constrained.

● 425

FreeCAD for Electronics Applications.indd 425 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-36

Figure E-37

● 426

FreeCAD for Electronics Applications.indd 426 24-08-2023 14:31


Appendix E ● The Toggle Switch

Draw two arcs, as shown in Figure E-37. To achieve this, click first the origin of the corre-
sponding circle, then lock one end of the arc to the endpoint of the line which is attached to
that circle. Define the other endpoint of the arc by clicking on the Z axis with the crosshairs.
It is difficult to see whether you are locked to the axis when the view is zoomed in (because
of the blue axis representation). If you zoom out a bit, you can see the axis changing color
to yellow when the cross hairs cursor is on it. If you successfully hit the two endpoints, the
arc is shown bright green — fully constrained again.

The profile that you draw here will be used for a revolution. It needs to be closed, so draw
a line on the Z axis, connecting the two endpoints (Figure E-38). Close the sketch.

Figure E-38

In the tree view, mark the new sketch and click the 'Revolution' tool button. The defaults
for axis and angle are already sufficient to generate the part (Figure E-39). Close the task
window with the OK button.

● 427

FreeCAD for Electronics Applications.indd 427 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-39

In the tree view, hide the coordinate system of the lever body with the SPACE key. Set the
appearance of the 'Toggle Switch Lever' body to the material 'Chrome'.

In the tree view, show all other bodies of the switch (mark, and SPACE key).

In the tree view, mark the 'Toggle Switch Lever' body. In the property list, click into the
'Placement' edit field and then on the button to show the placement task window. Set
the Z translation to -0,5. For the rotation, select the X axis and enter a value of -22° for
the angle (Figure E-40). You can actually 'toggle' the switch with the mouse wheel, while
the cursor is inside the 'Angle' field. Virtual reality as close as it gets. Close the task window
with the OK button.

● 428

FreeCAD for Electronics Applications.indd 428 24-08-2023 14:31


Appendix E ● The Toggle Switch

Figure E-40

The lower nut is still missing. This is the one that you want to tighten with a tool, not the
knurled one (which saves your equipment many scratches and deformations). Create a new
body object. If necessary, drag-and-drop it into the Std-Part-Container, and rename it to
'Toggle Switch Nut'.

Start the sketcher and, in the selection dialog, set the XY plane as the sketching plane.

Click on the 'Create regular polygon' tool button and draw a hexagon which is centered
around the origin. With the first click, define the center, with the second, place a corner of
the hexagon onto the Y axis (Figure E-41).

● 429

FreeCAD for Electronics Applications.indd 429 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-41

Mark two corners of the hexagon which are on the same height (Y coordinate). Constrain
the horizontal distance to a key of 16 mm (Figure E-42, steps 1 and 2).

Figure E-42

● 430

FreeCAD for Electronics Applications.indd 430 24-08-2023 14:31


Appendix E ● The Toggle Switch

Draw a circle which is centered around the origin and constrain its diameter to 12 mm (Fig-
ure E-42, steps 3 and 4). Close the sketch.

In the tree view, mark the new sketch and click the 'Pad' tool button. For the length, enter
a value of 1.5 mm. Because the nut extends from the rear of the front panel towards the
back, check the 'Reversed' checkbox (Figure E-43).

Figure E-43

In the tree view, mark the body of the new nut and set the appearance to 'Chrome'.

The nut position could be set to account for a standard front panel thickness. In the tree
view, click the nut object. In the property list, click into the 'placement' edit field and then
on the button to show the task window. Set the Z translation to –2 mm (Figure E-44).
Close the task window and save your work.

● 431

FreeCAD for Electronics Applications.indd 431 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure E-44

● 432

FreeCAD for Electronics Applications.indd 432 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Appendix F ● The IEC Power Inlet

First, run the standard procedure: Create a new file and save it as 'IEC Inlet'. Then, create a
Std-Part-Container, and rename this to 'IEC Inlet Complete'. Within this container, create a
new body object and rename that to 'IEC Inlet Casing'. Display its coordinate system (mark
it and press the SPACE key).

Start the sketcher. In the selection dialog, select the XY plane as the sketching plane.

Draw a rectangle that is centered around the origin. Constrain the width of the rectangle
to 30.2 mm, and the height to 22.5 mm (Figure F-1). For a better fit, some extra tolerance
has already been added to the measured dimensions.

Figure F-1

Click on the 'Constraint preserving sketch fillet' tool button (Figure F-2). Then click two
adjacent lines of the rectangle to create the round edge. Repeat this for each corner.

● 433

FreeCAD for Electronics Applications.indd 433 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-2

Figure F-3

● 434

FreeCAD for Electronics Applications.indd 434 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

In the 'Elements' list, mark all 'Arc' objects, right-click the selection and select 'Con-
strain radius' from the context menu. Enter a value of 4 mm. Close the sketch.
If you would have selected 'Sketch fillet' instead of 'Constraint preserving sketch fillet', the
change of the radius would have distorted the sketch.

The new sketch describes the contour of the casing itself. It will protrude to the front and to
the back. Mark the sketch and click the 'Pad' tool button. In the task window, select for the
type 'Two dimensions'. Set the length to 6 mm (protruding to the front), and the '2nd length'
to 16 mm (protruding to the rear, Figure F-3). Close the task window with the OK button.

Now, generate the flange for the inlet. In the 3D view, mark the XY plane and start the
sketcher. Close and reopen the sketch to display the already-present 3D geometry. From
the main menu, select 'View | Orthographic view' and 'Sketch | View section'.

Click on the 'External geometry' tool button and then on each of the four arcs. These will
be highlighted in violet, as construction elements (Figure F-4).

Figure F-4

For the mounting holes, draw two circles that are centered on the X axis. Mark the two
circles and click the 'Constrain equal' tool button. In the 'Elements' view, right-click the two
circles and select 'Diameter constraint' from the context menu. Enter a value of 3.2 mm to
accommodate M3 (3 mm metric) screws later.

● 435

FreeCAD for Electronics Applications.indd 435 24-08-2023 14:31


FreeCAD for Electronics Applications

Mark both circle centers, then the Y axis. Click on the 'Constrain symmetrical' tool button.

Mark both circle centers again and constrain the horizontal distance to 40 mm (Figure F-5).

Figure F-5

Figure F-6

● 436

FreeCAD for Electronics Applications.indd 436 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Around each circle, draw a concentric, larger one. Mark both of the new circles and click
the 'Constrain equal' tool button. Then constrain the diameter of one of the new circles to
6.9 mm.

In the 'Elements' list, mark the two larger circles. Right-click the selection and select 'Tog-
gle construction line' from the context menu (Figure F-6).

Draw a line of arbitrary position and length close to one of the circles. End the drawing
command with a right click. Mark one endpoint of the line and the closest (violet) arc. Click
the 'Constrain tangent' tool button (Figure F-7).

Figure F-7

In the same way, mark the other endpoint of the line and the larger circle close to it. Click
the 'Constrain tangent' tool button again (Figure F-8).

● 437

FreeCAD for Electronics Applications.indd 437 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-8

Repeat the procedure to generate lines for all four arcs (Figure F-9).

Figure F-9

● 438

FreeCAD for Electronics Applications.indd 438 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Click on the 'Create arc' tool button and draw all arcs which are shown in Figure F-10 in
bright green.

Figure F-10

Close the flange contour by adding two horizontal lines (Figure F-11). Close the sketch.

Figure F-11

● 439

FreeCAD for Electronics Applications.indd 439 24-08-2023 14:31


FreeCAD for Electronics Applications

In the tree view, mark the new sketch. Click on the 'Pad' tool button. In the task window,
enter a value of 3 mm for the length (Figure F-12).

Figure F-12

Define the opening in the socket: Mark the XY plane and start the sketcher. Close and re-
open the sketch, to display the already-present 3D geometry. From the main menu, select
'View | Orthographic view' and 'Sketch | View section'.

Draw a rectangle that is centered around the origin. Constrain the width to 24.25 mm, the
height to 16.8 mm.

As with the outer contour of the casing, click the 'Constraint preserving sketch fillet' tool
button and apply the fillet to all four corners of the new rectangle. In the 'Elements' view,
mark all arc objects, right-click the selection and select 'Constrain radius' from the context
menu. Set the radius to 1 mm (Figure F-13).

● 440

FreeCAD for Electronics Applications.indd 440 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F13

Close the sketch (top).

In the tree view, mark the new sketch and click the 'Pocket' tool button. In the task window,
for the type, select 'Through all' and check the 'Reversed' checkbox (Figure F-14). Close the
task window with the OK button.

● 441

FreeCAD for Electronics Applications.indd 441 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-14

The rear end of the opening has a slightly different profile. Again, in the 3D view, mark the
XY plane and start the sketcher. Close and reopen the sketch, to show the already-present
3D geometry. From the main menu, select 'View | Orthographic view' and 'Sketch | View
section'.

Click the 'External geometry' tool button. Mark all parts of the inner contour, except for the
two upper arcs (Figure F-15). For the coded corners of the inlet, draw two inclined lines
(Figure F-16). Mark one line and the Y axis. Click the 'Constrain angle' tool button and enter
a value of 45°. Repeat the procedure for the other line (Figure F-17).

● 442

FreeCAD for Electronics Applications.indd 442 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F-15

Figure F-16

● 443

FreeCAD for Electronics Applications.indd 443 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-17

Trim all parts of the two lines which are located outside of the inner contour (Figure F-18).

Figure F-18

On each side, mark the bottom end point of the line and the endpoint of the lowermost line
of the contour, and constrain the vertical distance to 12.7 mm (Figure F-19).

● 444

FreeCAD for Electronics Applications.indd 444 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F-19

Add the missing lines to the bottom profile, using the line command, as shown in Figure
F-20. Take care to target the endpoints properly – only then, the sketch stays fully con-
strained.

Figure F-20

● 445

FreeCAD for Electronics Applications.indd 445 24-08-2023 14:31


FreeCAD for Electronics Applications

Click on the 'Create arc' tool button and complete the profile by adding the two lower arcs,
as shown in Figure F-21. Again, it is important to aim with great care with the crosshairs,
to keep the sketch fully constrained, or at least leave it with only partially redundant con-
straints.

Figure F-21

Close the sketch. In the tree view, make sure that the new sketch is marked and click the
'Pocket' tool button. Set the length to 10 mm and close the task window with the OK button
(Figure F-22).

● 446

FreeCAD for Electronics Applications.indd 446 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F-22

In the 3D view, mark all edges which appear green in Figure F-23. Click on the 'Fillet' tool
button. In the task window, enter a value of 1.25 mm for the fillet radius. Close the task
window with the OK button.

● 447

FreeCAD for Electronics Applications.indd 447 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-23

Figure F-24

● 448

FreeCAD for Electronics Applications.indd 448 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

In the tree view, right-click the body of the casing, and select 'Appearance…' from the con-
text menu. For the material, select 'Shiny Plastic'. This presets the color to black. Some-
times it is better to select dark gray, which gives better contrast (F-24). Close the task
window.

Now, the contacts need to be modeled. In the tree view, hide the 'IEC Inlet Casing' body.
Create a new body and drag-and-drop it into the Std-Part-Container, if necessary. Rename
the new body to 'IEC Inlet Contact N'.

Start the sketcher and select the XY plane as the sketching plane.

Draw a rectangle that is centered around the origin. Constrain its width to 2 mm, its height
to 4 mm (Figure F-25). Close the sketch.

Figure F-25

In the tree view, mark the new sketch and click the 'Pad' tool button. Set the length of the
pad to 23 mm and check the 'Reversed' checkbox (Figure F-26). Close the task window.

● 449

FreeCAD for Electronics Applications.indd 449 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-26

For the tapers at the contact front, in the 3D view, mark the front face of the contact. Then,
click the 'Chamfer' tool button. In the task window, select the type 'Two distances', set the
size to 0.5 mm and the size 2 to 3 mm (Figure F-27). Close the task window with the OK
button.

● 450

FreeCAD for Electronics Applications.indd 450 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F-27

In the 3D view, turn the contact around and mark the two shorter rear edges, as shown in
Figure F-28.

Figure F-28

● 451

FreeCAD for Electronics Applications.indd 451 24-08-2023 14:31


FreeCAD for Electronics Applications

Click on the 'Fillet' tool button. In the task window, set the radius to 1.99 mm (with 2 mm,
the tool fails). Close the task window with the OK button (Figure F-29).

Figure F-29

For the eyelet in the contact, start the sketcher again and select the YZ plane as the sketch-
ing plane.

To show the geometry of the contact, close and reopen the sketch. From the main menu,
select 'View | Orthographic view' and 'Sketch | View section'.

Click on the 'Create slot' tool button. Click on two locations of the Z axis to draw the slot,
centered on the Z axis. In the 'Elements' list, right click one of the arcs and constrain its
diameter to 1.5 mm (Figure F-30, step 2).

● 452

FreeCAD for Electronics Applications.indd 452 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F-30

Mark a straight line of the slot and constrain the vertical distance to 2 mm (Figure F-30,
step 3).

Mark the lower arc center point and the origin and constrain the vertical distance to 21 mm
(Figure F-30, step 4). Close the sketch (top).

In the tree view, mark the new sketch and click the 'Pocket' tool button. Select for the type
'Through all' and check the 'Symmetric to plane' checkbox (Figure F-31). Close the task
window with the OK button.

● 453

FreeCAD for Electronics Applications.indd 453 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-31

In the tree view, mark and copy the 'IEC Inlet Contact N' body (CTRL-C). A selection dialog
appears. Do not change the items, just click 'OK'. Double-click the Std-Part-Container to
activate it and paste a copy of the contact with CTRL-V. Drag-and-drop the pasted body
into the Std-Part-Container and rename it to 'IEC Inlet Contact PE'. Note: PE stands for
Protective Earth.

In the tree view, display the body 'IEC Inlet Casing' again (mark it and press the SPACE
key). Mark the body 'IEC Inlet Contact N'. In the property list, click into the 'Placement' edit
field and open the task window with the button.

Set the Y translation to –2 mm, the X translation to –7.125 mm and close the task window
with the OK button.

In the same way, edit the placement of the PE contact. Set the Y translation to 2 mm. The
PE contact protrudes more than the other contacts, therefore also set the Z translation to
2 mm (Figure F-32).

● 454

FreeCAD for Electronics Applications.indd 454 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F-32

The PE contact is longer than the other contacts. To account for this, in the tree view, ex-
pand the 'IEC Inlet Contact PE' body, and double-click the first design step (Pad). Change
the length to 25 mm. And close the task window with the OK button. Now the eyelet is
misplaced.

Now correct the position of the eyelet: In the tree view, expand the last design step (the
tip, 'Pocket') and double-click the contained sketch. From the main menu, select 'View |
Orthographic view' and 'Sketch | View section'. Note that the sketch is centered on the Y
axis, while the contact is shown with its placement translations. Change the distance of the
lower slot arc from 21 to 23 mm (Figure F-33) and close the sketch.

● 455

FreeCAD for Electronics Applications.indd 455 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure F-33

In the tree view, mark the 'IEC Inlet Contact N' body and click the 'Clone' tool button.

Drag and drop the clone into the Std-Part-Container and rename it to 'IEC Inlet Contact L'.

In the tree view, mark the clone and edit its placement (the placement is relative to the
parent contact). Set the placement X translation to 14.25 mm (Figure F-34).

● 456

FreeCAD for Electronics Applications.indd 456 24-08-2023 14:31


Appendix F ● The IEC Power Inlet

Figure F-34

In the tree view, mark all contacts and set their appearance to 'Chrome'. Save your work.

● 457

FreeCAD for Electronics Applications.indd 457 24-08-2023 14:31


FreeCAD for Electronics Applications

Appendix G ● The 9 V Block (6F22) Battery

Start a new file and save it as '9V Block Battery'. Switch to the 'Part Design' workbench. In
order to create the parent Std-Part-Container, click the yellow 'Create Part' tool button, and
rename that to '9V Block Battery Complete'. Then, create the body for the battery casing
by clicking the blue 'Create body' tool button, and rename that to 'Battery' (Figure G-1).

Figure G-1

With the larger distributors of electronic parts, you can find data sheets with mechanical
drawings for the 9V block battery, commonly designated as type 6F21 or PP3. The me-
chanical dimensions are given with tolerance. You could use the upper tolerance limits for
height, width, and thickness. It does not matter much which of the sources you take — the
numbers are almost identical.

In order to draw the battery body, click the 'Sketcher' tool button from the workbench
menu. When no plane is preset (e.g., by marking it with a click in the 3D view), a task win-
dow opens in which the sketch plane has to be selected. Select the XZ plane for the sketch
and close the task with the OK button.

If not already preset, in the panel 'Solver Messages', check the boxes for 'Auto remove
redundant' and 'Auto update', which is somewhat helpful (Figure G-2).

● 458

FreeCAD for Electronics Applications.indd 458 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

Figure G-2

From the sketcher menu, select the 'Create Rectangles | Create a rectangle' tool button and
draw a rectangle with one side coinciding with the X-axis. End the drawing command by a
right click (Figure G-2, G-3).

From a horizontal side of the rectangle, mark the two end points. Then, mark the vertical
axis. From the sketcher menu, select the 'Constrain symmetrical' tool button. (Figure G-3).

● 459

FreeCAD for Electronics Applications.indd 459 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure G-3

Mark one horizontal side of the rectangle and click the 'Constrain horizontal distance' tool
button. In the appearing dialog, enter 26.5 mm (the maximum width from the data sheet,
Figures 4 and 5).

Figure G-4

● 460

FreeCAD for Electronics Applications.indd 460 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

Figure G-5

Similarly, mark a vertical side of the rectangle and select the 'Constrain vertical distance'
tool button. Enter 17.5 mm for the height. Now the rectangle is displayed in bright green as
fully constrained. Close the sketcher task window with the 'Close' button on top.

With these dimensions, the battery will eventually have a loose fit in the holder. It would
also be possible to set the dimensions to the center of the tolerance fields (then, some bat-
teries could be difficult to insert). As another solution, some thin, elastic tape on the inside
surfaces of the battery holder might help to accommodate all the cases.

In the tree view, mark the coordinate system of the body 'Block Battery', and show it with
the SPACE key. In the 3D view, click 'into the blue' to deselect the coordinate system, and
then once onto the XZ plane (to select only that, will turn green). Then, click the 'Create a
datum plane' tool button. Thereby, the new datum plane shown is already attached to the
XZ plane. In the attachment offsets, enter the battery height from the data sheet, which
amounts to 46.6 mm (Figure G-6). Finally, close the task window with the OK button on
top.

● 461

FreeCAD for Electronics Applications.indd 461 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure G-6

It is somewhat counter-intuitive that the Z offset has to be used — as the Z axis of the
coordinate system is pointing upwards. The 'Z' designates here a coordinate local to the
datum plane and is therefore aligned parallel to the normal vector of the plane (orthogonal
to the plane).

In the tree view, rename the new datum plane to 'Battery End Face'.

In the tree view, mark the sketch with the rectangle, then click the tool button 'Pad' (Figure
G-7). A task window opens. Select the pad type as 'Up to face' and click the datum plane in
the 3D view (Figure G-8). Close the task window with the OK button (top).

● 462

FreeCAD for Electronics Applications.indd 462 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

Figure G-7

Figure G-8

● 463

FreeCAD for Electronics Applications.indd 463 24-08-2023 14:31


FreeCAD for Electronics Applications

At the top of the battery, create a recessed plane for the contacts. The outline needs to
be sketched onto the top of the pad. Click the datum plane 'Battery End Face' and then
the 'Sketcher' tool button (Figure G-8 steps 5 and 6). When the sketch opens for the first
time, the other geometry is not shown. Close the sketch task window and reopen it by dou-
ble-clicking on the new sketch in the tree view, to display everything.

To enable references to the batter casing, click the 'External geometry' tool button (Figure
G-9). Then, click the 4 sides of the casing end face. The sides appear in violet, indicating
that they can be referred to by the sketch.

Figure G-9

In order to draw the recessed area outline, click the 'Create a rectangle' tool button and
draw a rectangle into the area bounded by the violet lines (Figure G-10, step 1). The exact
position of the corners is not yet important. End the drawing command with a right click.

Mark the two lower corners of the rectangle, then the vertical center line and select the tool
button 'Constrain symmetrical' (Figure G-10, steps 2 and 3).

● 464

FreeCAD for Electronics Applications.indd 464 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

Figure G-10

Mark two adjacent corners of the nested rectangles (Figure G-10, step 4) and click the
'Constrain vertical distance' tool button. For the rim thickness, enter 1.2 mm in the pop-up
dialog, and close that with the OK button (same figure, steps 5 and 6).

In the same manner, mark the two corner points again and set the horizontal distance to
1.2 mm as well. Because of the symmetrical constraint, the condition is set on both sides
simultaneously (Figure G-11).

As the last degree of freedom, fix the distance at the bottom: Mark two adjacent corner
points and set the vertical distance to again 1.2 mm. The sketch is now fully constrained
(Figure G-11). Close the task window with the 'Close' button on top.

● 465

FreeCAD for Electronics Applications.indd 465 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure G-11

In the tree view, mark the new sketch and click the 'Pocket' tool button (Figure G-12). A
task window opens. Leave the pocket type at 'Dimension' and change the length to 1 mm.
Close the task window with the OK button (top).

Figure G-12

● 466

FreeCAD for Electronics Applications.indd 466 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

In the 3D view, hide the datum plane 'Battery End Face' by marking it with a click and
pressing the SPACE key.

Now you need another reference plane for the battery contacts. In the 3D view, again
mark the XY plane of the coordinate system and click the tool button 'Create datum plane'.
For the distance from the bottom of the battery, you take the total height from the data
sheet, which amounts to 49 mm. Enter that value into the attachment offset field for the z
direction. Close the task window and rename the new datum plane to 'Contacts End Face'.

The contacts are drawn and extruded to pads from this plane. In the tree view, mark the
new datum plane (to preset it as the sketching plane) and click the sketcher tool button.
The sketch opens, but the view is still empty. Close the sketch right away and reopen it by
a double click in its tree view item line. Then, the battery geometry that is already present
will be displayed.

In order to draw the (simplified) contacts, click the 'Create circle' tool button and draw two
circles, into approximate position, and with arbitrary radius (Figure G-13). End the drawing
command with a right click.

Figure G-13

To set both circles to the same diameter, mark both of them and click the 'Constrain equal'
tool button (Figure G-14, step 1).

● 467

FreeCAD for Electronics Applications.indd 467 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure G-14

Then, mark both center points of the circles and the vertical center line. Click the 'Constrain
symmetrical' tool button to equalize the distances of the contacts from the battery center.
(Figure G-14, step 2).

In the Combo View, scroll down to display the 'Elements' list. Right-click one of the circles
and select 'Diameter constraint' from the context menu (Figure G-14, step 3). Set the di-
ameter to 8 mm, this approximate measure is sufficient for further work.

Mark the two center points of the circles and click the 'Constrain horizontal distance' tool
button. Set the horizontal distance to a value taken from the data sheet, 12.95 mm.

The distance of the contacts to the long side of the casing is still missing. Mark one of the
center points and the origin of the coordinate system. Click the 'Constrain vertical distance'
tool button and set the distance to 8.75 mm, which is half of the battery thickness taken
from the data sheet. The sketch is now shown in bright green, as fully constrained (Figure
G-15). Close the task with the 'Close' button (top).

● 468

FreeCAD for Electronics Applications.indd 468 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

Figure G-15

In the tree view, rename the new sketch to 'Contacts Profile'.

In the tree view, mark the new sketch and click the 'Pad' tool button. An error message is
thrown:

'Recompute failed! Please check report view. '

The generation of the contacts would eventually result in several material pieces – this is
currently not supported. If the contacts are defined such that they are connected with the
battery body, this error can be avoided:

In the task window, select the Type 'To first' (= next object face), and check the 'Reversed'
checkbox below (Pads want to grow into positive direction, usually). (Figure G-16, step 3).
With this resolution, the contacts successfully appear in the 3D view. Close the task window
with the OK button.

● 469

FreeCAD for Electronics Applications.indd 469 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure G-16

In the tree view, hide the datum plane 'Contacts End Face' and the coordinate system
'Origin001'.

Holding down the CTRL key, mark the 4 long edges of the battery casing, as well as the
edges at the bottom. Then, click the 'Fillet' tool button. In the task window, enter for the
radius 1.2 mm (Figure G-17).

● 470

FreeCAD for Electronics Applications.indd 470 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

Figure G-17

Then, mark one edge of the inner and outer contour of the battery top face, as well as
one of the bases, and click again on the 'Fillet' tool button (Figure G-18). Set the radius to
0.35 mm. If the radius is too large to be generated, error messages will be issued.

● 471

FreeCAD for Electronics Applications.indd 471 24-08-2023 14:31


FreeCAD for Electronics Applications

Figure G-18

The battery body can now get a more appealing color. In the tree view, right click it and
select 'Appearance' from the context menu. Set the 'Material' property to aluminum, and
the color to dark blue.

Now, the whole battery appears painted. Because it will not change anymore, you can color
some facets. In the tree view, right-click the tip, and select 'Set colors…' from the context
menu. A task window then opens.

Click the base plate below the contacts. In the task window, a color selection window is
open. Click the button, which shows the actual blue color and set the facet color to black.
In the same way, set the contact facets color to light gray.

Close the task window. Now the battery is ready to be used in other designs (Figure G-19).

● 472

FreeCAD for Electronics Applications.indd 472 24-08-2023 14:31


Appendix G ● The 9 V Block (6F22) Battery

Figure G-19

● 473

FreeCAD for Electronics Applications.indd 473 24-08-2023 14:31


FreeCAD for Electronics Applications

Index

A Constrain point onto object 394, 405


activate 12, 21, 193 Constrain radius 435, 440
activated state 21 Constrain symmetrical 64, 177, 225, 248,
Add Balloon Annotation 84 267, 387, 389, 436, 459, 464, 468
Add center line to faces 76 Constrain tangent 424, 437
Add Circle Center lines 77 Constraint preserving sketch fillet 433, 440
Additive loft 363, 366, 373, 401 Constrain vertical distance 214, 461,
Add view 83 465, 468
Appearance 34, 35, 189, 334, 339, Create a centered rectangle 90, 330,
347, 353, 372, 374, 391, 398, 419, 472 332, 385
Assembly 88, 89 Create a clone 420
associative footprint 96 Create a datum plane 178, 211, 256,
associativity 16, 18, 51, 89, 102, 329, 348, 362, 400, 413, 461
147, 174, 253, 275, 361 Create a Datum Plane 43
attachment 11, 23 Create an equilateral triangle 376, 405
attachment mode 17, 41, 43, 49, 51, 111, Create arc 162, 427, 439, 446
119, 123, 131, 139, 185, 204, 211, 217, Create a rectangle 108, 181, 459, 464
234, 236, 281, 283, 289, 329, 338, 361 Create a shape binder 215, 232, 253, 272,
attachment offset 41, 43, 348 279, 287
attachment parameters 222 Create a sub object(s) shape binder 96,
attachment relation 17, 39, 113, 359, 392 109, 120, 126, 131, 136, 143, 182, 193,
194, 207, 208, 238, 245, 293, 359
B Create body 327, 384, 416, 458
bending plan 83, 84 Create circle 30, 327, 340, 467
BoltsFC 36 Create line 411
BOLTS Parts selector 36, 281, 392 Create Part 458
Box selection 415 Create regular polygon 357, 429
Create slot 452
C Current working plane 165
Chamfer 329, 450 Curves are not coplanar 120
clone 113
Clone 456 D
Concentric 41, 49, 51, 139, 281, 283, 289 Dependency graph 42
Constrain angle 152, 161, 425, 442 Diameter constraint 150, 344, 383,
Constrain coincident 377 417, 435, 468
Constrain diameter 249 Diameter Constraint 31, 65, 269,
Constrain distance 377 327, 341, 401
Constrain equal 156, 163, 218, 228, 249, discontinuous display 37, 372
266, 269, 343, 382, 386, 435, 437, 467 “Draft” workbench 165
Constrain horizontal distance 90, 156, 177, Draft workbench 210
219, 330, 336, 383, 386, 460, 468 DXF 71, 73, 148, 159, 170, 171
Constrain parallel 154, 161
Constrain point on abject 332 E
Constrain point on object 417, 425 engraving 11, 53, 148, 170, 175

● 474

FreeCAD for Electronics Applications.indd 474 24-08-2023 14:31


Index

Engraving 165, 199, 210 P


External geometry 63, 107, 149, Pad 32, 45, 179, 215, 219, 327, 328,
159, 181, 225, 257, 266, 331, 343, 375, 333, 336, 342, 345, 348, 371, 386, 393,
389, 394, 396, 435, 442, 464 401, 413, 419, 431, 440, 449, 462
F placement 16
Fillet 68, 274, 345, 414, 447, Placement 17
452, 470, 471 “Placement“ property 16
Format Specifier 80 Plane face 329
fully constrained 157, 177 Plane Face 43
Pocket 65, 118, 121, 196, 208,
H 209, 250, 264, 350, 352, 368, 390, 395,
hide 14, 52, 53 397, 403, 407, 441, 446, 453, 466
Hole 128, 162, 220, 222, Polar pattern 407
228, 238, 246, 269, 272, 273, 293, 388 Polar Pattern 379, 396, 398

I R
Insert Annotation 81 relation 199
Insert Default Page 71 relief 62
Insert Diameter Dimension 80 Remove Cosmetic Object 83
Insert horizontal dimension 78 Revolution 427
Insert Page using Template 170
Insert Radius Dimension 80 S
Insert View 170 Select Face button 365
Set colors 415
L Set Colors 36
Linear Pattern 251, 264, 333 Shape from text 165, 200
Link placement 188, 207, 244, 291 Shape String 166
Link Placement 115 Sheet Metal 54, 252
Link transform 188, 207, 244 Subtractive 378
Link Transform 115 Subtractive loft 373
Subtractive Pipe 379
M Support 17, 24, 26, 48
Make Base Wall 58, 259 Symmetric to plane 264, 352
Make face 144
Make link 113, 124, 140, 142, T
186, 243, 290, 391 TechDraw 71
Make Wall 59, 260 Thickness outside 261
Map Mode 49 Through all 98, 118, 128, 133,
Material 34, 36, 334 197, 209, 352, 388
“Material” property 472 Toggle active body 36
Mechanical Drawing 74 Toggle construction line 151, 417, 423, 437
Mirrored 67, 370 Toggle Construction Line 411
Toggle frames 75, 81
O Toggle Frames 72
Output Window 15, 18, 42 Trace Support 21, 217, 287
transparency 374

● 475

FreeCAD for Electronics Applications.indd 475 24-08-2023 14:31


FreeCAD for Electronics Applications

Trim edge 153, 411, 418


Two dimensions 348, 350

U
Unfold 69
Up to face 45, 180, 219, 365, 368, 393

X
XY on plane 49, 111, 119, 123, 131,
204, 236, 338, 361

● 476

FreeCAD for Electronics Applications.indd 476 24-08-2023 14:31


>

books
books books
books

FreeCAD for Electronics Applications – Dr. Thomas Duden


FreeCAD for
FreeCAD for
Electronics Applications Electronics Applications
Practical Introduction to 3D Modeling
Practical Introduction to 3D Modeling from
from Enclosure to Front Panel
Embedding a vintage component, creating a professional looking home Thomas Duden studied Physics
Enclosure to Front Panel
for a circuit board, or even designing a complex apparatus complete in Clausthal-Zellerfeld, where
he also received his PhD. For
with a chassis – these and many other challenges turn into a stimulating
research purposes, the experiments
pleasure with FreeCAD. Once you have internalized the basic processes, required the design of many
there are virtually no limits to your imagination. instruments. These developments
also included electronics (mainly
Starting to use a new software is never straightforward – especially with stable high voltage and current
sources), programming of PCs
a tool as versatile as FreeCAD. Manageable, but at the same time easily
and microcontrollers plus the
usable individual components provide the starting point in this book. calculation of electron-optical
Putting these components together later results in assemblies. components with their aberrations.
Meanwhile, mechanical designs
In the FreeCAD universe, a workable trajectory is demonstrated. The covered ultrahigh vacuum systems,
components for electron microscopy
described procedure is illustrative so the examples are easily applied
and diffraction instruments, often
to custom tasks. The devices were made by the author and illustrated in combination with spin-polarized
with photos. electron beams. Longer work
phases abroad took place at the
Creating a 3D design is requiring some effort but the initial investment pays IBM Almaden Research Center
(San Jose), at Arizona State
off soon. Besides the impressive spatial representation of the projects, the
University, and at the National
extracted drawings yield a solid base for documentation and production. Center for Electron Microscopy of
Extended FreeCAD capabilities like the unfolding of sheet metal parts the Lawrence Berkeley National
enormously add to efficiency and pushes models forward into practical Laboratory. Thomas Duden obtained
assembly. his ham radio license at the age of 16
and currently operates a consulting
service for the development of
Soon you will definitely not want to do without FreeCAD! scientific instruments.

www.elektor.com

Dr. Thomas Duden

SKU20591_COV_FreeCAD for Electronics Applications.indd All Pages 29/08/2023 11:31

You might also like