Code Monkey home page Code Monkey logo

freecad_mod_dev_guide's Introduction

Module developer's guide to FreeCAD source code

by Qingfeng Xia 2016~

by Luzpaz 2019~

download the latest version from pdf folder of this repo

  • 2015-09-18 version 0.1 for FreeCAD version 0.16-dev

  • 2016-09-18 version 0.2 for FreeCAD version 0.17-dev

  • 2019-06-18 start again to work towards version 0.3 for FreeCAD version 0.19-dev

Plan and progress

This book should be updated for the recent release, esp. after migration to Python3 + Pyside2. I plan another release for FreeCAD 0.19 dev near Xmas time.

Chinese translation(中文翻译)

FreeCAD模块开发指南 第1章 FreeCAD概述和软件架构

FreeCAD模块开发指南 第2章 FreeCAD源代码结构

Similar as FreeCAD document license CC-BY 3.0

This ebook is licensed as Attribution-ShareAlike 4.0 International

see the full text in this repo and also online https://creativecommons.org/licenses/by-sa/4.0/ In short, this license let you

Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material for any purpose, even commercially.

Just request: share your derived work(share-alike) and credit the author (attribution)

Acknowledge to developers of FreeCAD

Original/lead developers:

Add all contributors see https://www.freecadweb.org/wiki/Contributors

Target audiences: new module developers

Make sure you are familiar with FreeCAD workbench GUI and API as a user:

Doxygen documents links

Doxygen generated online documentation of source for 0.16dev, will be delete soon

Doxygen generated online documentation of source for 0.19dev on 2019-06-24

Why I want to write this book

  • Learn the software architecture of FreeCAD: a large open source project
  • Learn to use git to contribute to open source projects like FreeCAD
  • Save time for new developers to explore the source code of FreeCAD
  • Record personal note and lesson during writing/contributing code to FreeCAD
  • Some chapters of this ebook is seeking to be merged into official wiki after reviewed as usable

My research: "Automated and Intelligent Engineering Design"

How to contribute to this ebook

  • write on unfinished topics/chapters listed in todo.md fork and pull request git clone https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide.git

  • file bug for outdated code analysis As this book is about code analysis while FreeCAD is under heavy development, source codes quoted may outdated quickly. Please point out my report bugs in this github issues board

  • This ebook is pre-processed by a python script, see more details in the scripts folder's Readme.

    There are some anchor texts like:

    • [src/*.h/cpp] are processed into link to the latest official FreeCAD source.
    • some another anchors "## folders ... ", which will be marked out soon more explicitly

Acknowledgement to my family

This work is not funded to my employers (Oxford Unviersity, UKAEA) by the time 2019. It is a community voluntary work, thank every one review, contribute to this book.

Qingfeng Xia thanks for my wife Ms J. Wang, and other family members' for the housework exempt to complete this work.


freecad_mod_dev_guide's People

Contributors

luzpaz avatar qingfengxia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freecad_mod_dev_guide's Issues

new module import mechanism

all third-party module can be inserted into freecad package

from pkgutil import extend_path

see example in Plot module, init

it will affect Mod folder structure

Type system clarification

Regarding this chapter: https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide/blob/master/chapters/3.FreeCAD_Base_App_modules.md#type-baseclass-pyobjectbase

Instead of listing the code, it would be more useful to document the purpose of the type system and how it's being used.

See my investigation here:
FreeCAD/FreeCAD#3802 (comment)

I think the main reason for this is serialization and code inspection. So that document object instances can be created from strings stored in a FCStd file, and object instances be inspected in a Python console. And more importantly, to decouple C++ implementation from the UI appearance (Property and type names in a view toolbar).

I don't think it has anything to do with reference counting, outside the PyObject exports, does it?

A more practical use case is the TypeId and addObject implementation. Using addObject from Python you can create instances of C++ classes and map them to the Python type system.

As most of workbenches are developed in Python nowadays, there should be some recommendation on how to identify object types. E.g.:

You may use TypeId if you want to use document object properties
You must use isinstance to determine that the object has a particular method, as TypeId can be re-implemented by a different class

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.