Drawing Documentation

From FreeCAD Documentation
Revision as of 02:04, 11 January 2013 by Jcc242 (talk | contribs)

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

What is all this? Find out tomorrow as I decipher it!