diff --git a/python_scripting/a_gentle_introduction.md b/python_scripting/a_gentle_introduction.md index 86a4554..16eeea7 100644 --- a/python_scripting/a_gentle_introduction.md +++ b/python_scripting/a_gentle_introduction.md @@ -101,6 +101,26 @@ otherpla.Base = FreeCAD.Vector(5,5,0) box.Placement = otherpla ``` +Placement can be a difficult concept to grasp at first. Calling FreeCAD.Placement, you can optionally enter in position, rotation, and center values. This will generate you a placement matrix. + +For example, + +``` +yaw = 3.5 +pos = App.Vector(0, 0, 0) +rot = App.Rotation(yaw, 0, 0) +center = App.Vector(0, 0, 0) +newplace = App.Placement(pos, rot, center) +``` + +After that, you can alter your placement matrix by multiplying it, + +``` +pitch = 2.3 +rot = App.Rotation(0, pitch, 0) +newplace = App.Placement(pos, rot, center).multiply(newplace) +``` + **Read more** * Python: https://www.python.org/ diff --git a/working_with_freecad/generating_2d_drawings.md b/working_with_freecad/generating_2d_drawings.md index e9ce681..17e5ef5 100644 --- a/working_with_freecad/generating_2d_drawings.md +++ b/working_with_freecad/generating_2d_drawings.md @@ -70,6 +70,9 @@ Our page can now be exported to SVG to be worked further in graphical applicatio * The file created during this exercise: https://github.com/yorikvanhavre/FreeCAD-manual/blob/master/files/drawing.FCStd * The SVG sheet produced from that file: https://github.com/yorikvanhavre/FreeCAD-manual/blob/master/files/drawing.svg +**Scripting with 2D Drawings** +To script with 2D drawings can be a challenging process. For the moment we will discuss this with the 0.16 version of FreeCAD. In general, you can only place one part onto the sheet, so you will need to recursively compound your various parts into 1 part. The second difficulty in producing automated drawings is in the placement of the views. In general there is a way to dump SVG of 1 view, but not of all the views at once. As such, you need to selectively dump the SVG of the views you are after, and then place them onto the SVG of the drawing sheet with SVG methods. + **Read more** * The Drawing Workbench: http://www.freecadweb.org/wiki/index.php?title=Drawing_Module