FreeCAD Programming: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
Line 38: Line 38:
*Unit tests - arrange, act, assert.
*Unit tests - arrange, act, assert.
*[[FreeCAD Workbench Python Programming]]
*[[FreeCAD Workbench Python Programming]]
*REPL - read-evaluate-print loop

Revision as of 23:59, 2 May 2020

Overview

edit

Programming New Workbenches in FreeCAD

One Paragraph Introduction by Ruslan Krenzler

FreeCAD Kernel

Links

Notes from G

  • Keeping 3D programming in mind - understanding what you are working with in 3D space
  • Label code and functions according to orientation
  • Adding toolbars is easy
  • To start a FreeCAD workbench...

Starting a Bench

  • Start by knowing what you need to do.
  • Understand a Command concept in FreeCAD
  • Understand geometry
  • Command is a thing that gets executed withing FreeCAD
  • Hard part was figuring out how to program the geometry
  • The more details in geometry
  • User selects an objects. Ex. .length.object gets you length
  • Navigating the code base - going through many files.
  • Using Docker to run unit tests. Docker creates an application environment, without installing FreeCAD or python modules
  • One Docker instance does the test runs. How long did it take to set up Docker.
  • But for a novice, it's easy enough to install the app and work from there.
  • Access Docker documentation from G's documentation.
  • Docker runs on laptop - https://docs.docker.com/engine/install/ubuntu/
  • Workflow - branch on laptop, push it, do tests, on a server environment without GUI.
  • FreeCAD - has app - command line, and there is the GUI part
  • You can test for - ex. select a face of a frame, you can find out the xyz parameters, etc. If need transformation
  • G used Visual Studio Code. There is an OSalt.
  • Unit tests - arrange, act, assert.
  • FreeCAD Workbench Python Programming
  • REPL - read-evaluate-print loop