Arrows Draft-TechDraw

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Arrows Draft-TechDraw

Post by renatorivo »

1 - Draft WB - The arrow at the end of a DWire it is not aligned
2a - TechDraw WB - The arrows are flipped
2b - TechDraw WB - DWire Dwire has the arrow aligned, but flipped
test-frecce.FCStd
(7.72 KiB) Downloaded 105 times
frecce-draft.png
frecce-draft.png (3.23 KiB) Viewed 4637 times
frecce techdraw.png
frecce techdraw.png (5.8 KiB) Viewed 4637 times
OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13522 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Italian/Italy (it_IT)
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Arrows Draft-TechDraw

Post by wandererfan »

This change in Draft.py will fix the display in TechDraw, but not 3D or Drawing:

Code: Select all

@@ -2610,15 +2610,15 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
                 else:
                     svg = getPath(obj.Shape.Edges)
         if FreeCAD.GuiUp:
             if hasattr(obj.ViewObject,"EndArrow") and hasattr(obj.ViewObject,"ArrowType") and (len(obj.Shape.Vertexes) > 1):
                 if obj.ViewObject.EndArrow:
-                    p1 = getProj(obj.Shape.Vertexes[-2].Point)
-                    p2 = getProj(obj.Shape.Vertexes[-1].Point)
+                    p1 = getProj(obj.Shape.Vertexes[-1].Point)
+                    p2 = getProj(obj.Shape.Vertexes[-2].Point)
                     angle = -DraftVecUtils.angle(p2.sub(p1))
                     arrowsize = obj.ViewObject.ArrowSize.Value/pointratio
-                    svg += getArrow(obj.ViewObject.ArrowType,p2,arrowsize,stroke,linewidth,angle)
+                    svg += getArrow(obj.ViewObject.ArrowType,p1,arrowsize,stroke,linewidth,angle)
                     
     # techdraw expects bottom-to-top coordinates
yorik wrote: ping
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arrows Draft-TechDraw

Post by yorik »

hmm several issues at once...
The getSVG function has a techdraw argument that allows to do stuff only for techdraw, but there seem to be several other issues underneath, I'll have a look
User avatar
arturromarr
Posts: 326
Joined: Sat Jun 24, 2017 9:32 pm
Location: Poland

Re: Arrows Draft-TechDraw

Post by arturromarr »

Usually arrows are used this way
Attachments
FreeCAD arrow annotation.jpg
FreeCAD arrow annotation.jpg (170.09 KiB) Viewed 4122 times
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arrows Draft-TechDraw

Post by vocx »

yorik wrote: Mon May 21, 2018 3:15 pm hmm several issues at once...
The getSVG function has a techdraw argument that allows to do stuff only for techdraw, but there seem to be several other issues underneath, I'll have a look
Did you ever have time to look at this? I noticed this issue but forgot to report it. I use a lot the Arch -> Arch SectionPlane -> Techdraw workflow, but decided to omit arrows, except for dimensions, precisely because of this.

Code: Select all

OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Arrows Draft-TechDraw

Post by wandererfan »

vocx wrote: Mon Mar 25, 2019 10:41 pm Did you ever have time to look at this? I noticed this issue but forgot to report it. I use a lot the Arch -> Arch SectionPlane -> Techdraw workflow, but decided to omit arrows, except for dimensions, precisely because of this.
No, it slipped through the cracks. PR submitted. Not sure when it will get merged - as soon as the v0.18 release is sorted, I guess.
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Arrows Draft-TechDraw

Post by reox »

arturromarr wrote: Mon Mar 25, 2019 2:00 pm Usually arrows are used this way
Where does the annotation arrow feature comes from? Is this already in master? :o
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Arrows Draft-TechDraw

Post by wandererfan »

reox wrote: Wed Mar 27, 2019 7:26 pm Where does the annotation arrow feature comes from? Is this already in master? :o
Pretty sure that is a Draft Arrow + TD Annotation. Text + leader is coming for v0.19.
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Arrows Draft-TechDraw

Post by reox »

wandererfan wrote: Wed Mar 27, 2019 8:11 pm
reox wrote: Wed Mar 27, 2019 7:26 pm Where does the annotation arrow feature comes from? Is this already in master? :o
Pretty sure that is a Draft Arrow + TD Annotation. Text + leader is coming for v0.19.
I have spotted an icon :mrgreen:
FreeCAD arrow annotation.jpg
FreeCAD arrow annotation.jpg (35.37 KiB) Viewed 3951 times
Or is this just some macro added to the toolbar?
User avatar
arturromarr
Posts: 326
Joined: Sat Jun 24, 2017 9:32 pm
Location: Poland

Re: Arrows Draft-TechDraw

Post by arturromarr »

reox wrote: Wed Mar 27, 2019 7:26 pm Where does the annotation arrow feature comes from? Is this already in master? :o
FreeCAD+GIMP.
I'm not a programmer. I just want to show you how this functionality should look like.
This is a very often used function in mechanical drawings.
Post Reply