FreeCAD Logo FreeCAD 1.0
  • English Afrikaans Arabic Belarusian Catalan Czech German Greek Spanish Spanish Basque Finnish Filipino French Galician Croatian Hungarian Indonesian Italian Japanese Kabyle Korean Lithuanian Dutch Norwegian Bokmal Polish Portuguese Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish Ukrainian Valencian Vietnamese Chinese Chinese
  • Features
  • Download
  • Blog
  • Documentation
    Documentation index Getting started Users documentation The FreeCAD manual Workbenches documentation Python coding documentation C++ coding documentation Tutorials Frequently asked questions Privacy policy About FreeCAD
  • Contribute
    How to help Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Translations
  • Community
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Please set up your SEPA bank transfer to:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank agency: BNP Paribas Fortis
Address: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Drawing Documentation

This page documents jcc242\'s understanding of the Drawing module. It includes files and features that he is currently working on and may not yet be in the master branch. The source for those files is on his Github, but be careful as that is very unstable!

Base (Mod/Drawing)

gdtsvg.py

Python script that generates svg snippets for things such as gd&t symbols, dimension symbols, and basic svg elements such as lines, circles, and paths.

It has several support files that don\'t really do much. Run DrawingTest.py to create a bunch of svg icons in the icon directory that previews various icons in the gdtsvg.py file. settingslist.py and dimesettings, and convert.py are all deprecated from older settings methods and should probably be removed as the Drawing branch approaches merging into master.

DrawingAlgos.py

Creates svg lines from a list of vertices, supports both hidden and visible edges. Should probably be merged with gdtsvg.py as that file matures.

createSVG

Accepts part as an argument, projects the part into lines from the Drawing.project object and then draws creates the svg for each line.

App

Contains the backend side of the drawing module.

AppDrawing.cpp

Initializes the various namespaces and modules and stuff used in the drawing module. Will throw an error if it cannot load the Part module.

DrawingExport.cpp

Two classes: SVGOutput and DXFOutput. They both contain methods to put out the code in their respective language. Typically require an object of the appropriate typedef, and sometimes some additional identifier information.

FeatureClip.cpp

Callback (?) methods for the feature clipping gui, so it would seem. Called alone it will create the clip path, if ShowFrame.getValue is TRUE set it will show the frame border as well.

FeaturePage.cpp

Manages the views.

onChanged() for doing stuff when properties get changed.

execute() for recalculating a feature view, or so it claims. It seems to have stuff for checking for editable texts and saving drawings. Need to investigate further.

getEditableTextsFromTemplate() for retrieving text that can be edited by FreeCAD from an SVG file.

FeatureProjection.cpp

Flattens object to a 2D image?

FeatureView.cpp

Defines the properties for views.

FeatureViewAnnotation.cpp

Defines properties for annotations (right now just text), has an execute method to update the text if changed/moved.

FeatureViewPart.cpp

Constructor to add properties. Gets appearance stuff for projected parts.

PageGroup.cpp

Just adds a property for a list of pages, does not much else.

Precompiled.cppp

Just #include \"PreCompiled.h\"

ProjectionAlgos.cpp

The constructor just runs the execute() method to update it\'s stuff

invertY: since SVG does its y-axis backwards to every other coordinate system in the world, we must invert it when converting from a FreeCAD part to an SVG projection for the Drawing view.

getSVG: fetches the SVG code from the DrawingExport stuff. Formats depending on type of line (hidden or not and some other stuff I need to figure out).

getDXF: same as getSVG except for DXF format.

Gui

AppDrawingGui.cpp

Initializes the drawing gui.

AppDrawingGuiPy.cpp

Provides opening, importing, and exporting interfaces? Looks like it is python accessible.

Command.cpp

Handles commands (from the toolbar?) such as creating new drawings and stuff. It looks like this handles QT calls from clicking the button to whatever command it needs to go to e.g. clicking the CmdDrawingOrthoViews button will show the Ortho views gui in the task dialog spot.

DrawingView.cpp

Does a bunch of qt gui stuff, need to read more on it.

TaskDialog.cpp

Creates the task dialog thing on the side and probably switches to it from the tree view, as appropriate.

TaskOrthoViews.cpp

Creates the task dialog for placing the orthographic views!

Does a lot of the calculations for where to position stuff (automatic calculations as well, it seems).

Takes the input from the TaskOrthoViews gui and does stuff with it. Uses the single inheritance method talked about on the qt website.

ViewProviderPage.cpp

Constructor adds some properties for the view stuff. Destructor does nothing. Attaches something (attaches what? attaches the view to the page?) sets and gets display modes (what are display modes? what do they do and what are possible options?) Does something about updating some kind of data has a context menu that says \"Show drawing\", figure out what this means Has a thing for double clicking to select the view (I think?)

showDrawingView seems to do some work on settings things up: gets the current document, sets the window icon and title, adds it to the main window (of FreeCAD?)

ViewProviderView.cpp

Doesn\'t seem to do much, though I am sure it is important.

Workbench.cpp

Adds the icons to the toolbars and stuff.

Workflow

Program Flow

CanvasView is the actual QGraphicsScene object and DrawingView processes a list of FeatureView that are linked by reference in /App/FeatureViewPage. DrawingView then chooses the appropriate QGraphicsItem class (QGraphicsItemViewPart or QGraphicsItemViewDimension) and then calls a function in CanvasView to create this and add it to the scene.

Adding commands to the Drawing Workbench

4 simple steps:

  1. Add a class to Command.cpp. Follow the others for an example of the formatting.
  2. Add a title, icon, tooltip, etc., again, follow the existing classes in command.cpp
  3. Add your class to the bottom of Command.cpp
  4. Add your information to Workbench.cpp, this will tell FreeCAD/Drawing module where to place the icons defined in command.cpp in the actual freecad interface (the toolbars, dropdowns, etc.)

{{Drawing Tools navi}}


⏵ documentation index > Developer_Documentation > Drawing > Drawing Documentation

This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/Drawing_Documentation.md

Get in touch!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub