Skip to content

Commit

Permalink
Merge pull request #10 from uuykay/master
Browse files Browse the repository at this point in the history
added some more information about placements and placement matrices
  • Loading branch information
yorikvanhavre committed May 8, 2019
2 parents 78faef7 + d6fdbb6 commit 6e6a767
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions python_scripting/a_gentle_introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
3 changes: 3 additions & 0 deletions working_with_freecad/generating_2d_drawings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e6a767

Please sign in to comment.