Show / Hide Table of Contents

Struct Plane

A simple plane as a value type. Is used e.g. as a drawing plane, an intersection plane etc. It also serves as a coordinate system (see CoordSys).

Implements
System.Runtime.Serialization.ISerializable
IJsonSerialize
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
[JsonVersion(serializeAsStruct = true, version = 1)]
public struct Plane : ISerializable, IJsonSerialize

Constructors

| Improve this Doc View Source

Plane(GeoPoint, GeoPoint, GeoPoint)

Creates a new plane with the given parameters. Throws a PlaneException, if the three points are colinear

Declaration
public Plane(GeoPoint Location, GeoPoint p1, GeoPoint p2)
Parameters
Type Name Description
GeoPoint Location

location of the plane

GeoPoint p1

specifies the direction of the x-axis

GeoPoint p2

specifies the direction of the y-axis, wich will be perpendicular to the x-axis

| Improve this Doc View Source

Plane(GeoPoint, GeoVector)

Creates a new plane. The parameter data is under-determined for the plane, so the x-axis and y-axis will be determined arbitrarily

Declaration
public Plane(GeoPoint Location, GeoVector Normal)
Parameters
Type Name Description
GeoPoint Location

location of the plane

GeoVector Normal

normal vector of the plane

| Improve this Doc View Source

Plane(GeoPoint, GeoVector, GeoVector)

Creates a new plane with the given parameters. Throws a PlaneException, if DirectionX and DirectionY have the same direction.

Declaration
public Plane(GeoPoint Location, GeoVector DirectionX, GeoVector DirectionY)
Parameters
Type Name Description
GeoPoint Location

location of the plane

GeoVector DirectionX

direction of the x-axis

GeoVector DirectionY

direction of the y-axis, will be adapted if not perpendicular to the x-axis

| Improve this Doc View Source

Plane(IJsonReadStruct)

Declaration
public Plane(IJsonReadStruct data)
Parameters
Type Name Description
IJsonReadStruct data
| Improve this Doc View Source

Plane(Plane)

Declaration
public Plane(Plane basePlane)
Parameters
Type Name Description
Plane basePlane
| Improve this Doc View Source

Plane(Plane, Double)

Declaration
public Plane(Plane basePlane, double offset)
Parameters
Type Name Description
Plane basePlane
System.Double offset
| Improve this Doc View Source

Plane(Plane.StandardPlane, Double)

Creates a new plane parallel to a Plane.StandardPlane with a given offset

Declaration
public Plane(Plane.StandardPlane std, double offset)
Parameters
Type Name Description
Plane.StandardPlane std

the standard plane

System.Double offset

the offset to the standard plane

| Improve this Doc View Source

Plane(SerializationInfo, StreamingContext)

Constructor required by deserialization

Declaration
public Plane(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

SerializationInfo

System.Runtime.Serialization.StreamingContext context

StreamingContext

Fields

| Improve this Doc View Source

XYPlane

Returns the X/Y plane.

Declaration
public static readonly Plane XYPlane
Field Value
Type Description
Plane
| Improve this Doc View Source

XZPlane

Returns the X/Z plane.

Declaration
public static readonly Plane XZPlane
Field Value
Type Description
Plane
| Improve this Doc View Source

YZPlane

Returns the Y/Z plane.

Declaration
public static readonly Plane YZPlane
Field Value
Type Description
Plane

Properties

| Improve this Doc View Source

CoordSys

Returns the coordinate system corresponding to this plane. The z-axis of the coordinate system is the normal vector of this plane (always right handed)

Declaration
public CoordSys CoordSys { get; }
Property Value
Type Description
CoordSys
| Improve this Doc View Source

DirectionX

Gets or sets the direction of the x-axis of this plane. Setting the x-axis results in a reculculation of the y-axis to make the axis perpendicular.

Declaration
public GeoVector DirectionX { get; set; }
Property Value
Type Description
GeoVector
| Improve this Doc View Source

DirectionY

Gets or sets the direction of the y-axis of this plane. Setting the y-axis results in a reculculation of the x-axis to make the axis perpendicular.

Declaration
public GeoVector DirectionY { get; set; }
Property Value
Type Description
GeoVector
| Improve this Doc View Source

Location

Gets or sets the location of this plane

Declaration
public GeoPoint Location { get; set; }
Property Value
Type Description
GeoPoint
| Improve this Doc View Source

ModOpToGlobal

Declaration
public ModOp ModOpToGlobal { get; }
Property Value
Type Description
ModOp
| Improve this Doc View Source

Normal

Gets or sets the normal vector of this plane. Setting the normal vector results in a recalculation of the x-axis and y-axis of this plane

Declaration
public GeoVector Normal { get; set; }
Property Value
Type Description
GeoVector

Methods

| Improve this Doc View Source

Align(GeoPoint2D)

Declaration
public void Align(GeoPoint2D c)
Parameters
Type Name Description
GeoPoint2D c
| Improve this Doc View Source

Align(Plane, Boolean)

Aligns the DirectionX and DirectionY vectors of this plane so that the projection of DirectionX of AlignTo and DircetionX of this plane are parallel. If the two planes are parallel, the DirectionX and DirectionY of both planes will also be parallel. The plane will not be changed. The Location of this plane will be changed to a point closest to the location of AlignTo, if relocate is true, otherwise the location remains unchanged.

Declaration
public void Align(Plane alignTo, bool relocate)
Parameters
Type Name Description
Plane alignTo
System.Boolean relocate

relocate this plane

| Improve this Doc View Source

Align(Plane, Boolean, Boolean)

Aligns the DirectionX and DirectionY vectors of this plane so that the projection of DirectionX of AlignTo and DircetionX of this plane are parallel. If the two planes are parallel, the DirectionX and DirectionY of both planes will also be parallel. The plane will not be changed. The Location of this plane will be changed to a point closest to the location of AlignTo, if relocate is true, otherwise the location remains unchanged. If flip is true there is an additional check whether the angle between the two normal vectors is less than 90°. If not, the y-axis is reversed and the angle between the two normal vectors will be less than 90°

Declaration
public void Align(Plane alignTo, bool relocate, bool flip)
Parameters
Type Name Description
Plane alignTo

Plane to align to

System.Boolean relocate

relocate this plane

System.Boolean flip
| Improve this Doc View Source

Distance(GeoPoint)

Returns the signed distance of the point from the plane. The direction of the normal vector of the plane determins the sign of the result.

Declaration
public double Distance(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

the point

Returns
Type Description
System.Double

the distance

| Improve this Doc View Source

Elem(GeoPoint)

Declaration
public bool Elem(GeoPoint g)
Parameters
Type Name Description
GeoPoint g
Returns
Type Description
System.Boolean
| Improve this Doc View Source

FromPoints(GeoPoint[], out Double, out Boolean)

Finds a plane that best fits through the given points. Calculates also the maximum distance of the points from that plane. If MaxDistance is 0.0 or small, the points are coplanar.

Declaration
public static Plane FromPoints(GeoPoint[] Points, out double MaxDistance, out bool isLinear)
Parameters
Type Name Description
GeoPoint[] Points

points to build the plane from

System.Double MaxDistance

maximum distance of the points from the plane

System.Boolean isLinear
Returns
Type Description
Plane

the plane

| Improve this Doc View Source

GetProjection()

Returns a projection that projects (perpendiccular) from global space to this plane

Declaration
public Projection GetProjection()
Returns
Type Description
Projection

the projection

| Improve this Doc View Source

Interfere(GeoPoint, GeoPoint)

Declaration
public GeoPoint[] Interfere(GeoPoint sp, GeoPoint ep)
Parameters
Type Name Description
GeoPoint sp
GeoPoint ep
Returns
Type Description
GeoPoint[]
| Improve this Doc View Source

Intersect(GeoPoint, GeoVector)

Returns the intersection plane of the line given by the parameters with this plane.

Declaration
public GeoPoint Intersect(GeoPoint LinePoint, GeoVector LineDir)
Parameters
Type Name Description
GeoPoint LinePoint

point on the line

GeoVector LineDir

direction of the line

Returns
Type Description
GeoPoint
| Improve this Doc View Source

Intersect(GeoPoint, GeoVector, out GeoPoint)

Declaration
public bool Intersect(GeoPoint LinePoint, GeoVector LineDir, out GeoPoint ip)
Parameters
Type Name Description
GeoPoint LinePoint
GeoVector LineDir
GeoPoint ip
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Intersect(Plane, out GeoPoint, out GeoVector)

Declaration
public bool Intersect(Plane other, out GeoPoint loc, out GeoVector dir)
Parameters
Type Name Description
Plane other
GeoPoint loc
GeoVector dir
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Intersect3Planes(GeoPoint, GeoVector, GeoPoint, GeoVector, GeoPoint, GeoVector, out GeoPoint)

Declaration
public static bool Intersect3Planes(GeoPoint loc1, GeoVector norm1, GeoPoint loc2, GeoVector norm2, GeoPoint loc3, GeoVector norm3, out GeoPoint ip)
Parameters
Type Name Description
GeoPoint loc1
GeoVector norm1
GeoPoint loc2
GeoVector norm2
GeoPoint loc3
GeoVector norm3
GeoPoint ip
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsValid()

An uninitialized plane is invalid, because its normal vector is (0,0,0).

Declaration
public bool IsValid()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Modify(ModOp)

Declaration
public void Modify(ModOp m)
Parameters
Type Name Description
ModOp m
| Improve this Doc View Source

Offset(Double)

Returns a plane parallel to this plane with the given offset

Declaration
public Plane Offset(double dist)
Parameters
Type Name Description
System.Double dist

the offset

Returns
Type Description
Plane

the parallel plane

| Improve this Doc View Source

Project(GeoPoint)

Projects the given point (perpendicular) onto this plane and returns the two-dimensional point as expressed in the coordinate system of this plane.

Declaration
public GeoPoint2D Project(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

the point

Returns
Type Description
GeoPoint2D

the point in the coordinate system of this plane

| Improve this Doc View Source

Project(GeoPoint[])

Projects the given point (perpendicular) onto this plane and returns the two-dimensional point as expressed in the coordinate system of this plane.

Declaration
public GeoPoint2D[] Project(GeoPoint[] p)
Parameters
Type Name Description
GeoPoint[] p

the point

Returns
Type Description
GeoPoint2D[]

the point in the coordinate system of this plane

| Improve this Doc View Source

Project(GeoVector)

Projects the given vector (perpendicular) onto this plane and returns the two-dimensional vector as expressed in the coordinate system of this plane.

Declaration
public GeoVector2D Project(GeoVector v)
Parameters
Type Name Description
GeoVector v

the vector

Returns
Type Description
GeoVector2D

the vector in the coordinate system of this plane

| Improve this Doc View Source

Reverse()

Declaration
public void Reverse()
| Improve this Doc View Source

ToGlobal(GeoPoint)

Inverse to the appropriate ToLocal(GeoPoint) method. The given point is assumed in the coordinate ststem of this plane. Returns the point in the global coordinate system.

Declaration
public GeoPoint ToGlobal(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

point in the plane coordinate system

Returns
Type Description
GeoPoint

point in the global coordinate system

| Improve this Doc View Source

ToGlobal(GeoPoint2D)

Inverse to the appropriate Project(GeoPoint) method. Returns the point in the global coordinate system

Declaration
public GeoPoint ToGlobal(GeoPoint2D p)
Parameters
Type Name Description
GeoPoint2D p

2d point in the local system of this plane

Returns
Type Description
GeoPoint

3d point in the global coordinate system

| Improve this Doc View Source

ToGlobal(GeoVector)

Returns the 3D GeoVector corresponding to the given GeoVector in the coordinate system of the plane.

Declaration
public GeoVector ToGlobal(GeoVector v)
Parameters
Type Name Description
GeoVector v

a vector in the coordinate system of the plane

Returns
Type Description
GeoVector

a 3D vector in the global coordinate system

| Improve this Doc View Source

ToGlobal(GeoVector2D)

Inverse to the appropriate Project(GeoVector) method. Returns the vector in the global coordinate system

Declaration
public GeoVector ToGlobal(GeoVector2D v)
Parameters
Type Name Description
GeoVector2D v

2d vector in the coordinate system of the plane

Returns
Type Description
GeoVector

3d vector in the global coordinate system

| Improve this Doc View Source

ToLocal(GeoPoint)

Returns the point as expressed in the coordinate system of this plane

Declaration
public GeoPoint ToLocal(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

point (in the global system)

Returns
Type Description
GeoPoint

point in the local system of this plane

| Improve this Doc View Source

ToLocal(GeoVector)

Returns the vector as expressed in the coordinate system of this plane

Declaration
public GeoVector ToLocal(GeoVector v)
Parameters
Type Name Description
GeoVector v

vector (in the global system)

Returns
Type Description
GeoVector

vector in the local system of this plane

| Improve this Doc View Source

ToLocal(Plane)

Returns the plane given in parameter p expressed in the coordinate system of this plane

Declaration
public Plane ToLocal(Plane p)
Parameters
Type Name Description
Plane p

plane in global system

Returns
Type Description
Plane

plane in local system

Explicit Interface Implementations

| Improve this Doc View Source

IJsonSerialize.GetObjectData(IJsonWriteData)

Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
Type Name Description
IJsonWriteData data
| Improve this Doc View Source

IJsonSerialize.SetObjectData(IJsonReadData)

Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
Type Name Description
IJsonReadData data
| Improve this Doc View Source

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info
System.Runtime.Serialization.StreamingContext context

Implements

System.Runtime.Serialization.ISerializable
IJsonSerialize
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX