Okay I have two points a and b, vector(a) and vector(b). I wish to construct a plane perpendicular to the line(a,b) passing through a)
I know if I have two vectors I can create a perpendicular plane with the cross product and that in 2d I can create
a vector at 90 degrees by swapping x and y values and making one negative, but what about 3D?
projectToPlane(Vector1,Vector2)
Description: projects the vector on a plane defined by a point (Vector1) and a normal (Vector2).
Returns: nothing
Looked promising but returns nothing, so lost as to what it does.
Plane perpendicular to line(a,b)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Plane perpendicular to line(a,b)
Considering A & B are of App.Vector type.
Create a standard plane 'myPlane' (located at 0,0,0 and normal to Z axis) then
Create a standard plane 'myPlane' (located at 0,0,0 and normal to Z axis) then
Code: Select all
myPlane.Placement = App.Placement(A, App.Rotation(App.Vector(0,0,1), B-A))