How to align tilted parts

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

How to align tilted parts

Post by thschrader »

Hi,
I have a steel part (strut-connection, green), which is rotated among
the z-axis. When loading the part in techdraw, I get an isometrie.
How can I get a planar view? By calculating the normal-vector
of the green face and adjusting in techdraw? Or is there a smarter way
I dont know?
system:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14098 (Git)
Build type: Release
Branch: master
Hash: 0c33d00bfdf8270e7e5b33d792bf0ad9bbbfc819
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
strut_connection1.JPG
strut_connection1.JPG (47.11 KiB) Viewed 1799 times
strut_connection2.JPG
strut_connection2.JPG (117.89 KiB) Viewed 1799 times
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: How to align tilted parts

Post by thschrader »

Copy parts to load in techdraw, use workfeatures-macro
to align parts along y-axis, load in techdraw. Not very elegant,
but it works.
strut_connection3.JPG
strut_connection3.JPG (70.34 KiB) Viewed 1796 times
strut_connection4.JPG
strut_connection4.JPG (38.98 KiB) Viewed 1796 times
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: How to align tilted parts

Post by wandererfan »

thschrader wrote: Sun Aug 12, 2018 10:15 am By calculating the normal-vector of the green face and adjusting in techdraw?
That would be my first approach. ProjectionDirection = face.normalAt(uRange/2, vRange/2).

Might be a nice addition to the Gui. Select a Face in 3d, draw the Face's parent Solid with projection direction of normal at midpoint of Face.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: How to align tilted parts

Post by ulrich1a »

wandererfan wrote: Sun Aug 12, 2018 4:31 pm Might be a nice addition to the Gui.
I am missing such a function for a long time. A planar face has also an axis, that can be used instead of the normal.

Here is my quick and dirty macro. Select a face and call the macro. It prints several information in the report view, including the axis data and the normal data. Unfortunately it is not possible to copy the text from the report view into an input box. But it is possible if the macro is called in the python console with execfile.

There are other cases where a special projection direction would be helpful, but no planar face is available. Think about a hole/bore in a cylinder mantle. A system similar to the attachment property could be used to determine the view projection.

Ulrich
Attachments
details_ergruenden.py.zip
(1.3 KiB) Downloaded 33 times
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: How to align tilted parts

Post by thschrader »

wandererfan wrote: Sun Aug 12, 2018 4:31 pm [Might be a nice addition to the Gui. Select a Face in 3d, draw the Face's parent Solid with projection direction of normal at midpoint of Face.
The sketches of the strut connections are drawn on the blue workplane (from workfeatures macro).
The plane runs through the mast-axis. I need this for aligning the struts.
In techdraw there should be an option like "project to selected plane/face".
On the other hand: my workflow from above (copy parts, align them with workfeatures makro to global x,y,z,-axis,
then load in techdraw) needs only seconds.
workplane.JPG
workplane.JPG (108.59 KiB) Viewed 1772 times
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: How to align tilted parts

Post by wandererfan »

thschrader wrote: Sun Aug 12, 2018 10:15 am I have a steel part (strut-connection, green), which is rotated among
the z-axis. When loading the part in techdraw, I get an isometrie.
How can I get a planar view? By calculating the normal-vector
of the green face and adjusting in techdraw? Or is there a smarter way
I dont know?
Try this again after git commit aa8feb79d0 makes its way into Daily.

Use Face or 3D direction for View and ProjGroup
- use current 3D window direction as starting
direction for DrawViewPart and ProjectionGroup
- if a Face is selected, use Face normal as
starting direction.
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: How to align tilted parts

Post by jaisejames »

very nice addition. Is it editable once selected ?
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: How to align tilted parts

Post by wandererfan »

jaisejames wrote: Fri Sep 07, 2018 5:09 am very nice addition. Is it editable once selected ?
It is just the starting point. You can still change the projection direction on the View or use the rotate gizmos in the ProjectionGroup dialog.

Note that the dialog gizmos can get confused if you do a lot of rotations. Best to have a good idea of desired view point before starting.
thschrader
Veteran
Posts: 3156
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: How to align tilted parts

Post by thschrader »

thanks!
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14575 (Git)
Build type: Release
Branch: master
Hash: a624fee2c27bbbb869df6a8ce40438953a282a8c
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
normal_to_face.JPG
normal_to_face.JPG (154.74 KiB) Viewed 1598 times
Post Reply