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
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Datum plane tangent to surface

Post by freedman »

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: 65
Joined: Sat Sep 26, 2020 1:25 pm

Re: Datum plane tangent to surface

Post by FredOP »

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
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Datum plane tangent to surface

Post by saso »

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 23 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 826 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 823 times
Last edited by saso on Tue Oct 20, 2020 7:31 pm, edited 2 times in total.
drmacro
Veteran
Posts: 9007
Joined: Sun Mar 02, 2014 4:35 pm

Re: Datum plane tangent to surface

Post by drmacro »

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."
mario52
Veteran
Posts: 4699
Joined: Wed May 16, 2012 2:13 pm

Re: Datum plane tangent to surface

Post by mario52 »

hi

for the moment on point clicked

mario
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.
drmacro
Veteran
Posts: 9007
Joined: Sun Mar 02, 2014 4:35 pm

Re: Datum plane tangent to surface

Post by drmacro »

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 767 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."
User avatar
Vincent B
Veteran
Posts: 4741
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: Datum plane tangent to surface

Post by Vincent B »

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

Re: Datum plane tangent to surface

Post by mario52 »

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.
My macros on Gist.github here complete macros Wiki and forum.
drmacro
Veteran
Posts: 9007
Joined: Sun Mar 02, 2014 4:35 pm

Re: Datum plane tangent to surface

Post by drmacro »

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."
mario52
Veteran
Posts: 4699
Joined: Wed May 16, 2012 2:13 pm

Re: Datum plane tangent to surface

Post by mario52 »

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.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply