Posted on 2 Comments

FreeCAD – SketcherShapes Workbench

The SketcherShapes Workbench is my attempt to add an “easy” way to insert custom and commonly used shapes. It is an early attempt at a workbench and is not intended for any production or regular use. It is mostly an experiment and a learn to code playground.

Why a Workbench and not just add to a Parts library?

The simple answer is that these are not parts. They are intended to be aides in creating parts. So basically these will always be 2d shapes with loosely defined defaults.

The Shapes

  • Rounded Square
  • Centered Square
  • Trapezoid
  • Parallelogram
  • Keyhole
  • Linking Bar
  • Arrow
  • Saw-tooth
  • Plus Sign
  • Four Holes
  • PCB Edge Mount
  • Mini USB

Adding New Shapes

New shapes are added via a rudimentary code generator tool. It creates code, tool bar and menu entries and eventually an icon. This feature is not yet exposed. In order to add new shapes to code, it is necessary to add the class to the init_gui.py. An attempt was made, with some success, to iterate a folder for classes. There were some issues, however.

Editing Shapes

Shapes are edited by adding a shape via Toolbar or menu then re-running the code generator

Removing Shapes

To remove a shape currently the code for that shape needs to be removed. This would include code in the init_gui.py class.

Icon Generation

The icon generator, not even close to working, will attempt to create an SVG from the sketch with a little bit of styling.

Project Source

https://gitlab.com/mathcodeprint/sketchershapes

Installation

You will need to copy the workbench into your FreeCAD/mods directory.

2 thoughts on “FreeCAD – SketcherShapes Workbench

  1. is this workbench available to download?

    1. Hey Andrew, it is on GitLab. I need to add a link to the page. But my GitLab account is mathcodeprint, here is the link: https://gitlab.com/mathcodeprint/sketchershapes.git
      Also, I will be doing an update in about a week. Let me know if you have any trouble. It is very rough code.

Leave a Reply