Draw two lines with given angle and distance between endpoints.
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 71
- Joined: Wed Apr 07, 2021 7:10 pm
Draw two lines with given angle and distance between endpoints.
Hi All,
In Draft workbench I would like to draw two lines with matching left points forming 60 degree angle and the other two points 3 mm apart. I did it in attached document, but I had to compute everything manually (using tan) and simply entered dimension.
Is there way to do it simpler (without manual computations)?
OS: Windows 10 Version 1809
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
In Draft workbench I would like to draw two lines with matching left points forming 60 degree angle and the other two points 3 mm apart. I did it in attached document, but I had to compute everything manually (using tan) and simply entered dimension.
Is there way to do it simpler (without manual computations)?
OS: Windows 10 Version 1809
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
- Attachments
-
- one saw tooth.FCStd
- two lines at an angle
- (7.2 KiB) Downloaded 22 times
Re: Draw two lines with given angle and distance between endpoints.
And this is why folks don't use draft.
This is a trivial exercise in Sketcher. Twelve mouse clicks and 30 seconds:
Two more mouse clicks and it makes a Draft Wire if desired.
This is a trivial exercise in Sketcher. Twelve mouse clicks and 30 seconds:
Two more mouse clicks and it makes a Draft Wire if desired.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
-
- Posts: 71
- Joined: Wed Apr 07, 2021 7:10 pm
Re: Draw two lines with given angle and distance between endpoints.
Thank you!
(you slightly changed my sketch, two points coincide and the other two are 3 mm apart)
Sketcher does not have either linear pattern or array. How would I go about repeating this this pattern?
(you slightly changed my sketch, two points coincide and the other two are 3 mm apart)
Sketcher does not have either linear pattern or array. How would I go about repeating this this pattern?
Re: Draw two lines with given angle and distance between endpoints.
Sketcher does have array.
And if you make cols =1 it's linear.
But I told before that ain't the best way to do it!
And if you make cols =1 it's linear.
But I told before that ain't the best way to do it!
-
- Posts: 71
- Joined: Wed Apr 07, 2021 7:10 pm
Re: Draw two lines with given angle and distance between endpoints.
Awesome, that is what I was looking for. Thank you!
Re: Draw two lines with given angle and distance between endpoints.
If you ask good questions you get good answers.
Re: Draw two lines with given angle and distance between endpoints.
sketcher is the way to go for these things.
to the literate question if it is possible in draft,
sure it is, just make some "construction" lines used to trim things,
they are just normal lines which I changed color on.
the angled lines are made with the length/angle option
construction lines are made in zero, and then moved
then it is just to trim the angled lines to the construction lines
or use the power of placement.
- make one horizontal line, say 10 mm
- duplicate so that you have 4 in total
- take the first one and change placement angle to 30 degrees, and the second one to -30
- move one line up 1.5 mm and one down 1.5 mm with placement
- make the trims...
using placement is probably about the same speed as sketcher if one is used to it.
to the literate question if it is possible in draft,
sure it is, just make some "construction" lines used to trim things,
they are just normal lines which I changed color on.
the angled lines are made with the length/angle option
construction lines are made in zero, and then moved
then it is just to trim the angled lines to the construction lines
or use the power of placement.
- make one horizontal line, say 10 mm
- duplicate so that you have 4 in total
- take the first one and change placement angle to 30 degrees, and the second one to -30
- move one line up 1.5 mm and one down 1.5 mm with placement
- make the trims...
using placement is probably about the same speed as sketcher if one is used to it.
-
- Posts: 71
- Joined: Wed Apr 07, 2021 7:10 pm
Re: Draw two lines with given angle and distance between endpoints.
@heda, thank you! I need to learn how to use construction lines.
Re: Draw two lines with given angle and distance between endpoints.
Hi
here little macro Macro_Line_Length (with Draft)
paste the complete macro in FreeCAD console python and type
ex:
mario
here little macro Macro_Line_Length (with Draft)
paste the complete macro in FreeCAD console python and type
ex:
Code: Select all
line_length(x1 = 0, y1 = 0, z1 = 0, length = 10, angle = 45)
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
-
- Posts: 71
- Joined: Wed Apr 07, 2021 7:10 pm
Re: Draw two lines with given angle and distance between endpoints.
@mario52 thank you! It will be my first experience with Python and FreeCAD