When adding a view to a TechDraw page, it can easily be aligned to the drawing plane, by selecting a flat face and then adding it to the page.
However, I didn't find a way to align the view around the viewing-axis orthogonal to the drawing plane. Is there such a possibility, or is it worth a feature request?
Example:
Given this object ...
... I want to place the selected face on a TechDraw page so that it is aligned with the sides horizontally/vertically. This is what I get:
It would be great, if in addition to the object I could select a line indicating the horizontal orientation.
Alignment of view around the view axis
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Alignment of view around the view axis
- Attachments
-
- tiltedCube.FCStd
- (10.08 KiB) Downloaded 24 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Alignment of view around the view axis
Greetings to the Community!
Of course having this possibility would be good, however until the specific function arrives, currently it can be done as shown in the animated gif but it would become laborious to derive the exact sections.
So the new function should take into account the new alignment to obtain the correct sections.
Of course having this possibility would be good, however until the specific function arrives, currently it can be done as shown in the animated gif but it would become laborious to derive the exact sections.
So the new function should take into account the new alignment to obtain the correct sections.
- Attachments
-
- Alignment_tiltedCube_TechDraw.gif (278.01 KiB) Viewed 571 times
Re: Alignment of view around the view axis
Thanks for the workaround! (It works here for the most common case where one of the lines on the drawing should be aligned. For an automated function, it would be nice to go beyond that, and allow any line from the 3D model as well.)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- wandererfan
- Veteran
- Posts: 6321
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Alignment of view around the view axis
Code: Select all
view = App.ActiveDocument.View
# method 1 - angle is known & top view
import math
angle = math.radians(30)
cos = math.cos(angle)
sin = math.sin(angle)
newX = App.Vector(cos, sin, 0.0)
view.XDirection = newX
# method 2 - edge (line) is selected. should work for general case.
sel = Gui.Selection.getSelectionEx()
edge = sel[0].SubObjects[0] # first subelement of first selected object
view.XDirection = edge.Curve.Direction
Re: Alignment of view around the view axis
Thanks! That's much better than the eyeballing I did until now .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.