[solved] Defining plane through two points in the space

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
stefankorisnik3
Posts: 101
Joined: Sun Jul 24, 2022 12:49 pm

[solved] Defining plane through two points in the space

Post by stefankorisnik3 »

Having solid object c1Shape take two points from that object.
I want to make the plane that is normal on the z-axis and that contains both points.
I managed to find the normal vector to the plane i'm looking for but don't know what to set for the second parameter on the next function:

Code: Select all

slices = c1Shape.slice(Base.Vector(normalizedNormal[0], normalizedNormal[1], normalizedNormal[2]),  floatOffset)
I don't know what to set for the parameter

Code: Select all

floatOffset
I tried couple of things but didn't succeed to place my plane to go through starting points.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * CurvedShapes 1.0.3
  * Curves 0.5.2
Last edited by stefankorisnik3 on Sun Aug 07, 2022 4:26 pm, edited 1 time in total.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Defining plane through two points in the space

Post by onekk »

stefankorisnik3 wrote: Sun Aug 07, 2022 3:27 pm ...
A plane is defined by three points not collinear, it simple geometry.

https://en.wikipedia.org/wiki/Plane_(geometry)


Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
stefankorisnik3
Posts: 101
Joined: Sun Jul 24, 2022 12:49 pm

Re: Defining plane through two points in the space

Post by stefankorisnik3 »

I have complicated the thing.
I have three points so i do the following thing:
Make the plane with that three points and take the shape from the plane (

Code: Select all

toShape()
)

than find the intersecition with the function

Code: Select all

section
Post Reply