Datum plane tangent to surface

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
freedman
Posts: 1680
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Datum plane tangent to surface

Post by freedman » Mon Oct 19, 2020 10:00 pm

I have to say, mario52 rocked that one. I really like one click tools, they save a bunch of time. I'm going to take a look at that macro.
FredOP
Posts: 51
Joined: Sat Sep 26, 2020 1:25 pm

Re: Datum plane tangent to surface

Post by FredOP » Tue Oct 20, 2020 10:44 am

saso wrote:
Sun Oct 18, 2020 8:30 pm
revolution_tangent_plane.FCStd


DatumPlane is using edge of the Sketch as support and is set tangent to the surface by FrenetTB map mode and positioned by the map path parameter.


planebyedge.gif


DatumPlane001 is using the DatumPoint and the face of the Revolution as supports and is set tangent to the surface by the TangentPlane map mode. DatumPoint is using the Line and the face of the revolution as supports, you can double click on the Line and move the outer point around to change the position (activate the DraftWB before). Instead of the Line you can use a sketch or other tools to have a more precise control over the exact position of the DatumPoint.

Note, regardless if you use the Line, the sketch or some other similar tool, you don't have to make the line tangential to the surface, the line is used only to drive the position of the point on the surface, the TangentPlane map mode will make the plane tangential.


planebyline.gif
Thanks, that solved my problem
Too bad Map Path Parameter is not exposed in the Tasks panel, and the wheel event or keyboard event are set to +1 /- 1 when the value is in the [0..1] range, and for some reason limited to 2 decimal points.
User avatar
saso
Posts: 1584
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Datum plane tangent to surface

Post by saso » Tue Oct 20, 2020 12:07 pm

FredOP wrote:
Tue Oct 20, 2020 10:44 am
the wheel event or keyboard event are set to +1 /- 1 when the value is in the [0..1] range, and for some reason limited to 2 decimal points.
yes, should probably get fixed/improved :)

here are two more variants of the second method that uses the TangentPlane map mode, which can give you more control over the exact position of the point/plane...

revolution_tangent_plane_2.FCStd
(14.58 KiB) Downloaded 7 times

- for one you set the "height" of the DatumPlane (in Data Properties dialog, Attachment Offset -> Position -> z) and it will drive the DatumPoint001 along the Revolution edge...

tangentplanebyplane.gif
tangentplanebyplane.gif (411.87 KiB) Viewed 207 times

- for the other you have a line in Sketch001 that you can position inside the sketch using the sketch tools (you can create a more advanced sketch with constraints and construction elements if you need). you can also change the orientation of the sketch (in Data Properties dialog, Attachment Offset -> Angle <and> Axis -> 0,1,0) to rotate/position it around the Revolution object...

tangentplanebysketch.gif
tangentplanebysketch.gif (219.49 KiB) Viewed 204 times
Last edited by saso on Tue Oct 20, 2020 7:31 pm, edited 2 times in total.
drmacro
Posts: 1933
Joined: Sun Mar 02, 2014 4:35 pm

Re: Datum plane tangent to surface

Post by drmacro » Tue Oct 20, 2020 1:28 pm

mario52 wrote:
Mon Oct 19, 2020 12:09 pm
Macro_WorkFeatures macro Image
...

Nice!

But, what do you do with the faces once you have them? And how do you place them precisely? 🤔
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."

My beginners, written treatise: Learning FreeCAD
mario52
Posts: 3215
Joined: Wed May 16, 2012 2:13 pm

Re: Datum plane tangent to surface

Post by mario52 » Tue Oct 20, 2020 5:34 pm

hi

for the moment on point clicked

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
drmacro
Posts: 1933
Joined: Sun Mar 02, 2014 4:35 pm

Re: Datum plane tangent to surface

Post by drmacro » Tue Oct 20, 2020 6:31 pm

mario52 wrote:
Mon Oct 19, 2020 12:09 pm
Macro_WorkFeatures macro Image
@mario

- When I go to Tools>Addon Manager Macros tab, I see no macro named workfeature.

- When I go to Tools>Addon Manager Workbenches tab I see this:
workfeats.png
workfeats.png (42.63 KiB) Viewed 148 times
- which one should I select, workfeature workbench or workfeature-macro ?

- I already have the workfeature-macro installed, but I can't find it in the macro directory (looked in the default directory and the custom directory I have defined in preferences.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."

My beginners, written treatise: Learning FreeCAD
User avatar
GlouGlou
Posts: 2610
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: Datum plane tangent to surface

Post by GlouGlou » Tue Oct 20, 2020 6:57 pm

warning: workfeature macro works with python 2. :roll:
mario52
Posts: 3215
Joined: Wed May 16, 2012 2:13 pm

Re: Datum plane tangent to surface

Post by mario52 » Wed Oct 21, 2020 11:48 am

hi

you must run start_WF.FCMacro as a macro

here my complete command line and run with FreeCAD

Code: Select all

C:\FreeCAD_0.19.22670_Win-LPv12.1.6_vc14.x-x86-64\bin\FreeCAD.exe "C:\Users\UserName\AppData\Roaming\FreeCAD\Mod\WorkFeature\start_WF.FCMacro"
my installation:
C:\Users\UserName\AppData\Roaming\FreeCAD\Mod\WorkFeature

  1. WorkFeature
    • WorkFeature (directory with all files)
      • all files
    • README.md
    • start_WF.FCMacro
    • start_WF.py



OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22670 (Git)
Build type: Release
Branch: master
Hash: 12155f4aab09047c5697db0c1b3cf93b02edda03
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Mars (fr_MA)


mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
drmacro
Posts: 1933
Joined: Sun Mar 02, 2014 4:35 pm

Re: Datum plane tangent to surface

Post by drmacro » Wed Oct 21, 2020 12:17 pm

mario52 wrote:
Wed Oct 21, 2020 11:48 am
hi

you must run start_WF.FCMacro as a macro
GlouGlou wrote:
Tue Oct 20, 2020 6:57 pm
warning: workfeature macro works with python 2. :roll:
Hmm...so, it's a macro that gets installed from the Addon Workbench menu, it runs in python 2, and must be started as a macro from the command line.

:roll: :?

And, I still don't know what the workbench in the Addon Workbench menu is or why I would ever choose that one. :?

I have used features of the Workfeature before (the viewing normals is invaluable when trying to figure out why/when/if normals are reversed). :)

But the macro (workbench?) seems to be in some state of development or out of the ordinary deployment or has an identity issue. :lol:

And, if it is Python2...really? Python 3 was released in 2008! and Python2 was EOL (end of life) in early 2020 (10 years later than it should have been). :shock:

(Please note, this is more statements of confusion than complaint. I know a lot of work has gone into Workfeature and I appreciate that. ;) )
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."

My beginners, written treatise: Learning FreeCAD
mario52
Posts: 3215
Joined: Wed May 16, 2012 2:13 pm

Re: Datum plane tangent to surface

Post by mario52 » Fri Oct 23, 2020 10:47 am

hi
drmacro wrote:
Wed Oct 21, 2020 12:17 pm
But the macro (workbench?) seems to be in some state of development
yes begin ...
drmacro wrote:
Wed Oct 21, 2020 12:17 pm
And, if it is Python2...really? Python 3 was released in 2008! and Python2 was EOL (end of life) in early 2020 (10 years later than it should have been).
Python version 2, 5 or 10 not problem if the macro work

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Dizzwold, drmacro, watsug and 14 guests