Skip to content

Macros to generate 'plastic toy brick' models in FreeCAD

License

Notifications You must be signed in to change notification settings

vectronic/freecad-legify-macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freecad-legify-macros

Macros to generate 'plastic toy brick' models in FreeCAD

Why?

This is a learning exercise undertaken to master the following:

  • FreeCAD and concepts for parametric modelling: sketches, constraints, datum planes etc.
  • Python and scripting with FreeCAD
  • Detailed modelling of toy bricks

These all form the basis of a future planned project...

NOTE: This is no longer actively developed as I have learnt enough. The main lesson being that using Python scripts to create parametric models in FreeCAD is quite possibly insane!

Installation

Tested with FreeCAD version 0.20 beta

MacOS

  1. Clone this repository:

    git clone https://github.com/vectronic/freecad-legify-macros.git

  2. Link the cloned folder and macro files into the FreeCAD macros directory:

    ln -s <absolute path of cloned repository>/Legify <absolute path of user preferences folder>/FreeCAD/Macro/
    ln -s <absolute path of cloned repository>/legify-brick.FCMacro <absolute path of user preferences folder>/FreeCAD/Macro/
    ln -s <absolute path of cloned repository>/legify-technic-pin.FCMacro <absolute path of user preferences folder>/FreeCAD/Macro/
    

NOTE: On MacOS the typical location for the user preferences folder is /Users/<username>/Library/Application\ Support.

Usage

Create a new brick model

  1. Create a new document
  2. Run the legify-brick.FCMacro
  3. Modify parameters as desired in the popup dialog
  4. Click OK
  5. Wait for a lot of sketches, constraints, pads, pockets and fillets to be rendered...
  6. Admire the resulting beauty!

Add a technic pin to the face of a body

  1. Within the Part Design workbench, create a body.
  2. Create a datum point on an existing face representing the centre point of the base of the pin.
  3. Create a datum point extended 8mm from the normal to the face representing the centre point of the tip of the pin.
  4. Create a datum line supported by the base datum point and the tip datum point in that order.
  5. Select the body and select the datum line.
  6. Run the legify-technic-pin.FCMacro

TODO

Screenshots

Parameters

Simple

Classic

Odd

Tree View

Technic Pin

Sketch

Technical Drawing 1

Technical Drawing 2

Credit

Initial drawing and dimensions used as reference for this work was done by Nick Turo-Shields

About

Macros to generate 'plastic toy brick' models in FreeCAD

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages